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

Commit 39f9dc0

Browse files
committed
Merge pull request #61 from binarycrusader/rust-llvm-2016-10-29
use -O0 when building release LLVM on sparc
2 parents e8f2eb9 + 1e176bd commit 39f9dc0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,12 @@ if( MINGW )
836836
llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
837837
endif()
838838

839+
if( "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND "${LLVM_NATIVE_ARCH}" MATCHES "Sparc" )
840+
# 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")
843+
endif()
844+
839845
# Put this before tblgen. Else we have a circular dependence.
840846
add_subdirectory(lib/Demangle)
841847
add_subdirectory(lib/Support)

0 commit comments

Comments
 (0)