Made LTO optional in the Makefile, disabled by default
This commit is contained in:
parent
d0ec432870
commit
6e95d62ae9
1 changed files with 7 additions and 1 deletions
8
Makefile
8
Makefile
|
@ -33,6 +33,7 @@ CPPFLAGS=-MD -MT $@ -MF $(@:%.o=%.d)
|
|||
#GCC_PROFILE=1
|
||||
#GEN_PROFILE=1
|
||||
#USE_PROFILE=1
|
||||
#USE_LTO=1
|
||||
#SANITIZE=1
|
||||
|
||||
#
|
||||
|
@ -231,7 +232,7 @@ endif
|
|||
DEFS = $(XML_CFLAGS) -DAMIBERRY
|
||||
CPPFLAGS += -Isrc -Isrc/osdep -Isrc/threaddep -Isrc/include -Isrc/archivers $(DEFS)
|
||||
XML_CFLAGS := $(shell xml2-config --cflags )
|
||||
LDFLAGS += -flto -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed
|
||||
LDFLAGS += -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed
|
||||
|
||||
ifndef DEBUG
|
||||
CFLAGS += -Ofast -frename-registers
|
||||
|
@ -239,6 +240,11 @@ else
|
|||
CFLAGS += -g -rdynamic -funwind-tables -DDEBUG -Wl,--export-dynamic
|
||||
endif
|
||||
|
||||
ifdef USE_LTO
|
||||
export CFLAGS=-flto=4 -march=native -floop=strip-mine -floop-block
|
||||
export LDFLAGS=-flto=4 -fuse-linker-plugin -fuse-ld=gold -march=native
|
||||
endif
|
||||
|
||||
ifdef GCC_PROFILE
|
||||
CFLAGS += -pg
|
||||
LDFLAGS += -pg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue