Index: cmake/config-ix.cmake =================================================================== --- cmake/config-ix.cmake +++ cmake/config-ix.cmake @@ -29,6 +29,9 @@ check_cxx_compiler_flag(-fno-lto COMPILER_RT_HAS_FNO_LTO_FLAG) check_cxx_compiler_flag(-msse3 COMPILER_RT_HAS_MSSE3_FLAG) +# Language options +check_c_compiler_flag(-std=c99 COMPILER_RT_HAS_STD_C99_FLAG) + check_cxx_compiler_flag(/GR COMPILER_RT_HAS_GR_FLAG) check_cxx_compiler_flag(/GS COMPILER_RT_HAS_GS_FLAG) check_cxx_compiler_flag(/MT COMPILER_RT_HAS_MT_FLAG) Index: lib/builtins/CMakeLists.txt =================================================================== --- lib/builtins/CMakeLists.txt +++ lib/builtins/CMakeLists.txt @@ -361,11 +361,13 @@ endif () endforeach () + append_string_if(COMPILER_RT_HAS_STD_C99_FLAG -std=c99 maybe_stdc99) + add_compiler_rt_runtime(clang_rt.builtins STATIC ARCHS ${arch} SOURCES ${${arch}_SOURCES} - CFLAGS "-std=c99" + CFLAGS ${maybe_stdc99} PARENT_TARGET builtins) endif () endforeach ()