-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc] Include CheckCXXCompilerFlag when checking compiler features #118862
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
Conversation
@llvm/pr-subscribers-libc Author: Tristan Ross (RossComputerGuy) ChangesIncludes Full diff: https://github.com/llvm/llvm-project/pull/118862.diff 1 Files Affected:
diff --git a/libc/cmake/modules/CheckCompilerFeatures.cmake b/libc/cmake/modules/CheckCompilerFeatures.cmake
index 862c7ecbd7fdf4..85e1cabd1483e3 100644
--- a/libc/cmake/modules/CheckCompilerFeatures.cmake
+++ b/libc/cmake/modules/CheckCompilerFeatures.cmake
@@ -1,3 +1,5 @@
+include(CheckCXXCompilerFlag)
+
# ------------------------------------------------------------------------------
# Compiler features definition and flags
# ------------------------------------------------------------------------------
|
include(CheckCXXCompilerFlag) | ||
|
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.
Move below the header comments.
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.
This should probably just go at the top level since it's used here
startup/linux/CMakeLists.txt
77:check_cxx_compiler_flag("-r" LIBC_LINKER_SUPPORTS_RELOCATABLE)
cmake/modules/CheckCompilerFeatures.cmake
136:check_cxx_compiler_flag("-ftrivial-auto-var-init=pattern" LIBC_CC_SUPPORTS_PATTERN_INIT)
139:check_cxx_compiler_flag("-nostdlib++" LIBC_CC_SUPPORTS_NOSTDLIBPP)
142:check_cxx_compiler_flag("-nostdlibinc" LIBC_CC_SUPPORTS_NOSTDLIBINC)
cmake/modules/prepare_libc_gpu_build.cmake
44: check_cxx_compiler_flag(-mcpu=native PLATFORM_HAS_GPU)
46: check_cxx_compiler_flag(-march=native PLATFORM_HAS_GPU)
33ec79a
to
0984c89
Compare
Oh, alright. I grepped and had found that it was common to include in |
0984c89
to
84e0dde
Compare
I've moved it to the top level for libc. |
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.
nit. can you put it next to the include on line 8.
84e0dde
to
989c7db
Compare
T'is done, thank you for the quick review. |
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.
Thanks
Includes
CheckCXXCompilerFlag
so when building LLVM libc is built standalone, it actually works and doesn't complain aboutcheck_cxx_compiler_flag
not being defined.