[coreboot-gerrit] Patch set updated for coreboot: 145ff3b Makefile: use response files to avoid long build commands lines Windows has a 32KB length limitation on the command line passed to an application such as gcc, ld or ar. In some cases a Windows hosted coreboot build fails due to this length limit. Use response files to keep command length less than 32KB so that Windows hosted abuild can pass.

Scott Duplichan (scott@notabs.org) gerrit at coreboot.org
Mon Dec 22 05:41:26 CET 2014


Scott Duplichan (scott at notabs.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7792

-gerrit

commit 145ff3b684ad3071030c7b525da478b3bbcd6464
Author: Scott Duplichan <scott at notabs.org>
Date:   Sun Dec 21 22:33:26 2014 -0600

    Makefile: use response files to avoid long build commands lines
    Windows has a 32KB length limitation on the command line passed to an
    application such as gcc, ld or ar. In some cases a Windows hosted coreboot
    build fails due to this length limit. Use response files to keep command
    length less than 32KB so that Windows hosted abuild can pass.
    
    Change-Id: I69bf9bcf8d22a8856cc49269ceb972ad7d64aae0
    Signed-off-by: Scott Duplichan <scott at notabs.org>
---
 src/arch/x86/Makefile.inc                   | 10 ++++++++--
 src/vendorcode/amd/agesa/f10/Makefile.inc   |  5 ++++-
 src/vendorcode/amd/agesa/f14/Makefile.inc   |  5 ++++-
 src/vendorcode/amd/agesa/f15/Makefile.inc   |  5 ++++-
 src/vendorcode/amd/agesa/f15tn/Makefile.inc |  5 ++++-
 5 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index a92c55c..c7140eb 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -205,7 +205,10 @@ romstage-libs ?=
 
 $(objcbfs)/romstage_null.debug: $$(romstage-objs) $(objgenerated)/romstage_null.ld $$(romstage-libs)
 	@printf "    LINK       $(subst $(obj)/,,$(@))\n"
-	$(LD_romstage) -nostdlib -nostartfiles -static -o $@ -L$(obj) $(COMPILER_RT_FLAGS_romstage) --start-group $(romstage-objs) $(romstage-libs) $(COMPILER_RT_romstage) --end-group -T $(objgenerated)/romstage_null.ld
+	$(eval response-file1 := $(shell mktemp))
+	echo -nostdlib -nostartfiles -static -o $@ -L$(obj) $(COMPILER_RT_FLAGS_romstage) --start-group $(romstage-objs) $(romstage-libs) $(COMPILER_RT_romstage) --end-group -T $(objgenerated)/romstage_null.ld > $(response-file1)
+	$(LD_romstage) @$(response-file1)
+	rm $(response-file1)
 	$(OBJCOPY_romstage) --only-section .illegal_globals $(@) $(objcbfs)/romstage_null.offenders && \
 	$(NM_romstage) $(objcbfs)/romstage_null.offenders | grep -q ""; if [ $$? -eq 0 ]; then \
 		echo "Forbidden global variables in romstage:"; \
@@ -214,7 +217,10 @@ $(objcbfs)/romstage_null.debug: $$(romstage-objs) $(objgenerated)/romstage_null.
 
 $(objcbfs)/romstage.debug: $$(romstage-objs) $(objgenerated)/romstage.ld $$(romstage-libs)
 	@printf "    LINK       $(subst $(obj)/,,$(@))\n"
-	$(LD_romstage) -nostdlib -nostartfiles -static -o $@ -L$(obj) $(COMPILER_RT_FLAGS_romstage) --start-group $(romstage-objs) $(romstage-libs) $(COMPILER_RT_romstage) --end-group -T $(objgenerated)/romstage.ld
+	$(eval response-file2 := $(shell mktemp))
+	echo -nostdlib -nostartfiles -static -o $@ -L$(obj) $(COMPILER_RT_FLAGS_romstage) --start-group $(romstage-objs) $(romstage-libs) $(COMPILER_RT_romstage) --end-group -T $(objgenerated)/romstage.ld > $(response-file2)
+	$(LD_romstage) @$(response-file2)
+	rm $(response-file2)
 
 $(objgenerated)/romstage_null.ld: $$(ldscripts) $(obj)/ldoptions
 	@printf "    GEN        $(subst $(obj)/,,$(@))\n"
diff --git a/src/vendorcode/amd/agesa/f10/Makefile.inc b/src/vendorcode/amd/agesa/f10/Makefile.inc
index b6b2c77..cc9730a 100644
--- a/src/vendorcode/amd/agesa/f10/Makefile.inc
+++ b/src/vendorcode/amd/agesa/f10/Makefile.inc
@@ -327,7 +327,10 @@ libagesa-y += Proc/CPU/Family/0x10/F10PmNbPstateInit.c
 
 $(obj)/libagesa.fam10.a: $$(libagesa-objs)
 	@printf "    AGESA        $(subst $(obj)/,,$(@))\n"
-	ar rcs $@ $+
+	$(eval response-file := $(shell mktemp))
+	echo rcs $@ $(libagesa-objs) > $(response-file)
+	ar @$(response-file)
+	rm $(response-file)
 
 romstage-libs  += $(obj)/libagesa.fam10.a
 ramstage-libs  += $(obj)/libagesa.fam10.a
diff --git a/src/vendorcode/amd/agesa/f14/Makefile.inc b/src/vendorcode/amd/agesa/f14/Makefile.inc
index d1c8911..7f3972e 100644
--- a/src/vendorcode/amd/agesa/f14/Makefile.inc
+++ b/src/vendorcode/amd/agesa/f14/Makefile.inc
@@ -326,7 +326,10 @@ libagesa-y += Proc/Mem/Main/mu.c
 
 $(obj)/libagesa.fam14.a: $$(libagesa-objs)
 	@printf " AGESA $(subst $(obj)/,,$(@))\n"
-	ar rcs $@ $+
+	$(eval response-file := $(shell mktemp))
+	echo rcs $@ $(libagesa-objs) > $(response-file)
+	ar @$(response-file)
+	rm $(response-file)
 
 romstage-libs += $(obj)/libagesa.fam14.a
 ramstage-libs += $(obj)/libagesa.fam14.a
diff --git a/src/vendorcode/amd/agesa/f15/Makefile.inc b/src/vendorcode/amd/agesa/f15/Makefile.inc
index d709199..cf18f73 100644
--- a/src/vendorcode/amd/agesa/f15/Makefile.inc
+++ b/src/vendorcode/amd/agesa/f15/Makefile.inc
@@ -524,7 +524,10 @@ endif
 
 $(obj)/libagesa.fam15.a: $$(libagesa-objs)
 	@printf "    AGESA        $(subst $(obj)/,,$(@))\n"
-	ar rcs $@ $+
+	$(eval response-file := $(shell mktemp))
+	echo rcs $@ $(libagesa-objs) > $(response-file)
+	ar @$(response-file)
+	rm $(response-file)
 
 romstage-libs  += $(obj)/libagesa.fam15.a
 ramstage-libs  += $(obj)/libagesa.fam15.a
diff --git a/src/vendorcode/amd/agesa/f15tn/Makefile.inc b/src/vendorcode/amd/agesa/f15tn/Makefile.inc
index 0de46b0..4f9548b 100644
--- a/src/vendorcode/amd/agesa/f15tn/Makefile.inc
+++ b/src/vendorcode/amd/agesa/f15tn/Makefile.inc
@@ -517,7 +517,10 @@ libagesa-y += Proc/Fch/Usb/XhciReset.c
 
 $(obj)/libagesa.fam15tn.a: $$(libagesa-objs)
 	@printf "    AGESA        $(subst $(obj)/,,$(@))\n"
-	ar rcs $@ $+
+	$(eval response-file := $(shell mktemp))
+	echo rcs $@ $(libagesa-objs) > $(response-file)
+	ar @$(response-file)
+	rm $(response-file)
 
 romstage-libs  += $(obj)/libagesa.fam15tn.a
 ramstage-libs  += $(obj)/libagesa.fam15tn.a



More information about the coreboot-gerrit mailing list