KEMBAR78
Build benchmarks for ARM64EC pipeline by cpplearner · Pull Request #5517 · microsoft/STL · GitHub
Skip to content

Conversation

@cpplearner
Copy link
Contributor

In #5492, I did not build the benchmarks because I didn't know how to get google-benchmark built for ARM64EC. Now I seem to find the solution.

To create static libraries for ARM64EC, the /machine:arm64ec option needs to be passed to lib.exe. CMake doc mentions that the STATIC_LIBRARY_OPTIONS target property holds the options for lib.exe. This means benchmarks/CMakeLists.txt needs to set this property for each relevant target, including those defined by google-benchmark. But it turns out that CMAKE_STATIC_LINKER_FLAGS will also be passed to lib.exe.

Setting CMAKE_STATIC_LINKER_FLAGS is simpler, and it affects every target, including those added in the future (either by us or by google-benchmark), which is desirable in this specific case. So this PR chooses to set CMAKE_STATIC_LINKER_FLAGS.

(Note: it seems that CMAKE_STATIC_LINKER_FLAGS defaults to /machine:arm64, so I decided to override it instead of appending /machine:arm64ec to it, but appending might be more future-proof.)

(Note 2: just in case you are interested: stl/CMakeLists.txt handles this by adding ${VCLIBS_EXPLICIT_MACHINE} to the STATIC_LIBRARY_OPTIONS target property for every relevant target, where ${VCLIBS_EXPLICIT_MACHINE} is /machine:arm64ec for ARM64EC and empty otherwise.)

@cpplearner cpplearner requested a review from a team as a code owner May 17, 2025 15:04
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews May 17, 2025
@StephanTLavavej StephanTLavavej added infrastructure Related to repository automation test Related to test code ARM64 Related to the ARM64 architecture labels May 18, 2025
@StephanTLavavej StephanTLavavej self-assigned this May 18, 2025
@StephanTLavavej StephanTLavavej removed their assignment May 19, 2025
@StephanTLavavej StephanTLavavej moved this from Initial Review to Ready To Merge in STL Code Reviews May 19, 2025
@StephanTLavavej
Copy link
Member

Thanks for figuring out these incantations! 🦾 6️⃣ 4️⃣

@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews May 22, 2025
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit aa02cd9 into microsoft:main May 22, 2025
40 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews May 22, 2025
@StephanTLavavej
Copy link
Member

All shall love ARM64EC and despair! 🧝‍♀️ 💍 🦹‍♀️

@cpplearner cpplearner deleted the arm64ec branch May 22, 2025 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ARM64 Related to the ARM64 architecture infrastructure Related to repository automation test Related to test code

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants