Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/84038?usp=email )
Change subject: lib/rmodules: Add support for LTO ......................................................................
lib/rmodules: Add support for LTO
Change-Id: I9cdda036f330486370e8c4120be5b6a0fd982e99 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/lib/Makefile.mk 1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/84038/1
diff --git a/src/lib/Makefile.mk b/src/lib/Makefile.mk index 89e5b65..3002b6c 100644 --- a/src/lib/Makefile.mk +++ b/src/lib/Makefile.mk @@ -314,7 +314,11 @@ # rmdoule is named $(1).rmod define rmodule_link $(strip $(1)): $(strip $(2)) $$(COMPILER_RT_rmodules_$(3)) $(call src-to-obj,rmodules_$(3),src/lib/rmodule.ld) | $$(RMODTOOL) +ifeq ($(CONFIG_LTO),y) + $$(CC_rmodules_$(3)) $$(CPPFLAGS_rmodules_$(3)) $$(CFLAGS_rmodules_$(3)) $$(LDFLAGS_rmodules_$(3):%-Wl,%) $$(COMPILER_RT_FLAGS_rmodules_$(3):%-Wl,%) $(RMODULE_LDFLAGS:%=-Wl,%) $($(1)-ldflags:%=-Wl,%) -T $(call src-to-obj,rmodules_$(3),src/lib/rmodule.ld) -o $$@ -Wl,--whole-archive -Wl,--start-group $(filter-out %.ld,$(2)) -Wl,--no-whole-archive $$(COMPILER_RT_rmodules_$(3)) -Wl,--end-group +else $$(LD_rmodules_$(3)) $$(LDFLAGS_rmodules_$(3)) $(RMODULE_LDFLAGS) $($(1)-ldflags) -T $(call src-to-obj,rmodules_$(3),src/lib/rmodule.ld) -o $$@ --whole-archive --start-group $(filter-out %.ld,$(2)) --no-whole-archive $$(COMPILER_RT_rmodules_$(3)) --end-group +endif $$(NM_rmodules_$(3)) -n $$@ > $$(basename $$@).map endef