[ARM RT] Fix broken clear_cache debug build on ARM
authorRenato Golin <renato.golin@linaro.org>
Wed, 26 Oct 2016 15:20:33 +0000 (15:20 +0000)
committerRenato Golin <renato.golin@linaro.org>
Wed, 26 Oct 2016 15:20:33 +0000 (15:20 +0000)
clear_cache is using R7 for the SVC call and that's the frame pointer in
GCC, which is only disabled on -O2/3, so Release builds finish, Debug don't.

Fixes PR30797.

llvm-svn: 285204

compiler-rt/lib/builtins/CMakeLists.txt

index 9ea0ba0..25b7730 100644 (file)
@@ -452,6 +452,12 @@ else ()
         endif ()
       endforeach ()
 
+      # Needed for clear_cache on debug mode, due to r7's usage in inline asm.
+      # Release mode already sets it via -O2/3, Debug mode doesn't.
+      if (${arch} STREQUAL "armhf")
+        list(APPEND BUILTIN_CFLAGS -fomit-frame-pointer)
+      endif()
+
       add_compiler_rt_runtime(clang_rt.builtins
                               STATIC
                               ARCHS ${arch}