-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CMake detection of cross-compilers on arm/arm64 build arch #35084
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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 was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the test entirely seems wrong as that will do the wrong thing when arm is the native architecture?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong, yes. But not worse than current support for modern arm64 hosts.
How much of vcpkg works out of the box on 32-bit arm hosts? The user must provide cmake and ninja, so maybe it is fair to ask for providing the compiler variables, too.
Couldn't we do
find_program(var NAMES <prefix>-tool tool ...)
? This would consider user input, prefix, default. Hard-coded values belong into custom toolchain files.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I declare the table of possible combinations of host & target instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FTR
find_program
is whatscripts/cmake/mingw.cmake
does:vcpkg/scripts/toolchains/mingw.cmake
Lines 24 to 25 in 23ceb9c
(However, I noticed this now due to insufficient initalization of
CMAKE_SYSTEM_PROCESSOR
in a test project.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'm sold by 'not worse than the status quo'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly that doesn't seem to be so easy, overriding the variables from the command-line doesn't work... maybe via a triplet, but that would introduce a fair bit of hassle for anyone who wants to perform a native build on an ARM machine. Ideally, we should just make the defaults work (see my comment below and #38113).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can agree on that, and #38113 is a good direction. It is just not the whole discussion from the last days.