Updated Makefile with LTO options
This commit is contained in:
parent
d464b72894
commit
1087e32d75
1 changed files with 7 additions and 2 deletions
9
Makefile
9
Makefile
|
@ -240,9 +240,14 @@ else
|
|||
CFLAGS += -g -rdynamic -funwind-tables -DDEBUG -Wl,--export-dynamic
|
||||
endif
|
||||
|
||||
#LTO is supposed to reduced code size and increased execution speed. For Amiberry, it does not.
|
||||
#at least not yet. In fact, the binary is somewhat bigger and almost the same speed. And the link times goes up
|
||||
#a lot.
|
||||
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
|
||||
export CFLAGS+=-flto=$(shell nproc) -march=native -fuse-ld=gold -flto-partition=1to1
|
||||
export LDFLAGS+=$(CFLAGS)
|
||||
comma= ,
|
||||
export LDFLAGS:=$(filter-out -Wl$(comma)-O1,$(LDFLAGS))
|
||||
endif
|
||||
|
||||
ifdef GCC_PROFILE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue