summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2019-05-10 19:23:56 +0000
committerPetr Hosek <phosek@chromium.org>2019-05-10 19:23:56 +0000
commitfc86c7fca313655c834066bde6b7d2b0402f580f (patch)
tree0d67e0f8c8a656a7e601c4250c3a866836326ecf
parent7598b71488d8775f913873e95a95b7539601d71a (diff)
downloadbcm5719-llvm-fc86c7fca313655c834066bde6b7d2b0402f580f.tar.gz
bcm5719-llvm-fc86c7fca313655c834066bde6b7d2b0402f580f.zip
[crt] Use -std=c11 for crtbegin.o/crtend.o
The source uses C11 syntax such as comments and some compilers print warnings without specifying this flag. Differential Revision: https://reviews.llvm.org/D61797 llvm-svn: 360459
-rw-r--r--compiler-rt/cmake/config-ix.cmake1
-rw-r--r--compiler-rt/lib/crt/CMakeLists.txt1
2 files changed, 2 insertions, 0 deletions
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index ca979d95e13..f8e34ad6e6f 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -54,6 +54,7 @@ endif ()
# CodeGen options.
check_c_compiler_flag(-ffreestanding COMPILER_RT_HAS_FFREESTANDING_FLAG)
+check_c_compiler_flag(-std=c11 COMPILER_RT_HAS_STD_C11_FLAG)
check_cxx_compiler_flag(-fPIC COMPILER_RT_HAS_FPIC_FLAG)
check_cxx_compiler_flag(-fPIE COMPILER_RT_HAS_FPIE_FLAG)
check_cxx_compiler_flag(-fno-builtin COMPILER_RT_HAS_FNO_BUILTIN_FLAG)
diff --git a/compiler-rt/lib/crt/CMakeLists.txt b/compiler-rt/lib/crt/CMakeLists.txt
index a82ae75c56a..790387bc71a 100644
--- a/compiler-rt/lib/crt/CMakeLists.txt
+++ b/compiler-rt/lib/crt/CMakeLists.txt
@@ -71,6 +71,7 @@ endfunction()
check_cxx_section_exists(".init_array" COMPILER_RT_HAS_INITFINI_ARRAY
SOURCE "__attribute__((constructor)) void f() {}\nint main() { return 0; }\n")
+append_list_if(COMPILER_RT_HAS_STD_C11_FLAG -std=c11 CRT_CFLAGS)
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_WNO_PEDANTIC -Wno-pedantic CRT_CFLAGS)
OpenPOWER on IntegriCloud