[compiler-rt] r288099 - builtins: switch to c11 from c99

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 28 18:31:40 PST 2016


Author: compnerd
Date: Mon Nov 28 20:31:40 2016
New Revision: 288099

URL: http://llvm.org/viewvc/llvm-project?rev=288099&view=rev
Log:
builtins: switch to c11 from c99

This fixes an incorrect standard usage of GNU99 when the compiler check was for
the ISO standard C99.  Furthermore, bump the dependency up to C11.  The
motivation for this change is ARM EHABI compatibility with clang 3.8.  We rely
on a type definition redefinition which causes an error with -Werror builds.
This is problematic for FreeBSD builds.  Switching to C11 allows the
compatibility without the unnecessary pedantic warning.  The alternative would
be to clutter the support header with a `pragma clang diagnostic ignore`.  GCC
4.8+ and the supported clang revisions along with MSVC support enough of C11 to
allow building the builtins in C11 mode.  No functional change intended.

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

Modified: compiler-rt/trunk/cmake/builtin-config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/builtin-config-ix.cmake?rev=288099&r1=288098&r2=288099&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/builtin-config-ix.cmake (original)
+++ compiler-rt/trunk/cmake/builtin-config-ix.cmake Mon Nov 28 20:31:40 2016
@@ -8,7 +8,7 @@ set(TEST_COMPILE_ONLY On)
 builtin_check_c_compiler_flag(-fPIC                 COMPILER_RT_HAS_FPIC_FLAG)
 builtin_check_c_compiler_flag(-fPIE                 COMPILER_RT_HAS_FPIE_FLAG)
 builtin_check_c_compiler_flag(-fno-builtin          COMPILER_RT_HAS_FNO_BUILTIN_FLAG)
-builtin_check_c_compiler_flag(-std=c99              COMPILER_RT_HAS_STD_C99_FLAG)
+builtin_check_c_compiler_flag(-std=c11              COMPILER_RT_HAS_STD_C11_FLAG)
 builtin_check_c_compiler_flag(-fvisibility=hidden   COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG)
 builtin_check_c_compiler_flag(-fomit-frame-pointer  COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG)
 builtin_check_c_compiler_flag(-ffreestanding        COMPILER_RT_HAS_FREESTANDING_FLAG)

Modified: compiler-rt/trunk/lib/builtins/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/CMakeLists.txt?rev=288099&r1=288098&r2=288099&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/builtins/CMakeLists.txt Mon Nov 28 20:31:40 2016
@@ -451,7 +451,7 @@ if (APPLE)
 else ()
   set(BUILTIN_CFLAGS "")
 
-  append_list_if(COMPILER_RT_HAS_STD_C99_FLAG -std=gnu99 BUILTIN_CFLAGS)
+  append_list_if(COMPILER_RT_HAS_STD_C11_FLAG -std=c11 BUILTIN_CFLAGS)
 
   # These flags would normally be added to CMAKE_C_FLAGS by the llvm
   # cmake step. Add them manually if this is a standalone build.




More information about the llvm-commits mailing list