mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 10:07:38 -04:00
build: Allow LTO to work globally, not just codecs/plugins
IMPORTANT: There is no guarantee this will compile cleanly much less _work_ on any given target. This is purely to enable future hackery. Change-Id: Ib58f21b717719fd4325622b446a60779406ae035
This commit is contained in:
parent
200529532b
commit
bdf1690cb2
4 changed files with 10 additions and 5 deletions
|
@ -154,8 +154,8 @@ endif
|
|||
PLUGINLDFLAGS += $(GLOBAL_LDOPTS)
|
||||
|
||||
ifdef USE_LTO
|
||||
PLUGINFLAGS += -flto -fno-builtin -ffreestanding
|
||||
PLUGINLDFLAGS += -flto -fno-builtin -ffreestanding
|
||||
PLUGINFLAGS += -fno-builtin -ffreestanding
|
||||
PLUGINLDFLAGS += -fno-builtin -ffreestanding
|
||||
PLUGINLDFLAGS += -e plugin_start
|
||||
endif
|
||||
|
||||
|
|
|
@ -47,6 +47,11 @@ $(BUILDDIR)/sysfont.o: $(SYSFONTX) $(BUILDDIR)/sysfont.h
|
|||
$(call PRINTS,CONVBDF $(subst $(ROOTDIR)/,,$<))$(TOOLSDIR)/convbdf -l $(MAXCHAR) -c -o $(BUILDDIR)/sysfont.c $<
|
||||
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$(BUILDDIR)/sysfont.c))$(CC) $(CFLAGS) -c $(BUILDDIR)/sysfont.c -o $@
|
||||
|
||||
ifdef USE_LTO
|
||||
$(BUILDDIR)/firmware/asm/%.o: CFLAGS += -fno-lto
|
||||
$(BUILDDIR)/firmware/kernel/%.o: CFLAGS += -fno-lto
|
||||
endif
|
||||
|
||||
# GNU make (at least) has a bug/feature that exported variable are not available
|
||||
# in the shell function (but are in recipe). Thus we need to explicitely pass
|
||||
# the VERSION environement variable
|
||||
|
|
|
@ -34,8 +34,8 @@ endif
|
|||
CODECLDFLAGS += $(GLOBAL_LDOPTS)
|
||||
|
||||
ifdef USE_LTO
|
||||
CODECLDFLAGS += -flto -fno-builtin -ffreestanding
|
||||
CODECFLAGS += -flto -fno-builtin -ffreestanding
|
||||
CODECLDFLAGS += -fno-builtin -ffreestanding
|
||||
CODECFLAGS += -fno-builtin -ffreestanding
|
||||
CODECLDFLAGS += -e __header
|
||||
endif
|
||||
|
||||
|
|
2
tools/configure
vendored
2
tools/configure
vendored
|
@ -1079,7 +1079,7 @@ S(m)all C lib, Logf to Ser(i)al port, LTO Build(X), (E)rror on warnings"
|
|||
[Xx])
|
||||
echo "LTO build enabled"
|
||||
LTO_ARG="export USE_LTO=y"
|
||||
# GCCOPTS="$GCCOPTS -flto"
|
||||
GCCOPTS="$GCCOPTS -flto"
|
||||
;;
|
||||
[Ee])
|
||||
echo "Treating all warnings as errors"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue