[36/62] ipfire-netboot: Fix build with GCC 10

Message ID 20200816102953.3881-36-michael.tremer@ipfire.org
State Accepted
Commit ac2d807d1ce5ca08b750aea4373037a0a699526c
Headers
Series [01/62] bison: Update to 3.7.1 |

Commit Message

Michael Tremer Aug. 16, 2020, 10:29 a.m. UTC
  Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 lfs/ipfire-netboot                            |  1 +
 ...cit-about-fcommon-compiler-directive.patch | 27 +++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 src/patches/ipxe-1b67a05-be-explicit-about-fcommon-compiler-directive.patch
  

Patch

diff --git a/lfs/ipfire-netboot b/lfs/ipfire-netboot
index 23f5d4375..af9ef8e92 100644
--- a/lfs/ipfire-netboot
+++ b/lfs/ipfire-netboot
@@ -79,6 +79,7 @@  $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 	cd $(DIR_APP) && tar axf $(DIR_DL)/ipxe-$(PXE_VER).tar.gz
 	cd $(DIR_APP)/ipxe-$(PXE_VER) && patch -Np1 < $(DIR_SRC)/src/patches/ipxe-fix-stringop-truncation-warning-with-gcc-8-x.patch
 	cd $(DIR_APP)/ipxe-$(PXE_VER) && patch -Np1 < $(DIR_SRC)/src/patches/ipxe-handle-R_X86_64_PLT32.patch
+	cd $(DIR_APP)/ipxe-$(PXE_VER) && patch -Np1 < $(DIR_SRC)/src/patches/ipxe-1b67a05-be-explicit-about-fcommon-compiler-directive.patch
 	cd $(DIR_APP) && rm -rfv ipxe && ln -s ipxe-$(PXE_VER) ipxe
 	cd $(DIR_APP) && make $(MAKETUNING) bin/ipxe.lkrn
 ifeq "$(BUILD_ARCH)" "x86_64"
diff --git a/src/patches/ipxe-1b67a05-be-explicit-about-fcommon-compiler-directive.patch b/src/patches/ipxe-1b67a05-be-explicit-about-fcommon-compiler-directive.patch
new file mode 100644
index 000000000..9df561f67
--- /dev/null
+++ b/src/patches/ipxe-1b67a05-be-explicit-about-fcommon-compiler-directive.patch
@@ -0,0 +1,27 @@ 
+From f982a712979619dbae2c6e0d741757e2ce94be11 Mon Sep 17 00:00:00 2001
+From: Bruce Rogers <brogers@suse.com>
+Date: Wed, 6 May 2020 15:03:02 -0600
+Subject: [PATCH] [build] Be explicit about -fcommon compiler directive
+
+gcc10 switched default behavior from -fcommon to -fno-common.  Since
+"__shared" relies on the legacy behavior, explicitly specify it.
+
+Signed-off-by: Bruce Rogers <brogers@suse.com>
+Modified-by: Michael Brown <mcb30@ipxe.org>
+Signed-off-by: Michael Brown <mcb30@ipxe.org>
+---
+ src/Makefile.housekeeping | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
+index 66d6dd449..b6c61c112 100644
+--- a/src/Makefile.housekeeping
++++ b/src/Makefile.housekeeping
+@@ -418,6 +418,7 @@ CFLAGS		+= -Os
+ CFLAGS		+= -g
+ ifeq ($(CCTYPE),gcc)
+ CFLAGS		+= -ffreestanding
++CFLAGS		+= -fcommon
+ CFLAGS		+= -Wall -W -Wformat-nonliteral
+ HOST_CFLAGS	+= -Wall -W -Wformat-nonliteral
+ endif