1
0
Fork 0
forked from len0rd/rockbox

build: Experimental LTO support, phase one

* Only codecs and plugins are enabled
 * Only native builds (so far)
 * Only tested on xDuoo X3 (MIPS, monochrome)
 * opus & speex generate some warnings
 * Significant compile time impact

Change-Id: I519b0d179631a54b2103cd67225bd5ec6ad3bd2f
This commit is contained in:
Solomon Peachy 2023-07-02 20:43:01 -04:00
parent 7b12cc3927
commit 73f40d8a23
4 changed files with 31 additions and 1 deletions

View file

@ -33,6 +33,13 @@ else
endif
CODECLDFLAGS += $(GLOBAL_LDOPTS)
ifdef USE_LTO
CODECLDFLAGS += -flto -fno-builtin -ffreestanding
CODECFLAGS += -flto -fno-builtin -ffreestanding
CODECLDFLAGS += -e __header
endif
# the codec libraries
include $(RBCODECLIB_DIR)/codecs/demac/libdemac.make
include $(RBCODECLIB_DIR)/codecs/liba52/liba52.make

View file

@ -23,6 +23,11 @@ ifneq ($(findstring sdl-sim, $(APP_TYPE)), sdl-sim)
CODECLIBFLAGS += -ffunction-sections
endif
ifdef USE_LTO
# We do NOT want LTO on the GCC support file
$(CODECDIR)/lib/codeclib.o: CODECLIBFLAGS += -fno-lto
endif
$(CODECDIR)/lib/%.o: $(RBCODECLIB_DIR)/codecs/lib/%.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \