mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Enable LTO for clang
Enable link-time optimization in the Makefile when compiling with clang. Also update travis.yml to use clang++-5.0 and llvm-5.0-dev. No functional change.
This commit is contained in:
parent
414a3e6ee3
commit
ef61886332
2 changed files with 13 additions and 18 deletions
|
@ -18,11 +18,12 @@ matrix:
|
||||||
compiler: clang
|
compiler: clang
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0']
|
||||||
packages: ['clang', 'g++-multilib', 'valgrind', 'expect']
|
packages: ['clang-5.0', 'llvm-5.0-dev', 'g++-multilib', 'valgrind', 'expect']
|
||||||
env:
|
env:
|
||||||
- COMPILER=clang++
|
- COMPILER=clang++-5.0
|
||||||
- COMP=clang
|
- COMP=clang
|
||||||
|
- LDFLAGS=-fuse-ld=gold
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
|
|
24
src/Makefile
24
src/Makefile
|
@ -302,8 +302,6 @@ ifeq ($(optimize),yes)
|
||||||
|
|
||||||
ifeq ($(comp),clang)
|
ifeq ($(comp),clang)
|
||||||
ifeq ($(KERNEL),Darwin)
|
ifeq ($(KERNEL),Darwin)
|
||||||
CXXFLAGS += -flto
|
|
||||||
LDFLAGS += $(CXXFLAGS)
|
|
||||||
ifeq ($(arch),i386)
|
ifeq ($(arch),i386)
|
||||||
CXXFLAGS += -mdynamic-no-pic
|
CXXFLAGS += -mdynamic-no-pic
|
||||||
endif
|
endif
|
||||||
|
@ -349,24 +347,20 @@ endif
|
||||||
### 3.8 Link Time Optimization, it works since gcc 4.5 but not on mingw under Windows.
|
### 3.8 Link Time Optimization, it works since gcc 4.5 but not on mingw under Windows.
|
||||||
### This is a mix of compile and link time options because the lto link phase
|
### This is a mix of compile and link time options because the lto link phase
|
||||||
### needs access to the optimization flags.
|
### needs access to the optimization flags.
|
||||||
ifeq ($(comp),gcc)
|
ifeq ($(optimize),yes)
|
||||||
ifeq ($(optimize),yes)
|
ifeq ($(debug), no)
|
||||||
ifeq ($(debug),no)
|
ifeq ($(comp),$(filter $(comp),gcc clang))
|
||||||
|
CXXFLAGS += -flto
|
||||||
|
LDFLAGS += $(CXXFLAGS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(comp),mingw)
|
||||||
|
ifeq ($(KERNEL),Linux)
|
||||||
CXXFLAGS += -flto
|
CXXFLAGS += -flto
|
||||||
LDFLAGS += $(CXXFLAGS)
|
LDFLAGS += $(CXXFLAGS)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(comp),mingw)
|
|
||||||
ifeq ($(KERNEL),Linux)
|
|
||||||
ifeq ($(optimize),yes)
|
|
||||||
ifeq ($(debug),no)
|
|
||||||
CXXFLAGS += -flto
|
|
||||||
LDFLAGS += $(CXXFLAGS)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
### 3.9 Android 5 can only run position independent executables. Note that this
|
### 3.9 Android 5 can only run position independent executables. Note that this
|
||||||
|
|
Loading…
Add table
Reference in a new issue