]> git.sesse.net Git - stockfish/commitdiff
Revert to -O3 with Clang
authorMarco Costalba <mcostalba@gmail.com>
Sat, 7 Jul 2012 18:00:05 +0000 (19:00 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 7 Jul 2012 18:05:38 +0000 (19:05 +0100)
Instead of -O4 option that does not work with both mingw and
Linux gcc (tested with Clang 3.1).

As reported by Reed Kotler:
Turns out that -O4 is not a valid option for clang unless you have
the proper gold linker and plugins built. That's because -O4 enables
LTO, which writes out bitcode files during the compile, and then loads
those and optimizes them during the link phase.

It requires a linker that supports LLVM's LTO. There is a plugin for
Gold available as part of LLVM.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/Makefile

index 2a03492fa863b6e2fdd5984026a873c8cd24c86e..dea8db04675e66d26b21e4c755f91df217ae85e3 100644 (file)
@@ -270,7 +270,8 @@ ifeq ($(optimize),yes)
        endif
 
        ifeq ($(comp),clang)
        endif
 
        ifeq ($(comp),clang)
-               CXXFLAGS += -O4
+               ### -O4 requires a linker that supports LLVM's LTO
+               CXXFLAGS += -O3
 
                ifeq ($(os),osx)
                        ifeq ($(arch),i386)
 
                ifeq ($(os),osx)
                        ifeq ($(arch),i386)