summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler-rt/lib/crt/CMakeLists.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler-rt/lib/crt/CMakeLists.txt b/compiler-rt/lib/crt/CMakeLists.txt
index 34c368f7ca4..90e94b93db4 100644
--- a/compiler-rt/lib/crt/CMakeLists.txt
+++ b/compiler-rt/lib/crt/CMakeLists.txt
@@ -70,7 +70,7 @@ function(check_cxx_section_exists section output)
endfunction()
check_cxx_section_exists(".init_array" COMPILER_RT_HAS_INITFINI_ARRAY
- SOURCE "__attribute__((constructor)) void f() {}\nint main() { return 0; }\n")
+ SOURCE "volatile int x;\n__attribute__((constructor)) void f() {x = 0;}\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)
OpenPOWER on IntegriCloud