forked from OSchip/llvm-project
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. llvm-svn: 288099
This commit is contained in:
parent
bfcf9800b8
commit
f9d34dfbe4
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue