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 /apps | |
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 'apps')
-rw-r--r-- | apps/plugins/plugins.make | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/plugins/plugins.make b/apps/plugins/plugins.make index b430bd2792..4a126f812c 100644 --- a/apps/plugins/plugins.make +++ b/apps/plugins/plugins.make | |||
@@ -37,6 +37,12 @@ PLUGINLIB_OBJ := $(PLUGINLIB_SRC:.c=.o) | |||
37 | PLUGINLIB_OBJ := $(PLUGINLIB_OBJ:.S=.o) | 37 | PLUGINLIB_OBJ := $(PLUGINLIB_OBJ:.S=.o) |
38 | PLUGINLIB_OBJ := $(call full_path_subst,$(ROOTDIR)/%,$(BUILDDIR)/%,$(PLUGINLIB_OBJ)) | 38 | PLUGINLIB_OBJ := $(call full_path_subst,$(ROOTDIR)/%,$(BUILDDIR)/%,$(PLUGINLIB_OBJ)) |
39 | 39 | ||
40 | ifdef USE_LTO | ||
41 | # We do NOT want LTO on the GCC support file. | ||
42 | $(BUILDDIR)/apps/plugins/lib/gcc-support.o: PLUGINFLAGS += -fno-lto | ||
43 | $(BUILDDIR)/apps/plugins/plugin_crt0.o: PLUGINFLAGS += -fno-lto | ||
44 | endif | ||
45 | |||
40 | ### build data / rules | 46 | ### build data / rules |
41 | ifndef APP_TYPE | 47 | ifndef APP_TYPE |
42 | CONFIGFILE := $(FIRMDIR)/export/config/$(MODELNAME).h | 48 | CONFIGFILE := $(FIRMDIR)/export/config/$(MODELNAME).h |
@@ -147,6 +153,12 @@ else | |||
147 | endif | 153 | endif |
148 | PLUGINLDFLAGS += $(GLOBAL_LDOPTS) | 154 | PLUGINLDFLAGS += $(GLOBAL_LDOPTS) |
149 | 155 | ||
156 | ifdef USE_LTO | ||
157 | PLUGINFLAGS += -flto -fno-builtin -ffreestanding | ||
158 | PLUGINLDFLAGS += -flto -fno-builtin -ffreestanding | ||
159 | PLUGINLDFLAGS += -e plugin_start | ||
160 | endif | ||
161 | |||
150 | $(BUILDDIR)/%.rock: | 162 | $(BUILDDIR)/%.rock: |
151 | $(call PRINTS,LD $(@F))$(CC) $(PLUGINFLAGS) -o $(BUILDDIR)/$*.elf \ | 163 | $(call PRINTS,LD $(@F))$(CC) $(PLUGINFLAGS) -o $(BUILDDIR)/$*.elf \ |
152 | $(filter %.o, $^) \ | 164 | $(filter %.o, $^) \ |