summaryrefslogtreecommitdiff
path: root/apps/plugins/plugins.make
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/plugins.make')
-rw-r--r--apps/plugins/plugins.make12
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)
37PLUGINLIB_OBJ := $(PLUGINLIB_OBJ:.S=.o) 37PLUGINLIB_OBJ := $(PLUGINLIB_OBJ:.S=.o)
38PLUGINLIB_OBJ := $(call full_path_subst,$(ROOTDIR)/%,$(BUILDDIR)/%,$(PLUGINLIB_OBJ)) 38PLUGINLIB_OBJ := $(call full_path_subst,$(ROOTDIR)/%,$(BUILDDIR)/%,$(PLUGINLIB_OBJ))
39 39
40ifdef 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
44endif
45
40### build data / rules 46### build data / rules
41ifndef APP_TYPE 47ifndef APP_TYPE
42CONFIGFILE := $(FIRMDIR)/export/config/$(MODELNAME).h 48CONFIGFILE := $(FIRMDIR)/export/config/$(MODELNAME).h
@@ -147,6 +153,12 @@ else
147endif 153endif
148PLUGINLDFLAGS += $(GLOBAL_LDOPTS) 154PLUGINLDFLAGS += $(GLOBAL_LDOPTS)
149 155
156ifdef USE_LTO
157 PLUGINFLAGS += -flto -fno-builtin -ffreestanding
158 PLUGINLDFLAGS += -flto -fno-builtin -ffreestanding
159 PLUGINLDFLAGS += -e plugin_start
160endif
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, $^) \