gnuboot-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v3 01/11] crossgcc/default: fix build errors on host gcc 13.x


From: Leah Rowe
Subject: [PATCH v3 01/11] crossgcc/default: fix build errors on host gcc 13.x
Date: Tue, 16 Jan 2024 15:39:30 +0000

From: Leah Rowe <leah@libreboot.org>

import a workaround from upstream for gnat builds, and
disable treating warnings as errors. i've pretty much
taken the bazooka approach here.

tested on a bleeding edge gnu+linux distro. boards
using coreboot/default should now compile on parabola,
for example.

also disable treating warnings as errors, when building
gcc 11.2 from coreboot crossgcc

Signed-off-by: Leah Rowe <info@minifree.org>
---
 .../0017-fix-crossgcc-build-error.patch       | 55 +++++++++++++++
 ...e-warning-as-error-when-building-gcc.patch | 68 +++++++++++++++++++
 2 files changed, 123 insertions(+)
 create mode 100644 
resources/coreboot/default/patches/0017-fix-crossgcc-build-error.patch
 create mode 100644 
resources/coreboot/default/patches/0018-disable-warning-as-error-when-building-gcc.patch

diff --git 
a/resources/coreboot/default/patches/0017-fix-crossgcc-build-error.patch 
b/resources/coreboot/default/patches/0017-fix-crossgcc-build-error.patch
new file mode 100644
index 0000000..3a48c93
--- /dev/null
+++ b/resources/coreboot/default/patches/0017-fix-crossgcc-build-error.patch
@@ -0,0 +1,55 @@
+From c1b527867405e999f4231b30ab15eaf7c3b30e90 Mon Sep 17 00:00:00 2001
+From: Leah Rowe <leah@libreboot.org>
+Date: Sat, 19 Nov 2022 14:55:01 +0000
+Subject: [PATCH 1/2] fix crossgcc build error
+
+---
+ util/crossgcc/patches/gcc-11.2.0_gnat.patch | 32 ++++++++++++++++++++-
+ 1 file changed, 31 insertions(+), 1 deletion(-)
+
+diff --git a/util/crossgcc/patches/gcc-11.2.0_gnat.patch 
b/util/crossgcc/patches/gcc-11.2.0_gnat.patch
+index 2d7cecee24..c22cec45d0 100644
+--- a/util/crossgcc/patches/gcc-11.2.0_gnat.patch
++++ b/util/crossgcc/patches/gcc-11.2.0_gnat.patch
+@@ -5,7 +5,37 @@
+  
+  # Extra flags to pass to recursive makes.
+ -COMMON_ADAFLAGS= -gnatpg
+-+COMMON_ADAFLAGS= -gnatpg -gnatwGUR
+++COMMON_ADAFLAGS= -gnatpg -gnatwn
+  ifeq ($(TREECHECKING),)
+  CHECKING_ADAFLAGS=
+  else
++diff -Nurp gcc-11.2.0/gcc/ada/gcc-interface/Make-lang.in 
gcc-11.2.0.new/gcc/ada/gcc-interface/Make-lang.in
++--- gcc-11.2.0/gcc/ada/gcc-interface/Make-lang.in     2022-06-03 
00:31:57.993273717 +0200
+++++ gcc-11.2.0.new/gcc/ada/gcc-interface/Make-lang.in 2022-06-03 
00:30:50.214166847 +0200
++@@ -334,6 +334,7 @@ GNAT_ADA_OBJS =   \
++  ada/hostparm.o      \
++  ada/impunit.o       \
++  ada/inline.o        \
+++ ada/libgnat/i-c.o   \
++  ada/libgnat/interfac.o      \
++  ada/itypes.o        \
++  ada/krunch.o        \
++@@ -364,7 +365,10 @@ GNAT_ADA_OBJS =  \
++  ada/rtsfind.o       \
++  ada/libgnat/s-addope.o      \
++  ada/libgnat/s-addima.o \
+++ ada/libgnat/s-aotase.o      \
++  ada/libgnat/s-assert.o      \
+++ ada/libgnat/s-atoope.o      \
+++ ada/libgnat/s-atopri.o      \
++  ada/libgnat/s-bitops.o      \
++  ada/libgnat/s-carun8.o      \
++  ada/libgnat/s-casuti.o      \
++@@ -548,6 +552,7 @@ GNATBIND_OBJS = \
++  ada/hostparm.o   \
++  ada/init.o       \
++  ada/initialize.o \
+++ ada/libgnat/i-c.o        \
++  ada/libgnat/interfac.o   \
++  ada/krunch.o     \
++  ada/lib.o        \
+-- 
+2.39.2
+
diff --git 
a/resources/coreboot/default/patches/0018-disable-warning-as-error-when-building-gcc.patch
 
