Fix cross-compiling by using CMAKE_SYSTEM_PROCESSOR and respecting -march|-mcpu - #904
Merged
Conversation
There is no need to check the architecture twice. Also check for arm64 (MacOS) wherever we check for aarch64 (Linux). Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Packagers may specify a target system up front, which should be respected. The CRC extensions are not strictly necessary as there is a software fallback. Otherwise, use -mcpu=native if it works (it won't when cross-compiling) or -mcpu=generic+crc. Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Collaborator
|
Thanks for your contribution. Please sign the CLA. |
Collaborator
|
Thanks for the contribute. We do should considering when We are looking forward to merge it, still, need you to signing the CLA. |
Contributor
Author
|
I have signed the CLA through GitHub and sent the signed PDF by email. |
beef9999
approved these changes
Jul 30, 2025
Coldwings
approved these changes
Jul 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is no need to check the architecture twice. Also check for arm64 (MacOS) wherever we check for aarch64 (Linux).
Packagers may specify a target system up front, which should be respected. The CRC extensions are not strictly necessary as there is a software fallback.
Otherwise, use
-mcpu=nativeif it works (it won't when cross-compiling) or-mcpu=generic+crc.