-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[runtimes] Probe for -nostdlib++ and -nostdinc++ with the C compiler (#…
…108357) While these flags semantically are relevant only for C++, we do add them to CMAKE_REQUIRED_FLAGS if they are detected. All flags in that variable are used both when testing compilation of C and C++ (and for detecting libraries, which uses the C compiler driver). Therefore, to be sure we safely can add the flags to CMAKE_REQUIRED_FLAGS, test for the option with the C language. This should fix compilation with GCC; newer versions of GCC do support the -nostdlib++ option, but it's only supported by the C++ compiler driver, not the C driver. (However, many builds of GCC also do accept the option with the C driver, if GCC was compiled with Ada support enabled, see [1]. That's why this issue isn't noticed in all configurations with GCC.) Clang does support these options in both C and C++ driver modes. This should fix #90332. [1] #90332 (comment)
- Loading branch information
Showing
6 changed files
with
35 additions
and
19 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