diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2023-07-02 20:43:01 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-06-18 08:15:47 -0400 |
commit | 73f40d8a2385543464d79d4461ab68eb56783d26 (patch) | |
tree | 903d5b1eecc88ad8cf2acc6681eb8b91ddf8fafe /lib | |
parent | 7b12cc39270c41459ffe98659d9899d02d8bf56b (diff) | |
download | rockbox-73f40d8a2385543464d79d4461ab68eb56783d26.tar.gz rockbox-73f40d8a2385543464d79d4461ab68eb56783d26.zip |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rbcodec/codecs/codecs.make | 7 | ||||
-rw-r--r-- | lib/rbcodec/codecs/lib/libcodec.make | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/codecs.make b/lib/rbcodec/codecs/codecs.make index 27ba73ab3c..83dc784ee3 100644 --- a/lib/rbcodec/codecs/codecs.make +++ b/lib/rbcodec/codecs/codecs.make | |||
@@ -33,6 +33,13 @@ else | |||
33 | endif | 33 | endif |
34 | CODECLDFLAGS += $(GLOBAL_LDOPTS) | 34 | CODECLDFLAGS += $(GLOBAL_LDOPTS) |
35 | 35 | ||
36 | ifdef USE_LTO | ||
37 | CODECLDFLAGS += -flto -fno-builtin -ffreestanding | ||
38 | CODECFLAGS += -flto -fno-builtin -ffreestanding | ||
39 | CODECLDFLAGS += -e __header | ||
40 | endif | ||
41 | |||
42 | |||
36 | # the codec libraries | 43 | # the codec libraries |
37 | include $(RBCODECLIB_DIR)/codecs/demac/libdemac.make | 44 | include $(RBCODECLIB_DIR)/codecs/demac/libdemac.make |
38 | include $(RBCODECLIB_DIR)/codecs/liba52/liba52.make | 45 | include $(RBCODECLIB_DIR)/codecs/liba52/liba52.make |
diff --git a/lib/rbcodec/codecs/lib/libcodec.make b/lib/rbcodec/codecs/lib/libcodec.make index 0788dd6705..b197464528 100644 --- a/lib/rbcodec/codecs/lib/libcodec.make +++ b/lib/rbcodec/codecs/lib/libcodec.make | |||
@@ -23,6 +23,11 @@ ifneq ($(findstring sdl-sim, $(APP_TYPE)), sdl-sim) | |||
23 | CODECLIBFLAGS += -ffunction-sections | 23 | CODECLIBFLAGS += -ffunction-sections |
24 | endif | 24 | endif |
25 | 25 | ||
26 | ifdef USE_LTO | ||
27 | # We do NOT want LTO on the GCC support file | ||
28 | $(CODECDIR)/lib/codeclib.o: CODECLIBFLAGS += -fno-lto | ||
29 | endif | ||
30 | |||
26 | $(CODECDIR)/lib/%.o: $(RBCODECLIB_DIR)/codecs/lib/%.c | 31 | $(CODECDIR)/lib/%.o: $(RBCODECLIB_DIR)/codecs/lib/%.c |
27 | $(SILENT)mkdir -p $(dir $@) | 32 | $(SILENT)mkdir -p $(dir $@) |
28 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ | 33 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ |