Skip to content

Conversation

@damyanp
Copy link
Member

@damyanp damyanp commented Oct 16, 2025

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, at which point this change should be reverted.

Copy link
Member

@hekota hekota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

remove unused original_li
@damyanp
Copy link
Member Author

damyanp commented Oct 16, 2025

@microsoft-github-policy-service rerun

@damyanp damyanp merged commit ea7e910 into main Oct 16, 2025
13 checks passed
@damyanp damyanp deleted the user/damyanp/arm64x branch October 16, 2025 19:26
@github-project-automation github-project-automation bot moved this from New to Done in HLSL Roadmap Oct 16, 2025
damyanp added a commit that referenced this pull request Oct 24, 2025
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)
damyanp added a commit that referenced this pull request Oct 28, 2025
Since we last built this branch there have been various changes to the
compilers and build images we use that require code updates to allow
this to continue building.

These changes impact our testing / building, or guide type checking in the compiler, and so are NFC as far as the product is concerned.

### Workaround broken ARM64X / MSVC_BUILD_AS_X builds (#7827)
(cherry picked from commit ea7e910)

### Use WARP from nuget by default (#7427)
(cherry picked from commit 33dd542)
Manually moved changes from HlslExecTestUtils.h into ExecutionTest.cpp

### Add hctbuild.cmd parameter to specify the nuget config file (#7785)
(cherry picked from commit 06dcb00)

### Change type of DiagnosticHandlerTy
(cherry picked from commit b05a11a)

### Type safe version of MachinePassRegistry
(cherry picked from commit 4ddee81)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Justin Bogner <mail@justinbogner.com>
Co-authored-by: Serge Guelton <sguelton@quarkslab.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants