diff options
Diffstat (limited to 'apps/plugins/plugins.make')
-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, $^) \ |