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

Commit

Permalink
use -O3 with some optimizations disabled on sparc w/ gcc
Browse files Browse the repository at this point in the history
A previous commit changed it so that rust's private copy of llvm was
always built with -O0 on sparc, as initially that was the only option
that produced a working compiler.  After further investigation, it was
discovered that applying -fno-delayed-branch and -fno-omit-frame-pointer
was sufficient to avoid all of the code generation issues initially
encountered while retaining -O3.  Investigation with gcc upstream
continues.
  • Loading branch information
binarycrusader authored and arielb1 committed Jun 27, 2017
1 parent 43d93d5 commit 1a83de6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Expand Up @@ -812,8 +812,10 @@ endif()

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

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

0 comments on commit 1a83de6

Please sign in to comment.