-
Notifications
You must be signed in to change notification settings - Fork 755
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[runtimes] Don't try passing --target flags to GCC
When a target triple is specified in CMake via XXX_TARGET_TRIPLE, we tried passing the --target=<...> flag to the compiler. However, not all compilers support that flag (e.g. GCC, which is not a cross-compiler). As a result, setting e.g. LIBCXX_TARGET_TRIPLE=<host-triple> would end up trying to pass --target=<host-triple> to GCC, which breaks everything because the flag isn't even supported. This commit only adds `--target=<...>` & friends to the flags if it is supported by the compiler. One could argue that it's confusing to pass LIBCXX_TARGET_TRIPLE=<...> and have it be ignored. That's correct, and one possibility would be to assert that the requested triple is the same as the host triple when we know the compiler is unable to cross-compile. However, note that this is a pre-existing issue (setting the TARGET_TRIPLE variable never had an influence on the flags passed to the compiler), and also fixing that is starting to look like reimplementing a lot of CMake logic that is already handled with CMAKE_CXX_COMPILER_TARGET. Differential Revision: https://reviews.llvm.org/D106082
- Loading branch information
Showing
6 changed files
with
42 additions
and
9 deletions.
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
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
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
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
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
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