From 127aca78c2e9f38cc1e1ec471ea250b22607e829 Mon Sep 17 00:00:00 2001 From: Liwei Ge Date: Tue, 10 Nov 2020 20:44:33 -0500 Subject: [PATCH] Fix gcc10 build issue this change has given better compatible with both gcc8 and gcc10 toolchain, should be maintained util upstream fixes gcc10 switched default behavior from -fcommon to -fno-common. Since "__shared" relies on the legacy behavior, explicitly specify it. Signed-off-by: Liwei Ge Signed-off-by: weitao zhou --- 1001-ipxe-gcc10.patch | 27 +++++++++++++++++++++++++++ ipxe.spec | 10 +++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 1001-ipxe-gcc10.patch diff --git a/1001-ipxe-gcc10.patch b/1001-ipxe-gcc10.patch new file mode 100644 index 0000000..9df561f --- /dev/null +++ b/1001-ipxe-gcc10.patch @@ -0,0 +1,27 @@ +From f982a712979619dbae2c6e0d741757e2ce94be11 Mon Sep 17 00:00:00 2001 +From: Bruce Rogers +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 +Modified-by: Michael Brown +Signed-off-by: Michael Brown +--- + 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 diff --git a/ipxe.spec b/ipxe.spec index 781d721..c10be1d 100644 --- a/ipxe.spec +++ b/ipxe.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 # Resulting binary formats we want from iPXE %global formats rom @@ -38,7 +39,7 @@ Name: ipxe Version: %{date} -Release: 9.git%{hash}%{?dist} +Release: 9.git%{hash}%{anolis_release}%{?dist} Summary: A network boot loader Group: System Environment/Base @@ -58,6 +59,10 @@ Patch0005: 0001-efi-perform-cable-detection-at-NII-initialization-on-HPE-557SFP. Patch0006: ipxe-ping-cmd.patch Patch0007: 0001-arm-Provide-dummy-implementation-for-in-out-s-b-w-l.patch +# Begin: Anolis customized patches +Patch1001: 1001-ipxe-gcc10.patch +# End: Anolis customized patches + %ifarch %{buildarches} BuildRequires: perl-interpreter BuildRequires: perl-Getopt-Long @@ -294,6 +299,9 @@ cp -a src/bin-arm64-efi/ipxe.efi %{buildroot}/%{_datadir}/%{name}/arm64-efi/ipxe %endif %changelog +* Mon May 16 2022 liuxiaoping - 20181214-9.git133f4c47.0.1 +- Fix gcc10 -fno-common compile issue for compatible with gcc10 build (geliwei@openanolis.org) + * Tue Mar 01 2022 Yaakov Selkowitz - 20181214-9.git133f4c47 - Add ARM 64 EFI artifacts (bz 2059350) -- Gitee