[compiler-rt] r360459 - [crt] Use -std=c11 for crtbegin.o/crtend.o

Shoaib Meenai via llvm-commits llvm-commits at lists.llvm.org
Fri May 10 19:32:47 PDT 2019


This broke local builds for me with "asm" not being recognized as a keyword, since we're in c11 (as opposed to gnu11) mode. I changed to __asm__ in r360503 to fix.

From: llvm-commits <llvm-commits-bounces at lists.llvm.org> on behalf of Petr Hosek via llvm-commits <llvm-commits at lists.llvm.org>
Reply-To: Petr Hosek <phosek at chromium.org>
Date: Friday, May 10, 2019 at 12:21 PM
To: "llvm-commits at lists.llvm.org" <llvm-commits at lists.llvm.org>
Subject: [compiler-rt] r360459 - [crt] Use -std=c11 for crtbegin.o/crtend.o

Author: phosek
Date: Fri May 10 12:23:56 2019
New Revision: 360459

URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D360459-26view-3Drev&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=1Yc1PNaFMA1PFNQyWytdu35F_ZjYml6vLMzZFEtcTZs&s=oWRSW1R2m7jtRxTePDpnhQmgp4c60bcIjAIKpYNsYoU&e=
Log:
[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://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D61797&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=1Yc1PNaFMA1PFNQyWytdu35F_ZjYml6vLMzZFEtcTZs&s=cTd6OqE2f1ToETurJJ052sMxLyAISFuRS14zJlHoUoY&e=

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

Modified: compiler-rt/trunk/cmake/config-ix.cmake
URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_compiler-2Drt_trunk_cmake_config-2Dix.cmake-3Frev-3D360459-26r1-3D360458-26r2-3D360459-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=1Yc1PNaFMA1PFNQyWytdu35F_ZjYml6vLMzZFEtcTZs&s=2BpCHCLR-c81OyANE8COZCLhWQGw8_HxPDiPbfUFMc4&e=
==============================================================================
--- compiler-rt/trunk/cmake/config-ix.cmake (original)
+++ compiler-rt/trunk/cmake/config-ix.cmake Fri May 10 12:23:56 2019
@@ -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)

Modified: compiler-rt/trunk/lib/crt/CMakeLists.txt
URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_compiler-2Drt_trunk_lib_crt_CMakeLists.txt-3Frev-3D360459-26r1-3D360458-26r2-3D360459-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=1Yc1PNaFMA1PFNQyWytdu35F_ZjYml6vLMzZFEtcTZs&s=6JMbFEWsOS4JTMRD6HQKO-D6VewsLknWMkA0APxSF9I&e=
==============================================================================
--- compiler-rt/trunk/lib/crt/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/crt/CMakeLists.txt Fri May 10 12:23:56 2019
@@ -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)


_______________________________________________
llvm-commits mailing list
llvm-commits at lists.llvm.org<mailto:llvm-commits at lists.llvm.org>
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=1Yc1PNaFMA1PFNQyWytdu35F_ZjYml6vLMzZFEtcTZs&s=vsfW8FnibWUhC1THc88xR38ol-iYmBGIUaSfbNjmPxY&e=

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190511/03db3ed4/attachment.html>


More information about the llvm-commits mailing list