Change in coreboot[master]: arch,cpu,lib: Use thin archives instead of partial linking
Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/40812 ) Change subject: arch,cpu,lib: Use thin archives instead of partial linking ...................................................................... arch,cpu,lib: Use thin archives instead of partial linking x86 ramstage and smm compilation currently use partial linking, which is not supported by link-time optimization. Collect the object files into thin archives instead, and link them all at once at the very end. Change-Id: I122a4542d1e98d89545897d5177c93ee463d0cdb Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> --- M src/arch/x86/Makefile.inc M src/cpu/x86/smm/Makefile.inc M src/lib/Makefile.inc 3 files changed, 17 insertions(+), 15 deletions(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/12/40812/1 diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc index af52f70..1615e75 100644 --- a/src/arch/x86/Makefile.inc +++ b/src/arch/x86/Makefile.inc @@ -307,18 +307,20 @@ endif -$(objcbfs)/ramstage.debug: $(objgenerated)/ramstage.o $(call src-to-obj,ramstage,src/arch/x86/memlayout.ld) - @printf " CC $(subst $(obj)/,,$(@))\n" - $(LD_ramstage) $(CPPFLAGS) $(LDFLAGS_ramstage) -o $@ -L$(obj) $< -T $(call src-to-obj,ramstage,src/arch/x86/memlayout.ld) - -$(objgenerated)/ramstage.o: $$(ramstage-objs) $(COMPILER_RT_ramstage) $$(ramstage-libs) - @printf " CC $(subst $(obj)/,,$(@))\n" ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y) - $(LD_ramstage) -Wl,-m,elf_i386 -r -o $@ $(COMPILER_RT_FLAGS_ramstage) -Wl,--whole-archive,--start-group $(filter-out %.ld,$(ramstage-objs)) $(ramstage-libs) -Wl,--no-whole-archive $(COMPILER_RT_ramstage) -Wl,--end-group +LDFLAGS_ramstage += -Wl,-m,elf_i386 else - $(LD_ramstage) -Wl,-m,elf_x86_64 -r -o $@ $(COMPILER_RT_FLAGS_ramstage) -Wl,--whole-archive,--start-group $(filter-out %.ld,$(ramstage-objs)) $(ramstage-libs) -Wl,--no-whole-archive $(COMPILER_RT_ramstage) -Wl,--end-group +LDFLAGS_ramstage += -Wl,-m,elf_x86_64 endif +$(objcbfs)/ramstage.debug: $(objgenerated)/ramstage.a $(call src-to-obj,ramstage,src/arch/x86/memlayout.ld) + @printf " CC $(subst $(obj)/,,$(@))\n" + $(LD_ramstage) $(CPPFLAGS) $(LDFLAGS_ramstage) $(COMPILER_RT_FLAGS_ramstage) -o $@ -L$(obj) -Wl,--whole-archive,--start-group $< -Wl,--no-whole-archive $(COMPILER_RT_ramstage) -Wl,--end-group -T $(call src-to-obj,ramstage,src/arch/x86/memlayout.ld) + +$(objgenerated)/ramstage.a: $$(ramstage-objs) $$(ramstage-libs) + @printf " AR $(subst $(obj)/,,$(@))\n" + $(AR_ramstage) rcT $@ $(filter-out %.ld,$(ramstage-objs)) $(ramstage-libs) + endif # CONFIG_ARCH_RAMSTAGE_X86_32 / CONFIG_ARCH_RAMSTAGE_X86_64 smm-$(CONFIG_IDT_IN_EVERY_STAGE) += exception.c diff --git a/src/cpu/x86/smm/Makefile.inc b/src/cpu/x86/smm/Makefile.inc index 2e63fb3..4899370 100644 --- a/src/cpu/x86/smm/Makefile.inc +++ b/src/cpu/x86/smm/Makefile.inc @@ -25,8 +25,8 @@ smm-generic-ccopts += -D__SMM__ smm-c-deps:=$$(OPTION_TABLE_H) -$(obj)/smm/smm.o: $$(smm-objs) $(COMPILER_RT_smm) - $(LD_smm) -nostdlib -r -o $@ $(COMPILER_RT_FLAGS_smm) -Wl,--whole-archive,--start-group $(smm-objs) -Wl,--no-whole-archive $(COMPILER_RT_smm) -Wl,--end-group +$(obj)/smm/smm.a: $$(smm-objs) + $(AR_smm) rcT $@ $^ # change to the target path because objcopy will use the path name in its # ELF symbol names. @@ -72,9 +72,9 @@ # C-based SMM handler. ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y) -$(eval $(call rmodule_link,$(obj)/smm/smm.elf, $(obj)/smm/smm.o, $(CONFIG_SMM_MODULE_HEAP_SIZE),x86_32)) +$(eval $(call rmodule_link,$(obj)/smm/smm.elf, $(obj)/smm/smm.a, $(CONFIG_SMM_MODULE_HEAP_SIZE),x86_32)) else -$(eval $(call rmodule_link,$(obj)/smm/smm.elf, $(obj)/smm/smm.o, $(CONFIG_SMM_MODULE_HEAP_SIZE),x86_64)) +$(eval $(call rmodule_link,$(obj)/smm/smm.elf, $(obj)/smm/smm.a, $(CONFIG_SMM_MODULE_HEAP_SIZE),x86_64)) endif $(obj)/smm/smm: $(obj)/smm/smm.elf.rmod @@ -82,8 +82,8 @@ else # CONFIG_SMM_TSEG -$(obj)/smm/smm: $(obj)/smm/smm.o $(src)/cpu/x86/smm/smm.ld - $(LD_smm) $(LDFLAGS_smm) -o $(obj)/smm/smm.elf -T $(src)/cpu/x86/smm/smm.ld $(obj)/smm/smm.o +$(obj)/smm/smm: $(obj)/smm/smm.a $(src)/cpu/x86/smm/smm.ld + $(LD_smm) $(LDFLAGS_smm) $(COMPILER_RT_FLAGS_smm) -o $(obj)/smm/smm.elf -T $(src)/cpu/x86/smm/smm.ld -Wl,--whole-archive,--start-group $(obj)/smm/smm.a -Wl,--no-whole-archive $(COMPILER_RT_smm) -Wl,--end-group $(NM_smm) -n $(obj)/smm/smm.elf | sort > $(obj)/smm/smm.map $(OBJCOPY_smm) -O binary $(obj)/smm/smm.elf $@ diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index adcd16a..768331b 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -290,7 +290,7 @@ # rmdoule is named $(1).rmod define rmodule_link $(strip $(1)): $(strip $(2)) $$(COMPILER_RT_rmodules_$(4)) $(call src-to-obj,rmodules_$(4),src/lib/rmodule.ld) | $$(RMODTOOL) - $$(LD_rmodules_$(4)) $$(LDFLAGS_rmodules_$(4)) $(RMODULE_LDFLAGS) -T $(call src-to-obj,rmodules_$(4),src/lib/rmodule.ld) -Wl,--defsym=__heap_size=$(strip $(3)) -o $$@ -Wl,--whole-archive,--start-group $(filter-out %.ld,$(2)) -Wl,--end-group + $$(LD_rmodules_$(4)) $$(LDFLAGS_rmodules_$(4)) $$(COMPILER_RT_FLAGS_rmodules_$(4)) $(RMODULE_LDFLAGS) -T $(call src-to-obj,rmodules_$(4),src/lib/rmodule.ld) -Wl,--defsym=__heap_size=$(strip $(3)) -o $$@ -Wl,--whole-archive,--start-group $(filter-out %.ld,$(2)) -Wl,--no-whole-archive $$(COMPILER_RT_rmodules_$(4)) -Wl,--end-group $$(NM_rmodules_$(4)) -n $$@ > $$(basename $$@).map endef -- To view, visit https://review.coreboot.org/c/coreboot/+/40812 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I122a4542d1e98d89545897d5177c93ee463d0cdb Gerrit-Change-Number: 40812 Gerrit-PatchSet: 1 Gerrit-Owner: Jacob Garber <jgarber1@ualberta.ca> Gerrit-Reviewer: Martin Roth <martinroth@google.com> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> Gerrit-MessageType: newchange
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, I'd like you to reexamine a change. Please visit https://review.coreboot.org/c/coreboot/+/40812 to look at the new patch set (#2). Change subject: arch,cpu,lib: Use thin archives instead of partial linking ...................................................................... arch,cpu,lib: Use thin archives instead of partial linking x86 ramstage and smm compilation currently use partial linking, which is not supported by link time optimization. Collect the object files into thin archives instead, and link them all at once at the very end. Change-Id: I122a4542d1e98d89545897d5177c93ee463d0cdb Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> --- M src/arch/x86/Makefile.inc M src/cpu/x86/smm/Makefile.inc M src/lib/Makefile.inc 3 files changed, 17 insertions(+), 15 deletions(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/12/40812/2 -- To view, visit https://review.coreboot.org/c/coreboot/+/40812 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I122a4542d1e98d89545897d5177c93ee463d0cdb Gerrit-Change-Number: 40812 Gerrit-PatchSet: 2 Gerrit-Owner: Jacob Garber <jgarber1@ualberta.ca> Gerrit-Reviewer: Martin Roth <martinroth@google.com> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-MessageType: newpatchset
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, I'd like you to reexamine a change. Please visit https://review.coreboot.org/c/coreboot/+/40812 to look at the new patch set (#4). Change subject: arch,cpu,lib: Use thin archives instead of partial linking ...................................................................... arch,cpu,lib: Use thin archives instead of partial linking x86 ramstage and smm compilation currently use partial linking, which is not supported by link time optimization. Collect the object files into thin archives instead, and link them all at once at the very end. Change-Id: I122a4542d1e98d89545897d5177c93ee463d0cdb Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> --- M src/arch/x86/Makefile.inc M src/cpu/x86/smm/Makefile.inc M src/lib/Makefile.inc 3 files changed, 12 insertions(+), 12 deletions(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/12/40812/4 -- To view, visit https://review.coreboot.org/c/coreboot/+/40812 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I122a4542d1e98d89545897d5177c93ee463d0cdb Gerrit-Change-Number: 40812 Gerrit-PatchSet: 4 Gerrit-Owner: Jacob Garber <jgarber1@ualberta.ca> Gerrit-Reviewer: Martin Roth <martinroth@google.com> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net> Gerrit-MessageType: newpatchset
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40812 ) Change subject: arch,cpu,lib: Use thin archives instead of partial linking ...................................................................... Patch Set 5: Code-Review+1 tested successfully for system76/lemp9. builds fine, boots fine -- To view, visit https://review.coreboot.org/c/coreboot/+/40812 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I122a4542d1e98d89545897d5177c93ee463d0cdb Gerrit-Change-Number: 40812 Gerrit-PatchSet: 5 Gerrit-Owner: Jacob Garber <jgarber1@ualberta.ca> Gerrit-Reviewer: Martin Roth <martinroth@google.com> Gerrit-Reviewer: Michael Niewöhner <foss@mniewoehner.de> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net> Gerrit-Comment-Date: Tue, 15 Sep 2020 20:10:41 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Michael Niewöhner, I'd like you to reexamine a change. Please visit https://review.coreboot.org/c/coreboot/+/40812 to look at the new patch set (#7). Change subject: arch,cpu,lib: Use thin archives instead of partial linking ...................................................................... arch,cpu,lib: Use thin archives instead of partial linking x86 ramstage and smm compilation currently use partial linking, which is not supported by link time optimization. Collect the object files into thin archives instead, and link them all at once at the very end. Change-Id: I122a4542d1e98d89545897d5177c93ee463d0cdb Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> --- M src/arch/x86/Makefile.inc M src/cpu/x86/smm/Makefile.inc M src/lib/Makefile.inc 3 files changed, 10 insertions(+), 13 deletions(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/12/40812/7 -- To view, visit https://review.coreboot.org/c/coreboot/+/40812 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I122a4542d1e98d89545897d5177c93ee463d0cdb Gerrit-Change-Number: 40812 Gerrit-PatchSet: 7 Gerrit-Owner: Jacob Garber <jgarber1@ualberta.ca> Gerrit-Reviewer: Martin Roth <martinroth@google.com> Gerrit-Reviewer: Michael Niewöhner <foss@mniewoehner.de> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@mailbox.org> Gerrit-MessageType: newpatchset
Attention is currently required from: Jacob Garber. Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40812 ) Change subject: arch,cpu,lib: Use thin archives instead of partial linking ...................................................................... Patch Set 9: Code-Review+1 (1 comment) File src/cpu/x86/smm/Makefile.inc: https://review.coreboot.org/c/coreboot/+/40812/comment/21d5fc6c_46eb0af4 PS9, Line 50: $(CC_smmstub) -nostdlib -r -o $@ $(COMPILER_RT_FLAGS_smmstub) -Wl,--whole-archive,--start-group $(smmstub-objs) -Wl,--no-whole-archive $(COMPILER_RT_smmstub) -Wl,--end-group Should the stub also created as an archive and linked at the end for consistency? -- To view, visit https://review.coreboot.org/c/coreboot/+/40812 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I122a4542d1e98d89545897d5177c93ee463d0cdb Gerrit-Change-Number: 40812 Gerrit-PatchSet: 9 Gerrit-Owner: Jacob Garber <jgarber1@ualberta.ca> Gerrit-Reviewer: Arthur Heymans <arthur@aheymans.xyz> Gerrit-Reviewer: Martin L Roth <gaumless@tutanota.com> Gerrit-Reviewer: Michael Niewöhner <foss@mniewoehner.de> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@mailbox.org> Gerrit-Attention: Jacob Garber <jgarber1@ualberta.ca> Gerrit-Comment-Date: Mon, 09 May 2022 21:39:07 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Martin L Roth has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/40812?usp=email ) Change subject: arch,cpu,lib: Use thin archives instead of partial linking ...................................................................... Abandoned This patch has not been touched in over 12 months. Anyone who wants to take over work on this patch, please feel free to restore it and do any work needed to get it merged. If you create a new patch based on this work, please credit the original author. -- To view, visit https://review.coreboot.org/c/coreboot/+/40812?usp=email To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I122a4542d1e98d89545897d5177c93ee463d0cdb Gerrit-Change-Number: 40812 Gerrit-PatchSet: 9 Gerrit-Owner: Jacob Garber <jgarber1@ualberta.ca> Gerrit-Reviewer: Arthur Heymans <arthur@aheymans.xyz> Gerrit-Reviewer: Martin L Roth <gaumless@gmail.com> Gerrit-Reviewer: Michael Niewöhner <foss@mniewoehner.de> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@mailbox.org> Gerrit-MessageType: abandon
participants (4)
-
Arthur Heymans (Code Review) -
Jacob Garber (Code Review) -
Martin L Roth (Code Review) -
Michael Niewöhner (Code Review)