b/resources/coreboot/default/patches/0018-disable-warning-as-error-when-building-gcc.patch
new file mode 100644
index 0000000..c2da9df
--- /dev/null
+++ 
b/resources/coreboot/default/patches/0018-disable-warning-as-error-when-building-gcc.patch
@@ -0,0 +1,68 @@
+From 67a1a6ac1667cf6968b8007888654b4b940ea820 Mon Sep 17 00:00:00 2001
+From: Leah Rowe <leah@libreboot.org>
+Date: Mon, 15 Jan 2024 22:39:12 +0000
+Subject: [PATCH 2/2] disable warning-as-error when building gcc
+
+needed, because newer host gcc will treat warnings as errors,
+and some of this older code will trip on the newer handling.
+
+Signed-off-by: Leah Rowe <info@minifree.org>
+---
+ util/crossgcc/buildgcc | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
+index dd32ee6ba8..5e6a3310a7 100755
+--- a/util/crossgcc/buildgcc
++++ b/util/crossgcc/buildgcc
+@@ -609,7 +609,7 @@ set_hostcflags_from_gmp() {
+       # Now set CFLAGS to match GMP CFLAGS but strip out -pedantic
+       # as GCC 4.6.x fails if it's there.
+       HOSTCFLAGS="$(grep __GMP_CFLAGS "$DESTDIR$TARGETDIR/include/gmp.h" |cut 
-d\" -f2 |\
+-          sed s,-pedantic,,)"
++          sed s,-pedantic,,) -Wno-error -w"
+       export HOSTCFLAGS
+ }
+ 
+@@ -698,13 +698,13 @@ build_BINUTILS() {
+ 
+ bootstrap_GCC() {
+       # shellcheck disable=SC2086
+-      CC="$(hostcc host)" CXX="$(hostcxx host)" \
+-              CFLAGS="$HOSTCFLAGS" \
+-              CFLAGS_FOR_BUILD="$HOSTCFLAGS" \
+-              CFLAGS_FOR_TARGET="$HOSTCFLAGS -fPIC" \
+-              CXXFLAGS="$HOSTCFLAGS" \
+-              CXXFLAGS_FOR_BUILD="$HOSTCFLAGS" \
+-              CXXFLAGS_FOR_TARGET="$HOSTCFLAGS -fPIC" \
++      CC="$(hostcc host) -Wno-error -w" CXX="$(hostcxx host) -Wno-error -w" \
++              CFLAGS="$HOSTCFLAGS -Wno-error -w" \
++              CFLAGS_FOR_BUILD="$HOSTCFLAGS -Wno-error -w" \
++              CFLAGS_FOR_TARGET="$HOSTCFLAGS -fPIC -Wno-error -w" \
++              CXXFLAGS="$HOSTCFLAGS -Wno-error -w" \
++              CXXFLAGS_FOR_BUILD="$HOSTCFLAGS -Wno-error -w" \
++              CXXFLAGS_FOR_TARGET="$HOSTCFLAGS -fPIC -Wno-error -w" \
+               ../gcc-${GCC_VERSION}/configure \
+               --prefix="$TARGETDIR" --libexecdir="$TARGETDIR/lib" \
+               --enable-bootstrap \
+@@ -1021,7 +1021,7 @@ if [ -n "$CC" ]; then
+       fi
+ else
+       if searchtool gnatgcc "Free Software Foundation" nofail > /dev/null; 
then
+-              CC=gnatgcc
++              CC="gnatgcc"
+       elif searchtool gcc "Free Software Foundation" nofail > /dev/null; then
+               CC=gcc
+       else
+@@ -1143,7 +1143,7 @@ if ada_requested; then
+ fi
+ fi # GCC
+ 
+-export HOSTCFLAGS="-Os"
++export HOSTCFLAGS="-Os -Wno-error -w"
+ if have_hostcflags_from_gmp; then
+       set_hostcflags_from_gmp
+ fi
+-- 
+2.39.2
+
-- 
2.39.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]