Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit f8cb006

Browse files
TimNNalexcrichton
authored andcommitted
Merge pull request #62 from binarycrusader/llvm-sparc
use -O3 with some optimizations disabled on sparc w/ gcc
2 parents dc62563 + 1ad32e3 commit f8cb006

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,8 +838,10 @@ endif()
838838

839839
if( "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND "${LLVM_NATIVE_ARCH}" MATCHES "Sparc" )
840840
# gcc 4.x, 5.x (at least) generate bad code on sparc above -O0 when compiling
841-
# llvm; notably llvm-tblgen consistently core dumps.
842-
llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O0")
841+
# llvm. Notably llvm-tblgen consistently core dumps, *unless*
842+
# -fno-delayed-branch is specified. Finally, -fno-omit-frame-pointer is
843+
# included to avoid additional code generation and debugging issues.
844+
llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O3 -fno-delayed-branch -fno-omit-frame-pointer")
843845
endif()
844846

845847
# Put this before tblgen. Else we have a circular dependence.

0 commit comments

Comments
 (0)