<p>Nico Huber has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/20990">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">payloads/external/GRUB2: Sanitize Makefile<br><br>We were explicitly passing CC and TARGET_CC to configure but overwrote<br>that decision later by passing CC (with the value of TARGET_CC) directly<br>to a recursive make call. The latter overwrite was introduced because<br>`unexport` alone doesn't work on variables that were specified on a make<br>command line (they are added to MAKEOVERRIDES and passed to further re-<br>cursive make calls).<br><br>Instead of unexporting random variables, unexport those that were actu-<br>ally passed from payloads/external/Makefile.inc and clear MAKEOVERRIDES.<br>Do not pass OBJDUMP as that is nowhere to be found in the GRUB sources.<br>And, last but not least, add --disable-werror because building GRUB is<br>very susceptible to changes in the flex version.<br><br>Change-Id: Iaff2c72e89a5a540fe365eacb84811d5cff9d4d4<br>Signed-off-by: Nico Huber <nico.h@gmx.de><br>---<br>M payloads/external/GRUB2/Makefile<br>M payloads/external/Makefile.inc<br>2 files changed, 9 insertions(+), 22 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/20990/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/payloads/external/GRUB2/Makefile b/payloads/external/GRUB2/Makefile<br>index 7cac6a3..dee7f69 100644<br>--- a/payloads/external/GRUB2/Makefile<br>+++ b/payloads/external/GRUB2/Makefile<br>@@ -6,21 +6,8 @@<br> project_git_repo=git://git.sv.gnu.org/grub.git<br> project_dir=grub2<br> <br>-unexport KCONFIG_AUTOCONFIG<br>-unexport CFLAGS<br>-unexport CPPFLAGS<br>-unexport CCASFLAGS<br>-unexport CC<br>-unexport BUILD_CC<br>-unexport TARGET_CC<br>-unexport TARGET_CFLAGS<br>-unexport TARGET_CPPFLAGS<br>-unexport TARGET_STRIP<br>-unexport TARGET_OBJCOPY<br>-unexport HOST_CFLAGS<br>-unexport HOST_CPPFLAGS<br>-unexport HOST_CC<br>-<br>+unexport HOSTCC CC LD OBJCOPY STRIP<br>+MAKEOVERRIDES :=<br> <br> all: grub2<br> <br>@@ -40,19 +27,19 @@<br>     rm -rf grub2/build<br>    mkdir grub2/build<br>     cd grub2 && ./autogen.sh<br>-     cd grub2/build && ../configure BUILD_CC="$(HOSTCC)" CC="$(HOSTCC)" \<br>-     TARGET_CC="$(CC)" \<br>-        TARGET_OBJCOPY="$(OBJCOPY)" TARGET_STRIP="$(STRIP)" CFLAGS=-O2 TARGET_CFLAGS=-Os --with-platform=coreboot \<br>-      --enable-boot-time<br>+   cd grub2/build && ../configure CC="$(HOSTCC)" LD="$(LD)" \<br>+       TARGET_CC="$(CC)" TARGET_OBJCOPY="$(OBJCOPY)" TARGET_STRIP="$(STRIP)" \<br>+        CFLAGS=-O2 TARGET_CFLAGS=-Os \<br>+       --with-platform=coreboot --enable-boot-time --disable-werror<br> <br> grub2: config<br>       echo "    MAKE       GRUB2 $(NAME-y)"<br>-      $(MAKE) -C grub2/build CC="$(HOSTCC)"<br>+      $(MAKE) -C grub2/build<br>        $(MAKE) -C grub2/build default_payload.elf \<br>          EXTRA_PAYLOAD_MODULES="$(CONFIG_GRUB2_EXTRA_MODULES)"<br> <br> clean:<br>-  test -d grub2 && $(MAKE) -C grub2 clean || exit 0<br>+    test -f grub2/build/Makefile && $(MAKE) -C grub2/build clean || exit 0<br> <br> distclean:<br>        rm -rf grub2<br>diff --git a/payloads/external/Makefile.inc b/payloads/external/Makefile.inc<br>index 344fe9f..fb50604 100644<br>--- a/payloads/external/Makefile.inc<br>+++ b/payloads/external/Makefile.inc<br>@@ -155,7 +155,7 @@<br> grub2:<br>   $(MAKE) -C payloads/external/GRUB2 \<br>                  HOSTCC="$(HOSTCC)" \<br>-                       CC="$(CC_x86_32)" LD="$(LD_x86_32)" OBJDUMP="$(OBJDUMP_x86_32)" \<br>+                      CC="$(CC_x86_32)" LD="$(LD_x86_32)" \<br>                     OBJCOPY="$(OBJCOPY_x86_32)" STRIP="$(STRIP_x86_32)" \<br>                     CONFIG_GRUB2_MASTER=$(CONFIG_GRUB2_MASTER) \<br>                  CONFIG_GRUB2_REVISION=$(CONFIG_GRUB2_REVISION) \<br></pre><p>To view, visit <a href="https://review.coreboot.org/20990">change 20990</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/20990"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Iaff2c72e89a5a540fe365eacb84811d5cff9d4d4 </div>
<div style="display:none"> Gerrit-Change-Number: 20990 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Nico Huber <nico.h@gmx.de> </div>