[compiler-rt] r359646 - [compiler-rt] Pass sysroot and disable pedantic for crtbegin.o/crtend.o

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 20:30:51 PDT 2019


Author: phosek
Date: Tue Apr 30 20:30:51 2019
New Revision: 359646

URL: http://llvm.org/viewvc/llvm-project?rev=359646&view=rev
Log:
[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

Modified:
    compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
    compiler-rt/trunk/cmake/config-ix.cmake
    compiler-rt/trunk/lib/crt/CMakeLists.txt

Modified: compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake?rev=359646&r1=359645&r2=359646&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake Tue Apr 30 20:30:51 2019
@@ -276,7 +276,10 @@ function(add_compiler_rt_runtime name ty
     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

Modified: compiler-rt/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/config-ix.cmake?rev=359646&r1=359645&r2=359646&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/config-ix.cmake (original)
+++ compiler-rt/trunk/cmake/config-ix.cmake Tue Apr 30 20:30:51 2019
@@ -100,6 +100,7 @@ check_cxx_compiler_flag("-Werror -Wnon-v
 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)

Modified: compiler-rt/trunk/lib/crt/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/crt/CMakeLists.txt?rev=359646&r1=359645&r2=359646&view=diff
==============================================================================
--- compiler-rt/trunk/lib/crt/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/crt/CMakeLists.txt Tue Apr 30 20:30:51 2019
@@ -73,6 +73,7 @@ check_cxx_section_exists(".init_array" C
 
 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




More information about the llvm-commits mailing list