diff options
author | Petr Hosek <phosek@chromium.org> | 2019-05-01 03:30:51 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2019-05-01 03:30:51 +0000 |
commit | 8bff215cea06b2a2a25fe7680a40bf9f85b78d5d (patch) | |
tree | 2a7024e26398a2bcb71ebcf70e512797fbd3dc2c | |
parent | ec9ec0d054a786360bc94a5a3fd481ce829f9f15 (diff) | |
download | compiler-rt-8bff215cea06b2a2a25fe7680a40bf9f85b78d5d.tar.gz |
[compiler-rt] Pass sysroot and disable pedantic for crtbegin.o/crtend.o
These are needed to make bots happy.
Differential Revision: https://reviews.llvm.org/D61363
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@359646 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | cmake/Modules/AddCompilerRT.cmake | 5 | ||||
-rw-r--r-- | cmake/config-ix.cmake | 1 | ||||
-rw-r--r-- | lib/crt/CMakeLists.txt | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake index 531d6fd09..8f49f3e7a 100644 --- a/cmake/Modules/AddCompilerRT.cmake +++ b/cmake/Modules/AddCompilerRT.cmake @@ -276,7 +276,10 @@ function(add_compiler_rt_runtime name type) if(type STREQUAL "OBJECT") get_property(cflags_${libname} SOURCE ${sources_${libname}} PROPERTY COMPILE_FLAGS) if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET) - list(APPEND cflags_${libname} "-target ${CMAKE_C_COMPILER_TARGET}") + list(APPEND cflags_${libname} "--target=${CMAKE_C_COMPILER_TARGET}") + endif() + if(CMAKE_SYSROOT) + list(APPEND cflags_${libname} "--sysroot=${CMAKE_SYSROOT}") endif() string(REPLACE ";" " " extra_cflags_${libname} "${extra_cflags_${libname}}") string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index 1eb29ceba..bf951978d 100644 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -100,6 +100,7 @@ check_cxx_compiler_flag("-Werror -Wnon-virtual-dtor" COMPILER_RT_HAS_WNON_VIRT check_cxx_compiler_flag("-Werror -Wvariadic-macros" COMPILER_RT_HAS_WVARIADIC_MACROS_FLAG) check_cxx_compiler_flag("-Werror -Wunused-parameter" COMPILER_RT_HAS_WUNUSED_PARAMETER_FLAG) check_cxx_compiler_flag("-Werror -Wcovered-switch-default" COMPILER_RT_HAS_WCOVERED_SWITCH_DEFAULT_FLAG) +check_cxx_compiler_flag(-Wno-pedantic COMPILER_RT_HAS_WNO_PEDANTIC) check_cxx_compiler_flag(/W4 COMPILER_RT_HAS_W4_FLAG) check_cxx_compiler_flag(/WX COMPILER_RT_HAS_WX_FLAG) diff --git a/lib/crt/CMakeLists.txt b/lib/crt/CMakeLists.txt index f0e8118e9..2323e5754 100644 --- a/lib/crt/CMakeLists.txt +++ b/lib/crt/CMakeLists.txt @@ -73,6 +73,7 @@ check_cxx_section_exists(".init_array" COMPILER_RT_HAS_INITFINI_ARRAY append_list_if(COMPILER_RT_HAS_INITFINI_ARRAY -DCRT_HAS_INITFINI_ARRAY CRT_CFLAGS) append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC CRT_CFLAGS) +append_list_if(COMPILER_RT_HAS_NO_PEDANTIC -Wno-pedantic CRT_CFLAGS) foreach(arch ${CRT_SUPPORTED_ARCH}) add_compiler_rt_runtime(clang_rt.crtbegin |