Skip to contentSkip to conversation

ipxe: Fix gcc10 compilation

PATCH Bertrand Marquis 1 participant 2 messages Oct 9, 2020 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi Bruce,

For whatever reason the beginning of my commit message is removed, i tried to resend it but the same happen again.

This is the first sentence:

Add ipxe patch to pass -fcommon flag to gcc during compilation. This patch is required to have ipxe compiling properly with gcc10.

No idea why this is happening.

Regards
Bertrand

Quoted 67 lines · Bertrand Marquis via lists.yoctoproject.org

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

---
Changes in v2: add missing part in commit message
---
...cit-about-fcommon-compiler-directive.patch | 33 +++++++++++++++++++
recipes-extended/ipxe/ipxe_git.bb | 1 +

2 files changed, 34 insertions(+)

create mode 100644 recipes-extended/ipxe/files/build-be-explicit-about-fcommon-compiler-directive.patch

recipes-extended/ipxe/files/build-be-explicit-about-fcommon-compiler-directive.patch new file +33 -0
new file mode 100644
index 0000000..6fa5858
@@ -0,0 +1,33 @@
+From f982a712979619dbae2c6e0d741757e2ce94be11 Mon Sep 17 00:00:00 2001
+Message-Id: <f982a712979619dbae2c6e0d741757e2ce94be11.1602165412.git.bertrand.marquis@arm.com>
+From: Bruce Rogers <[email protected]>
+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 <[email protected]>
+Modified-by: Michael Brown <[email protected]>
+Signed-off-by: Michael Brown <[email protected]>
+---
+ 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
+
recipes-extended/ipxe/ipxe_git.bb +1 -0
index fbaad30..d7c60ab 100644
@@ -15,6 +15,7 @@ SRC_URI = " \
    file://ipxe-fix-hostcc-nopie-cflags.patch \
    file://ipxe-intel-Avoid-spurious-compiler-warning-on-GCC-10.patch \
    file://ipxe-golan-Add-explicit-type-casts-for-nodnic_queue_pair_.patch \
+    file://build-be-explicit-about-fcommon-compiler-directive.patch \
    "
 
Quoted 7 lines

FILES_${PN} = "/usr/share/firmware/*.rom"
--
2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Actually it seems this is my mail client hidding it (as the online view is correct)

So you can ignore the v2.

Sorry for the noise :-)

Cheers
Bertrand

Quoted 95 lines · Bertrand Marquis via lists.yoctoproject.org

Hi Bruce,

For whatever reason the beginning of my commit message is removed, i tried to resend it but the same happen again.

This is the first sentence:

Add ipxe patch to pass -fcommon flag to gcc during compilation. This patch is required to have ipxe compiling properly with gcc10.

No idea why this is happening.

Regards
Bertrand

Quoted 67 lines · Bertrand Marquis via lists.yoctoproject.org

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

---
Changes in v2: add missing part in commit message
---
...cit-about-fcommon-compiler-directive.patch | 33 +++++++++++++++++++
recipes-extended/ipxe/ipxe_git.bb | 1 +

2 files changed, 34 insertions(+)

create mode 100644 recipes-extended/ipxe/files/build-be-explicit-about-fcommon-compiler-directive.patch

recipes-extended/ipxe/files/build-be-explicit-about-fcommon-compiler-directive.patch new file +33 -0
new file mode 100644
index 0000000..6fa5858
@@ -0,0 +1,33 @@
+From f982a712979619dbae2c6e0d741757e2ce94be11 Mon Sep 17 00:00:00 2001
+Message-Id: <f982a712979619dbae2c6e0d741757e2ce94be11.1602165412.git.bertrand.marquis@arm.com>
+From: Bruce Rogers <[email protected]>
+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 <[email protected]>
+Modified-by: Michael Brown <[email protected]>
+Signed-off-by: Michael Brown <[email protected]>
+---
+ 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
+
recipes-extended/ipxe/ipxe_git.bb +1 -0
index fbaad30..d7c60ab 100644
@@ -15,6 +15,7 @@ SRC_URI = " \
   file://ipxe-fix-hostcc-nopie-cflags.patch \
   file://ipxe-intel-Avoid-spurious-compiler-warning-on-GCC-10.patch \
   file://ipxe-golan-Add-explicit-type-casts-for-nodnic_queue_pair_.patch \
+    file://build-be-explicit-about-fcommon-compiler-directive.patch \
   "
 
Quoted 7 lines

FILES_${PN} = "/usr/share/firmware/*.rom"
--
2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.