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

Commit b67bc62

Browse files
binarycrusaderarielb1
authored andcommitted
use -O0 when building release LLVM on sparc
The bits produced by gcc above -O0 when building rust's private copy of llvm on sparc result in either versions of llvm-tblgen that consistently segfault or produce otherwise unuseable code. This does not affect cross-compiles for some reason. Investigation with gcc upstream is in progress.
1 parent b5fb3b2 commit b67bc62

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
@@ -810,6 +810,12 @@ if( MINGW )
810810
llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
811811
endif()
812812

813+
if( "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND "${LLVM_NATIVE_ARCH}" MATCHES "Sparc" )
814+
# gcc 4.x, 5.x (at least) generate bad code on sparc above -O0 when compiling
815+
# llvm; notably llvm-tblgen consistently core dumps.
816+
llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O0")
817+
endif()
818+
813819
# Put this before tblgen. Else we have a circular dependence.
814820
add_subdirectory(lib/Demangle)
815821
add_subdirectory(lib/Support)

0 commit comments

Comments
 (0)