Skip to content

Commit 8f49ec5

Browse files
heihercpackham
authored andcommitted
binutils: Add 2.45
https://lists.gnu.org/archive/html/info-gnu/2025-07/msg00009.html Add the new version rebasing the patches we carry on top. Signed-off-by: hev <git@hev.cc>
1 parent d527ff4 commit 8f49ec5

9 files changed

+614
-1
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From 0f4f6c1cc9888c9637d5e9304661888597c5dde1 Mon Sep 17 00:00:00 2001
2+
From: Chris Packham <judge.packham@gmail.com>
3+
Date: Mon, 8 Aug 2022 20:31:10 +1200
4+
Subject: [PATCH 0/5] sh conf
5+
6+
---
7+
configure | 2 +-
8+
configure.ac | 2 +-
9+
2 files changed, 2 insertions(+), 2 deletions(-)
10+
11+
diff --git a/configure b/configure
12+
index bbfb5979..bcd95684 100755
13+
--- a/configure
14+
+++ b/configure
15+
@@ -4056,7 +4056,7 @@ case "${target}" in
16+
nvptx*-*-*)
17+
noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
18+
;;
19+
- sh-*-*)
20+
+ sh*-*-*)
21+
case "${target}" in
22+
sh*-*-elf)
23+
;;
24+
diff --git a/configure.ac b/configure.ac
25+
index 659388f7..eb1c20af 100644
26+
--- a/configure.ac
27+
+++ b/configure.ac
28+
@@ -1278,7 +1278,7 @@ case "${target}" in
29+
nvptx*-*-*)
30+
noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
31+
;;
32+
- sh-*-*)
33+
+ sh*-*-*)
34+
case "${target}" in
35+
sh*-*-elf)
36+
;;
37+
--
38+
2.50.1
39+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
From 822af88496022f8f2d267d3b399d36ab36248805 Mon Sep 17 00:00:00 2001
2+
From: Chris Packham <judge.packham@gmail.com>
3+
Date: Mon, 8 Aug 2022 20:36:31 +1200
4+
Subject: [PATCH 1/5] check_ldrunpath_length
5+
6+
---
7+
ld/ldelf.c | 4 ++++
8+
1 file changed, 4 insertions(+)
9+
10+
diff --git a/ld/ldelf.c b/ld/ldelf.c
11+
index f4f27fc3..8e69b879 100644
12+
--- a/ld/ldelf.c
13+
+++ b/ld/ldelf.c
14+
@@ -1134,6 +1134,8 @@ ldelf_handle_dt_needed (struct elf_link_hash_table *htab,
15+
&& command_line.rpath == NULL)
16+
{
17+
path = (const char *) getenv ("LD_RUN_PATH");
18+
+ if (path && *path == '\0')
19+
+ path = NULL;
20+
if (path
21+
&& ldelf_search_needed (path, &n, force,
22+
is_linux, elfsize))
23+
@@ -1808,6 +1810,8 @@ ldelf_before_allocation (char **audit, char **depaudit,
24+
rpath = command_line.rpath;
25+
if (rpath == NULL)
26+
rpath = (const char *) getenv ("LD_RUN_PATH");
27+
+ if (rpath && *rpath == '\0')
28+
+ rpath = NULL;
29+
30+
for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
31+
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
32+
--
33+
2.50.1
34+
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
From 3d87c27335a19a13c928baa2a6ff1427a1354940 Mon Sep 17 00:00:00 2001
2+
From: Chris Packham <judge.packham@gmail.com>
3+
Date: Mon, 8 Aug 2022 20:37:24 +1200
4+
Subject: [PATCH 2/5] Don't link to libfl as it's unnecessary
5+
6+
---
7+
binutils/configure | 3 +++
8+
binutils/configure.ac | 3 +++
9+
gas/configure | 3 +++
10+
gas/configure.ac | 3 +++
11+
ld/configure | 3 +++
12+
ld/configure.ac | 3 +++
13+
6 files changed, 18 insertions(+)
14+
15+
diff --git a/binutils/configure b/binutils/configure
16+
index 94be2250..0a3540ee 100755
17+
--- a/binutils/configure
18+
+++ b/binutils/configure
19+
@@ -12529,6 +12529,7 @@ fi
20+
done
21+
test -n "$YACC" || YACC="yacc"
22+
23+
+save_LIBS=$LIBS
24+
for ac_prog in flex lex
25+
do
26+
# Extract the first word of "$ac_prog", so it can be a program name with args.
27+
@@ -12692,6 +12693,8 @@ esac
28+
if test "$LEX" = :; then
29+
LEX=${am_missing_run}flex
30+
fi
31+
+LIBS=$save_LIBS
32+
+LEXLIB=
33+
34+
ALL_LINGUAS="bg ca da es fi fr hr id it ja pt ro ru rw sk sr sv tr uk vi zh_CN zh_TW"
35+
36+
diff --git a/binutils/configure.ac b/binutils/configure.ac
37+
index cb65e503..8317d1be 100644
38+
--- a/binutils/configure.ac
39+
+++ b/binutils/configure.ac
40+
@@ -153,7 +153,10 @@ if test -z "$host" ; then
41+
fi
42+
43+
AC_PROG_YACC
44+
+save_LIBS=$LIBS
45+
AM_PROG_LEX
46+
+LIBS=$save_LIBS
47+
+LEXLIB=
48+
49+
ALL_LINGUAS="bg ca da es fi fr hr id it ja pt ro ru rw sk sr sv tr uk vi zh_CN zh_TW"
50+
AM_PO_SUBDIRS
51+
diff --git a/gas/configure b/gas/configure
52+
index 9c640c87..8fb28d6f 100755
53+
--- a/gas/configure
54+
+++ b/gas/configure
55+
@@ -13036,6 +13036,7 @@ fi
56+
done
57+
test -n "$YACC" || YACC="yacc"
58+
59+
+save_LIBS=$LIBS
60+
for ac_prog in flex lex
61+
do
62+
# Extract the first word of "$ac_prog", so it can be a program name with args.
63+
@@ -13199,6 +13200,8 @@ esac
64+
if test "$LEX" = :; then
65+
LEX=${am_missing_run}flex
66+
fi
67+
+LIBS=$save_LIBS
68+
+LEXLIB=
69+
70+
ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN"
71+
72+
diff --git a/gas/configure.ac b/gas/configure.ac
73+
index 30fa5eb1..293babec 100644
74+
--- a/gas/configure.ac
75+
+++ b/gas/configure.ac
76+
@@ -938,7 +938,10 @@ AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}", [Target vendor.])
77+
AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}", [Target OS.])
78+
79+
AC_PROG_YACC
80+
+save_LIBS=$LIBS
81+
AM_PROG_LEX
82+
+LIBS=$save_LIBS
83+
+LEXLIB=
84+
85+
ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN"
86+
AM_PO_SUBDIRS
87+
diff --git a/ld/configure b/ld/configure
88+
index 78b54b39..956b8b1c 100755
89+
--- a/ld/configure
90+
+++ b/ld/configure
91+
@@ -18016,6 +18016,7 @@ fi
92+
done
93+
test -n "$YACC" || YACC="yacc"
94+
95+
+save_LIBS=$LIBS
96+
for ac_prog in flex lex
97+
do
98+
# Extract the first word of "$ac_prog", so it can be a program name with args.
99+
@@ -18179,6 +18180,8 @@ esac
100+
if test "$LEX" = :; then
101+
LEX=${am_missing_run}flex
102+
fi
103+
+LIBS=$save_LIBS
104+
+LEXLIB=
105+
106+
107+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
108+
diff --git a/ld/configure.ac b/ld/configure.ac
109+
index 3ee84958..a8f64fe7 100644
110+
--- a/ld/configure.ac
111+
+++ b/ld/configure.ac
112+
@@ -407,7 +407,10 @@ ZW_GNU_GETTEXT_SISTER_DIR
113+
AC_EXEEXT
114+
115+
AC_PROG_YACC
116+
+save_LIBS=$LIBS
117+
AM_PROG_LEX
118+
+LIBS=$save_LIBS
119+
+LEXLIB=
120+
121+
AM_MAINTAINER_MODE
122+
AM_CONDITIONAL(GENINSRC_NEVER, false)
123+
--
124+
2.50.1
125+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
From dcfc968ba2e71e1bae88f87b07d11f36758a74cd Mon Sep 17 00:00:00 2001
2+
From: Andrew Hsieh <andrewhsieh@google.com>
3+
Date: Wed, 18 Mar 2015 10:57:24 +0800
4+
Subject: [PATCH 3/5] Fix darwin build
5+
6+
1. In Drawin PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and the GCC < 4.4
7+
doesn't support ended initializer list
8+
2. wcsncasecmp doesn't exist in MacSDK10.6.x
9+
10+
Change-Id: I69204a72f853f5263dffedc448379d75ed4eca2e
11+
---
12+
bfd/peXXigen.c | 22 ++++++++++++++++++++++
13+
1 file changed, 22 insertions(+)
14+
15+
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
16+
index c337fc5b..5a0c4538 100644
17+
--- a/bfd/peXXigen.c
18+
+++ b/bfd/peXXigen.c
19+
@@ -3688,6 +3688,28 @@ u16_mbtouc (wint_t * puc, const unsigned short * s, unsigned int n)
20+
}
21+
#endif /* not Cygwin/Mingw */
22+
23+
+#if defined __APPLE__ && __DARWIN_C_LEVEL < 200809L
24+
+/* wcsncasecmp isn't always defined in Mac SDK */
25+
+static int
26+
+wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n)
27+
+{
28+
+ wchar_t c1, c2;
29+
+
30+
+ if (n == 0)
31+
+ return (0);
32+
+ for (; *s1; s1++, s2++)
33+
+ {
34+
+ c1 = towlower(*s1);
35+
+ c2 = towlower(*s2);
36+
+ if (c1 != c2)
37+
+ return ((int)c1 - c2);
38+
+ if (--n == 0)
39+
+ return (0);
40+
+ }
41+
+ return (-*s2);
42+
+}
43+
+#endif
44+
+
45+
/* Perform a comparison of two entries. */
46+
static signed int
47+
rsrc_cmp (bool is_name, rsrc_entry * a, rsrc_entry * b)
48+
--
49+
2.50.1
50+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
From 471d1d6d49821cfadfc232d2e44eaaa76f6e4186 Mon Sep 17 00:00:00 2001
2+
From: Sven Rebhan <odinshorse@googlemail.com>
3+
Date: Mon, 8 Aug 2022 20:46:29 +1200
4+
Subject: [PATCH 4/5] sysroot
5+
6+
Always try to prepend the sysroot prefix to absolute filenames first.
7+
8+
http://bugs.gentoo.org/275666
9+
http://sourceware.org/bugzilla/show_bug.cgi?id=10340
10+
11+
Signed-off-by: Sven Rebhan <odinshorse@googlemail.com>
12+
---
13+
ld/ldfile.c | 11 +++++++++--
14+
1 file changed, 9 insertions(+), 2 deletions(-)
15+
16+
diff --git a/ld/ldfile.c b/ld/ldfile.c
17+
index 75fd360d..6d208be3 100644
18+
--- a/ld/ldfile.c
19+
+++ b/ld/ldfile.c
20+
@@ -556,18 +556,25 @@ ldfile_open_file_search (const char *arch,
21+
directory first. */
22+
if (!entry->flags.maybe_archive)
23+
{
24+
- if (entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename))
25+
+ /* For absolute pathnames, try to always open the file in the
26+
+ sysroot first. If this fails, try to open the file at the
27+
+ given location. */
28+
+ entry->flags.sysrooted = is_sysrooted_pathname (entry->filename);
29+
+ if (!entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename)
30+
+ && ld_sysroot)
31+
{
32+
char *name = concat (ld_sysroot, entry->filename,
33+
(const char *) NULL);
34+
if (ldfile_try_open_bfd (name, entry))
35+
{
36+
entry->filename = name;
37+
+ entry->flags.sysrooted = true;
38+
return true;
39+
}
40+
free (name);
41+
}
42+
- else if (ldfile_try_open_bfd (entry->filename, entry))
43+
+
44+
+ if (ldfile_try_open_bfd (entry->filename, entry))
45+
return true;
46+
47+
if (IS_ABSOLUTE_PATH (entry->filename))
48+
--
49+
2.50.1
50+

0 commit comments

Comments
 (0)