Commit 5332b16
committed
Workaround broken ARM64X / MSVC_BUILD_AS_X builds (#7827)
Currently, when internal pipelines build for ARM64X we use the older
experimental `MSVC_BUILD_AS_X` feature. The latest VS release has
regressed this functionality, resulting in the import libs for the ARM64
and ARM64X DLLs being written to the same location.
Remember that ARM64X binaries are fat binaries containing both ARM64 and
ARM64EC code. When building for ARM64 with MSVC_BUILD_AS_X, the Visual
Studio cmake generator actually generates vcxproj files that build ARM64
and ARM64EC (with the ARM64EC version being the one that becomes the
combined ARM64X binary. The generated project knows how to ensure that
the ARM64 DLL is built to one location and the ARM64X one goes into the
destination specified in the cmake scripts. However, the import
libraries end up being configured to go into the same location,
resulting in a race condition.
Our cmake scripts have no knowledge of these two platforms, and so
there's no direct way to address this. This workaround makes it so that
when building in this mode the import libraries are written to a
location containing `$(PLATFORM)`. This is a msbuild variable that's
evaluated at build time.
This is a short-term fix that allows us to unblock our internal
pipelines. Longer-term we should move to using the [documented ARM64X
approach](https://learn.microsoft.com/en-us/windows/arm/arm64x-build#building-an-arm64x-dll-with-cmake),
at which point this change should be reverted.
(cherry picked from commit ea7e910)1 parent 0352ada commit 5332b16
1 file changed
+24
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
225 | 235 | | |
226 | 236 | | |
227 | 237 | | |
228 | 238 | | |
229 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
230 | 254 | | |
231 | 255 | | |
232 | 256 | | |
| |||
0 commit comments