diff --git a/compiler-rt/lib/crt/CMakeLists.txt b/compiler-rt/lib/crt/CMakeLists.txt --- a/compiler-rt/lib/crt/CMakeLists.txt +++ b/compiler-rt/lib/crt/CMakeLists.txt @@ -70,7 +70,9 @@ endfunction() check_cxx_section_exists(".init_array" COMPILER_RT_HAS_INITFINI_ARRAY - SOURCE "__attribute__((constructor)) void f() {}\nint main() { return 0; }\n") + SOURCE "__attribute__((constructor)) void f() {}\nint main() { return 0; }\n" + FLAGS "-O0" +) 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)