meta-virtualization/recipes-extended/ipxe/files/build-be-explicit-about-fcommon-compiler-directive.patch
Bertrand Marquis 1d86197846 ipxe: Fix gcc10 compilation
Add ipxe patch to pass -fcommon flag to gcc during compilation.
This patch is required to have ipxe compiling properly with gcc10.

Without it the following error occur (and multiple others of the same
kind:
bin/blib.a(epic100.o):(.bss+0x0): multiple definition of `_shared_bss';
  bin/blib.a(davicom.o):(.bss+0x0): first defined here

Change-Id: Id9aed4cfe6bec9c0cbdb0b99271ddff472f1f0c3
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-10-14 20:34:04 -04:00

34 lines
1.0 KiB
Diff

From f982a712979619dbae2c6e0d741757e2ce94be11 Mon Sep 17 00:00:00 2001
Message-Id: <f982a712979619dbae2c6e0d741757e2ce94be11.1602165412.git.bertrand.marquis@arm.com>
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.
Upstream-Status: backport
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 66d6dd44..b6c61c11 100644
--- a/Makefile.housekeeping
+++ b/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
--
2.17.1