coreboot/fam15h: fixing binutils not building properly

Without that fix, if we build for a fam15h target on PureOS byzantium,
we have a build failure:

	$ ./build boot roms kgpe-d16-udimm_2mb
	  [...]
	  Building MPC v1.1.0 for host ... ok
	  Building BINUTILS v2.32 for target ... failed. Check 'build-i386-elf-BINUTILS/build.log
	  make[2]: *** [Makefile:26: build_gcc] Error 1
	  make[1]: *** [Makefile:51: build-i386] Error 2
	  make: *** [util/crossgcc/Makefile.inc:48: crossgcc-i386] Error 2
	  Error: build/roms: something went wrong

Then the build log (here) in available in
coreboot/fam15h_udimm/util/crossgcc/build-i386-elf-BINUTILS/build.log
has the following:
	In file included from ../../binutils-2.32/gold/debug.h:29,
        	         from ../../binutils-2.32/gold/descriptors.cc:31:
	../../binutils-2.32/gold/errors.h:87:50: error:
	'string' in namespace 'std' does not name a type
	   87 |   undefined_symbol(const Symbol* sym, const std::string& location);
	      |                                                  ^~~~~~
	../../binutils-2.32/gold/errors.h:29:1: note: 'std::string'
	is defined in header '<string>'; did you forget to '#include <string>'?
	   28 | #include "gold-threads.h"
	  +++ |+#include <string>
	   29 |

Signed-off-by: Adrien Bourmault <neox@a-lec.org>
GNUtoo: commit message but not its title
Acked-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
This commit is contained in:
Adrien Bourmault 2023-08-08 15:33:51 +02:00
parent b77307995a
commit 0d77d99d23
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
2 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,29 @@
From 4b4b2bdc2cedb3e219c6f90809e5684441b1dafa Mon Sep 17 00:00:00 2001
From: Adrien 'neox' Bourmault <neox@gnu.org>
Date: Sun, 8 Aug 2023 15:31:32 +0200
Subject: [PATCH 1/1] crossgcc: patch binutils 2.32 for newer hostcc
Signed-off-by: Adrien 'neox' Bourmault <neox@gnu.org>
---
util/crossgcc/patches/binutils-2.32_stringfix.patch | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 util/crossgcc/patches/binutils-2.32_stringfix.patch
diff --git a/util/crossgcc/patches/binutils-2.32_stringfix.patch b/util/crossgcc/patches/binutils-2.32_stringfix.patch
new file mode 100644
index 0000000000..de27a2752a
--- /dev/null
+++ b/util/crossgcc/patches/binutils-2.32_stringfix.patch
@@ -0,0 +1,10 @@
+diff -u binutils-2.32/gold/errors.h binutils-2.32.patched/gold/errors.h
+--- binutils-2.32/gold/errors.h
++++ binutils-2.32.patched/gold/errors.h
+@@ -24,6 +24,7 @@
+ #define GOLD_ERRORS_H
+
+ #include <cstdarg>
++#include <string>
+
+ #include "gold-threads.h"
--
2.40.1

View File

@ -0,0 +1,29 @@
From 4b4b2bdc2cedb3e219c6f90809e5684441b1dafa Mon Sep 17 00:00:00 2001
From: Adrien 'neox' Bourmault <neox@gnu.org>
Date: Sun, 8 Aug 2023 15:31:32 +0200
Subject: [PATCH 1/1] crossgcc: patch binutils 2.32 for newer hostcc
Signed-off-by: Adrien 'neox' Bourmault <neox@gnu.org>
---
util/crossgcc/patches/binutils-2.32_stringfix.patch | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 util/crossgcc/patches/binutils-2.32_stringfix.patch
diff --git a/util/crossgcc/patches/binutils-2.32_stringfix.patch b/util/crossgcc/patches/binutils-2.32_stringfix.patch
new file mode 100644
index 0000000000..de27a2752a
--- /dev/null
+++ b/util/crossgcc/patches/binutils-2.32_stringfix.patch
@@ -0,0 +1,10 @@
+diff -u binutils-2.32/gold/errors.h binutils-2.32.patched/gold/errors.h
+--- binutils-2.32/gold/errors.h
++++ binutils-2.32.patched/gold/errors.h
+@@ -24,6 +24,7 @@
+ #define GOLD_ERRORS_H
+
+ #include <cstdarg>
++#include <string>
+
+ #include "gold-threads.h"
--
2.40.1