mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-29 17:18:53 +00:00
binutils: Add 2.43.1
https://sourceware.org/pipermail/binutils/2024-August/136396.html Add the new version rebasing the patches we carry on top. Signed-off-by: Chris Packham <judge.packham@gmail.com>
This commit is contained in:
parent
146fee59bc
commit
8105791c34
32
packages/binutils/2.43.1/0000-sh-conf.patch
vendored
Normal file
32
packages/binutils/2.43.1/0000-sh-conf.patch
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
From b8fd4192eb490b4dc9db447dd71afaf611dc2a28 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chris Packham <judge.packham@gmail.com>
|
||||||
|
Date: Mon, 8 Aug 2022 20:31:10 +1200
|
||||||
|
Subject: [PATCH 0/8] sh conf
|
||||||
|
|
||||||
|
---
|
||||||
|
configure | 2 +-
|
||||||
|
configure.ac | 2 +-
|
||||||
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
--- a/configure
|
||||||
|
+++ b/configure
|
||||||
|
@@ -4042,7 +4042,7 @@
|
||||||
|
nvptx*-*-*)
|
||||||
|
noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
|
||||||
|
;;
|
||||||
|
- sh-*-*)
|
||||||
|
+ sh*-*-*)
|
||||||
|
case "${target}" in
|
||||||
|
sh*-*-elf)
|
||||||
|
;;
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -1270,7 +1270,7 @@
|
||||||
|
nvptx*-*-*)
|
||||||
|
noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
|
||||||
|
;;
|
||||||
|
- sh-*-*)
|
||||||
|
+ sh*-*-*)
|
||||||
|
case "${target}" in
|
||||||
|
sh*-*-elf)
|
||||||
|
;;
|
29
packages/binutils/2.43.1/0001-check_ldrunpath_length.patch
vendored
Normal file
29
packages/binutils/2.43.1/0001-check_ldrunpath_length.patch
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
From aad130ddadd19ae40e5405a7b9ddd5ae1ec138f0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chris Packham <judge.packham@gmail.com>
|
||||||
|
Date: Mon, 8 Aug 2022 20:36:31 +1200
|
||||||
|
Subject: [PATCH 1/8] check_ldrunpath_length
|
||||||
|
|
||||||
|
---
|
||||||
|
ld/ldelf.c | 4 ++++
|
||||||
|
1 file changed, 4 insertions(+)
|
||||||
|
|
||||||
|
--- a/ld/ldelf.c
|
||||||
|
+++ b/ld/ldelf.c
|
||||||
|
@@ -1130,6 +1130,8 @@
|
||||||
|
&& command_line.rpath == NULL)
|
||||||
|
{
|
||||||
|
path = (const char *) getenv ("LD_RUN_PATH");
|
||||||
|
+ if (path && *path == '\0')
|
||||||
|
+ path = NULL;
|
||||||
|
if (path
|
||||||
|
&& ldelf_search_needed (path, &n, force,
|
||||||
|
is_linux, elfsize))
|
||||||
|
@@ -1805,6 +1807,8 @@
|
||||||
|
rpath = command_line.rpath;
|
||||||
|
if (rpath == NULL)
|
||||||
|
rpath = (const char *) getenv ("LD_RUN_PATH");
|
||||||
|
+ if (rpath && *rpath == '\0')
|
||||||
|
+ rpath = NULL;
|
||||||
|
|
||||||
|
for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
|
||||||
|
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
|
21
packages/binutils/2.43.1/0002-MinGW-w64-winpthreads-doesn-t-have-pthread_mutexattr.patch
vendored
Normal file
21
packages/binutils/2.43.1/0002-MinGW-w64-winpthreads-doesn-t-have-pthread_mutexattr.patch
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
From 5ecb202705a6108aa38cab24f5d8d7d347e71ed6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chris Packham <judge.packham@gmail.com>
|
||||||
|
Date: Mon, 8 Aug 2022 20:37:03 +1200
|
||||||
|
Subject: [PATCH 2/8] MinGW w64 winpthreads doesn't have
|
||||||
|
pthread_mutexattr_settype
|
||||||
|
|
||||||
|
---
|
||||||
|
gold/gold-threads.cc | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
--- a/gold/gold-threads.cc
|
||||||
|
+++ b/gold/gold-threads.cc
|
||||||
|
@@ -101,7 +101,7 @@
|
||||||
|
int err = pthread_mutexattr_init(&attr);
|
||||||
|
if (err != 0)
|
||||||
|
gold_fatal(_("pthead_mutexattr_init failed: %s"), strerror(err));
|
||||||
|
-#ifdef PTHREAD_MUTEX_ADAPTIVE_NP
|
||||||
|
+#if defined(PTHREAD_MUTEX_ADAPTIVE_NP) && !defined(_WIN32)
|
||||||
|
err = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP);
|
||||||
|
if (err != 0)
|
||||||
|
gold_fatal(_("pthread_mutexattr_settype failed: %s"), strerror(err));
|
110
packages/binutils/2.43.1/0003-Don-t-link-to-libfl-as-it-s-unnecessary.patch
vendored
Normal file
110
packages/binutils/2.43.1/0003-Don-t-link-to-libfl-as-it-s-unnecessary.patch
vendored
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
From 3a84b957286a337379d36b530358c32576154b00 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chris Packham <judge.packham@gmail.com>
|
||||||
|
Date: Mon, 8 Aug 2022 20:37:24 +1200
|
||||||
|
Subject: [PATCH 3/8] Don't link to libfl as it's unnecessary
|
||||||
|
|
||||||
|
---
|
||||||
|
binutils/configure | 3 +++
|
||||||
|
binutils/configure.ac | 3 +++
|
||||||
|
gas/configure | 3 +++
|
||||||
|
gas/configure.ac | 3 +++
|
||||||
|
ld/configure | 3 +++
|
||||||
|
ld/configure.ac | 3 +++
|
||||||
|
6 files changed, 18 insertions(+)
|
||||||
|
|
||||||
|
--- a/binutils/configure
|
||||||
|
+++ b/binutils/configure
|
||||||
|
@@ -12529,6 +12529,7 @@
|
||||||
|
done
|
||||||
|
test -n "$YACC" || YACC="yacc"
|
||||||
|
|
||||||
|
+save_LIBS=$LIBS
|
||||||
|
for ac_prog in flex lex
|
||||||
|
do
|
||||||
|
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||||
|
@@ -12692,6 +12693,8 @@
|
||||||
|
if test "$LEX" = :; then
|
||||||
|
LEX=${am_missing_run}flex
|
||||||
|
fi
|
||||||
|
+LIBS=$save_LIBS
|
||||||
|
+LEXLIB=
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
--- a/binutils/configure.ac
|
||||||
|
+++ b/binutils/configure.ac
|
||||||
|
@@ -153,7 +153,10 @@
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_PROG_YACC
|
||||||
|
+save_LIBS=$LIBS
|
||||||
|
AM_PROG_LEX
|
||||||
|
+LIBS=$save_LIBS
|
||||||
|
+LEXLIB=
|
||||||
|
|
||||||
|
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"
|
||||||
|
ZW_GNU_GETTEXT_SISTER_DIR
|
||||||
|
--- a/gas/configure
|
||||||
|
+++ b/gas/configure
|
||||||
|
@@ -13052,6 +13052,7 @@
|
||||||
|
done
|
||||||
|
test -n "$YACC" || YACC="yacc"
|
||||||
|
|
||||||
|
+save_LIBS=$LIBS
|
||||||
|
for ac_prog in flex lex
|
||||||
|
do
|
||||||
|
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||||
|
@@ -13215,6 +13216,8 @@
|
||||||
|
if test "$LEX" = :; then
|
||||||
|
LEX=${am_missing_run}flex
|
||||||
|
fi
|
||||||
|
+LIBS=$save_LIBS
|
||||||
|
+LEXLIB=
|
||||||
|
|
||||||
|
ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN"
|
||||||
|
|
||||||
|
--- a/gas/configure.ac
|
||||||
|
+++ b/gas/configure.ac
|
||||||
|
@@ -958,7 +958,10 @@
|
||||||
|
AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}", [Target OS.])
|
||||||
|
|
||||||
|
AC_PROG_YACC
|
||||||
|
+save_LIBS=$LIBS
|
||||||
|
AM_PROG_LEX
|
||||||
|
+LIBS=$save_LIBS
|
||||||
|
+LEXLIB=
|
||||||
|
|
||||||
|
ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN"
|
||||||
|
ZW_GNU_GETTEXT_SISTER_DIR
|
||||||
|
--- a/ld/configure
|
||||||
|
+++ b/ld/configure
|
||||||
|
@@ -18485,6 +18485,7 @@
|
||||||
|
done
|
||||||
|
test -n "$YACC" || YACC="yacc"
|
||||||
|
|
||||||
|
+save_LIBS=$LIBS
|
||||||
|
for ac_prog in flex lex
|
||||||
|
do
|
||||||
|
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||||
|
@@ -18648,6 +18649,8 @@
|
||||||
|
if test "$LEX" = :; then
|
||||||
|
LEX=${am_missing_run}flex
|
||||||
|
fi
|
||||||
|
+LIBS=$save_LIBS
|
||||||
|
+LEXLIB=
|
||||||
|
|
||||||
|
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
|
||||||
|
--- a/ld/configure.ac
|
||||||
|
+++ b/ld/configure.ac
|
||||||
|
@@ -384,7 +384,10 @@
|
||||||
|
AC_EXEEXT
|
||||||
|
|
||||||
|
AC_PROG_YACC
|
||||||
|
+save_LIBS=$LIBS
|
||||||
|
AM_PROG_LEX
|
||||||
|
+LIBS=$save_LIBS
|
||||||
|
+LEXLIB=
|
||||||
|
|
||||||
|
AM_MAINTAINER_MODE
|
||||||
|
AM_CONDITIONAL(GENINSRC_NEVER, false)
|
20
packages/binutils/2.43.1/0004-Darwin-gold-binary-cc-include-string-not-cstring.patch
vendored
Normal file
20
packages/binutils/2.43.1/0004-Darwin-gold-binary-cc-include-string-not-cstring.patch
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
From 3ca444220a6ef0f39dc975202b351dc8e7bc988c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chris Packham <judge.packham@gmail.com>
|
||||||
|
Date: Mon, 8 Aug 2022 20:37:47 +1200
|
||||||
|
Subject: [PATCH 4/8] Darwin gold binary cc include string not cstring
|
||||||
|
|
||||||
|
---
|
||||||
|
gold/binary.cc | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
--- a/gold/binary.cc
|
||||||
|
+++ b/gold/binary.cc
|
||||||
|
@@ -23,7 +23,7 @@
|
||||||
|
#include "gold.h"
|
||||||
|
|
||||||
|
#include <cerrno>
|
||||||
|
-#include <cstring>
|
||||||
|
+#include <string>
|
||||||
|
|
||||||
|
#include "elfcpp.h"
|
||||||
|
#include "stringpool.h"
|
70
packages/binutils/2.43.1/0005-Fix-darwin-build.patch
vendored
Normal file
70
packages/binutils/2.43.1/0005-Fix-darwin-build.patch
vendored
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
From caeb8d1403fa6ce3334ac8527bc89d3103b3c604 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andrew Hsieh <andrewhsieh@google.com>
|
||||||
|
Date: Wed, 18 Mar 2015 10:57:24 +0800
|
||||||
|
Subject: [PATCH 5/8] Fix darwin build
|
||||||
|
|
||||||
|
1. In Drawin PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and the GCC < 4.4
|
||||||
|
doesn't support ended initializer list
|
||||||
|
2. wcsncasecmp doesn't exist in MacSDK10.6.x
|
||||||
|
|
||||||
|
Change-Id: I69204a72f853f5263dffedc448379d75ed4eca2e
|
||||||
|
---
|
||||||
|
bfd/peXXigen.c | 22 ++++++++++++++++++++++
|
||||||
|
gold/gold-threads.cc | 15 ++++++++++++---
|
||||||
|
2 files changed, 34 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
--- a/bfd/peXXigen.c
|
||||||
|
+++ b/bfd/peXXigen.c
|
||||||
|
@@ -3680,6 +3680,28 @@
|
||||||
|
}
|
||||||
|
#endif /* not Cygwin/Mingw */
|
||||||
|
|
||||||
|
+#if defined __APPLE__ && __DARWIN_C_LEVEL < 200809L
|
||||||
|
+/* wcsncasecmp isn't always defined in Mac SDK */
|
||||||
|
+static int
|
||||||
|
+wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n)
|
||||||
|
+{
|
||||||
|
+ wchar_t c1, c2;
|
||||||
|
+
|
||||||
|
+ if (n == 0)
|
||||||
|
+ return (0);
|
||||||
|
+ for (; *s1; s1++, s2++)
|
||||||
|
+ {
|
||||||
|
+ c1 = towlower(*s1);
|
||||||
|
+ c2 = towlower(*s2);
|
||||||
|
+ if (c1 != c2)
|
||||||
|
+ return ((int)c1 - c2);
|
||||||
|
+ if (--n == 0)
|
||||||
|
+ return (0);
|
||||||
|
+ }
|
||||||
|
+ return (-*s2);
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/* Perform a comparison of two entries. */
|
||||||
|
static signed int
|
||||||
|
rsrc_cmp (bool is_name, rsrc_entry * a, rsrc_entry * b)
|
||||||
|
--- a/gold/gold-threads.cc
|
||||||
|
+++ b/gold/gold-threads.cc
|
||||||
|
@@ -284,9 +284,18 @@
|
||||||
|
class Once_initialize
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
- Once_initialize()
|
||||||
|
- : once_(PTHREAD_ONCE_INIT)
|
||||||
|
- { }
|
||||||
|
+ Once_initialize()
|
||||||
|
+#if !defined(__APPLE__)
|
||||||
|
+ : once_(PTHREAD_ONCE_INIT)
|
||||||
|
+ { }
|
||||||
|
+#else
|
||||||
|
+// In Drawin PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and the GCC < 4.4 doesn't support
|
||||||
|
+// extended initializer list as above */
|
||||||
|
+ {
|
||||||
|
+ pthread_once_t once_2 = PTHREAD_ONCE_INIT;
|
||||||
|
+ once_ = once_2;
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
// Return a pointer to the pthread_once_t variable.
|
||||||
|
pthread_once_t*
|
45
packages/binutils/2.43.1/0006-sysroot.patch
vendored
Normal file
45
packages/binutils/2.43.1/0006-sysroot.patch
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
From 880742786662b8adc996cc639d123d1884559344 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Sven Rebhan <odinshorse@googlemail.com>
|
||||||
|
Date: Mon, 8 Aug 2022 20:46:29 +1200
|
||||||
|
Subject: [PATCH 6/8] sysroot
|
||||||
|
|
||||||
|
Always try to prepend the sysroot prefix to absolute filenames first.
|
||||||
|
|
||||||
|
http://bugs.gentoo.org/275666
|
||||||
|
http://sourceware.org/bugzilla/show_bug.cgi?id=10340
|
||||||
|
|
||||||
|
Signed-off-by: Sven Rebhan <odinshorse@googlemail.com>
|
||||||
|
---
|
||||||
|
ld/ldfile.c | 11 +++++++++--
|
||||||
|
1 file changed, 9 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
--- a/ld/ldfile.c
|
||||||
|
+++ b/ld/ldfile.c
|
||||||
|
@@ -572,18 +572,25 @@
|
||||||
|
directory first. */
|
||||||
|
if (!entry->flags.maybe_archive)
|
||||||
|
{
|
||||||
|
- if (entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename))
|
||||||
|
+ /* For absolute pathnames, try to always open the file in the
|
||||||
|
+ sysroot first. If this fails, try to open the file at the
|
||||||
|
+ given location. */
|
||||||
|
+ entry->flags.sysrooted = is_sysrooted_pathname (entry->filename);
|
||||||
|
+ if (!entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename)
|
||||||
|
+ && ld_sysroot)
|
||||||
|
{
|
||||||
|
char *name = concat (ld_sysroot, entry->filename,
|
||||||
|
(const char *) NULL);
|
||||||
|
if (ldfile_try_open_bfd (name, entry))
|
||||||
|
{
|
||||||
|
entry->filename = name;
|
||||||
|
+ entry->flags.sysrooted = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
free (name);
|
||||||
|
}
|
||||||
|
- else if (ldfile_try_open_bfd (entry->filename, entry))
|
||||||
|
+
|
||||||
|
+ if (ldfile_try_open_bfd (entry->filename, entry))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (IS_ABSOLUTE_PATH (entry->filename))
|
282
packages/binutils/2.43.1/0007-poison-system-directories.patch
vendored
Normal file
282
packages/binutils/2.43.1/0007-poison-system-directories.patch
vendored
Normal file
@ -0,0 +1,282 @@
|
|||||||
|
From 35d98249aecc005e426df0fba31e68af7370d7d7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Scott Garman <scott.a.garman@intel.com>
|
||||||
|
Date: Mon, 8 Aug 2022 20:48:32 +1200
|
||||||
|
Subject: [PATCH 7/8] poison system directories
|
||||||
|
|
||||||
|
Patch adapted to binutils 2.23.2 and extended to use
|
||||||
|
BR_COMPILER_PARANOID_UNSAFE_PATH by Thomas Petazzoni.
|
||||||
|
|
||||||
|
[Gustavo: adapt to binutils 2.25]
|
||||||
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||||
|
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
||||||
|
|
||||||
|
Upstream-Status: Inappropriate [distribution: codesourcery]
|
||||||
|
|
||||||
|
Patch originally created by Mark Hatle, forward-ported to
|
||||||
|
binutils 2.21 by Scott Garman.
|
||||||
|
|
||||||
|
purpose: warn for uses of system directories when cross linking
|
||||||
|
|
||||||
|
Code Merged from Sourcery G++ binutils 2.19 - 4.4-277
|
||||||
|
|
||||||
|
2008-07-02 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
ld/
|
||||||
|
* ld.h (args_type): Add error_poison_system_directories.
|
||||||
|
* ld.texinfo (--error-poison-system-directories): Document.
|
||||||
|
* ldfile.c (ldfile_add_library_path): Check
|
||||||
|
command_line.error_poison_system_directories.
|
||||||
|
* ldmain.c (main): Initialize
|
||||||
|
command_line.error_poison_system_directories.
|
||||||
|
* lexsup.c (enum option_values): Add
|
||||||
|
OPTION_ERROR_POISON_SYSTEM_DIRECTORIES.
|
||||||
|
(ld_options): Add --error-poison-system-directories.
|
||||||
|
(parse_args): Handle new option.
|
||||||
|
|
||||||
|
2007-06-13 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
ld/
|
||||||
|
* config.in: Regenerate.
|
||||||
|
* ld.h (args_type): Add poison_system_directories.
|
||||||
|
* ld.texinfo (--no-poison-system-directories): Document.
|
||||||
|
* ldfile.c (ldfile_add_library_path): Check
|
||||||
|
command_line.poison_system_directories.
|
||||||
|
* ldmain.c (main): Initialize
|
||||||
|
command_line.poison_system_directories.
|
||||||
|
* lexsup.c (enum option_values): Add
|
||||||
|
OPTION_NO_POISON_SYSTEM_DIRECTORIES.
|
||||||
|
(ld_options): Add --no-poison-system-directories.
|
||||||
|
(parse_args): Handle new option.
|
||||||
|
|
||||||
|
2007-04-20 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
Merge from Sourcery G++ binutils 2.17:
|
||||||
|
|
||||||
|
2007-03-20 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
Based on patch by Mark Hatle <mark.hatle@windriver.com>.
|
||||||
|
ld/
|
||||||
|
* configure.ac (--enable-poison-system-directories): New option.
|
||||||
|
* configure, config.in: Regenerate.
|
||||||
|
* ldfile.c (ldfile_add_library_path): If
|
||||||
|
ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib,
|
||||||
|
/usr/lib, /usr/local/lib or /usr/X11R6/lib.
|
||||||
|
|
||||||
|
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
|
||||||
|
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
|
||||||
|
---
|
||||||
|
ld/config.in | 3 +++
|
||||||
|
ld/configure | 14 ++++++++++++++
|
||||||
|
ld/configure.ac | 10 ++++++++++
|
||||||
|
ld/ld.h | 8 ++++++++
|
||||||
|
ld/ld.texi | 12 ++++++++++++
|
||||||
|
ld/ldfile.c | 16 ++++++++++++++++
|
||||||
|
ld/ldlex.h | 2 ++
|
||||||
|
ld/ldmain.c | 2 ++
|
||||||
|
ld/lexsup.c | 21 +++++++++++++++++++++
|
||||||
|
9 files changed, 88 insertions(+)
|
||||||
|
|
||||||
|
--- a/ld/config.in
|
||||||
|
+++ b/ld/config.in
|
||||||
|
@@ -74,6 +74,9 @@
|
||||||
|
language is requested. */
|
||||||
|
#undef ENABLE_NLS
|
||||||
|
|
||||||
|
+/* Define to warn for use of native system library directories */
|
||||||
|
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
|
||||||
|
+
|
||||||
|
/* Additional extension a shared object might have. */
|
||||||
|
#undef EXTRA_SHLIB_EXTENSION
|
||||||
|
|
||||||
|
--- a/ld/configure
|
||||||
|
+++ b/ld/configure
|
||||||
|
@@ -844,6 +844,7 @@
|
||||||
|
enable_targets
|
||||||
|
enable_64_bit_bfd
|
||||||
|
with_sysroot
|
||||||
|
+enable_poison_system_directories
|
||||||
|
enable_gold
|
||||||
|
enable_got
|
||||||
|
enable_compressed_debug_sections
|
||||||
|
@@ -1535,6 +1536,8 @@
|
||||||
|
--enable-checking enable run-time checks
|
||||||
|
--enable-targets alternative target configurations
|
||||||
|
--enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)
|
||||||
|
+ --enable-poison-system-directories
|
||||||
|
+ warn for use of native system library directories
|
||||||
|
--enable-gold[=ARG] build gold [ARG={default,yes,no}]
|
||||||
|
--enable-got=<type> GOT handling scheme (target, single, negative,
|
||||||
|
multigot)
|
||||||
|
@@ -15587,7 +15590,18 @@
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
+# Check whether --enable-poison-system-directories was given.
|
||||||
|
+if test "${enable_poison_system_directories+set}" = set; then :
|
||||||
|
+ enableval=$enable_poison_system_directories;
|
||||||
|
+else
|
||||||
|
+ enable_poison_system_directories=no
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+if test "x${enable_poison_system_directories}" = "xyes"; then
|
||||||
|
|
||||||
|
+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
|
||||||
|
+
|
||||||
|
+fi
|
||||||
|
|
||||||
|
# Check whether --enable-got was given.
|
||||||
|
if test "${enable_got+set}" = set; then :
|
||||||
|
--- a/ld/configure.ac
|
||||||
|
+++ b/ld/configure.ac
|
||||||
|
@@ -102,6 +102,16 @@
|
||||||
|
AC_SUBST(TARGET_SYSTEM_ROOT)
|
||||||
|
AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
|
||||||
|
|
||||||
|
+AC_ARG_ENABLE([poison-system-directories],
|
||||||
|
+ AS_HELP_STRING([--enable-poison-system-directories],
|
||||||
|
+ [warn for use of native system library directories]),,
|
||||||
|
+ [enable_poison_system_directories=no])
|
||||||
|
+if test "x${enable_poison_system_directories}" = "xyes"; then
|
||||||
|
+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
|
||||||
|
+ [1],
|
||||||
|
+ [Define to warn for use of native system library directories])
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
dnl Use --enable-gold to decide if this linker should be the default.
|
||||||
|
dnl "install_as_default" is set to false if gold is the default linker.
|
||||||
|
dnl "installed_linker" is the installed BFD linker name.
|
||||||
|
--- a/ld/ld.h
|
||||||
|
+++ b/ld/ld.h
|
||||||
|
@@ -161,6 +161,14 @@
|
||||||
|
/* If set, display the target memory usage (per memory region). */
|
||||||
|
bool print_memory_usage;
|
||||||
|
|
||||||
|
+ /* If TRUE (the default) warn for uses of system directories when
|
||||||
|
+ cross linking. */
|
||||||
|
+ bool poison_system_directories;
|
||||||
|
+
|
||||||
|
+ /* If TRUE (default FALSE) give an error for uses of system
|
||||||
|
+ directories when cross linking instead of a warning. */
|
||||||
|
+ bool error_poison_system_directories;
|
||||||
|
+
|
||||||
|
/* Should we force section groups to be resolved? Controlled with
|
||||||
|
--force-group-allocation on the command line or FORCE_GROUP_ALLOCATION
|
||||||
|
in the linker script. */
|
||||||
|
--- a/ld/ld.texi
|
||||||
|
+++ b/ld/ld.texi
|
||||||
|
@@ -3245,6 +3245,18 @@
|
||||||
|
occurrence of the --package-metadata option.
|
||||||
|
If the linker has been built with libjansson, then the JSON string
|
||||||
|
will be validated.
|
||||||
|
+
|
||||||
|
+@kindex --no-poison-system-directories
|
||||||
|
+@item --no-poison-system-directories
|
||||||
|
+Do not warn for @option{-L} options using system directories such as
|
||||||
|
+@file{/usr/lib} when cross linking. This option is intended for use
|
||||||
|
+in chroot environments when such directories contain the correct
|
||||||
|
+libraries for the target system rather than the host.
|
||||||
|
+
|
||||||
|
+@kindex --error-poison-system-directories
|
||||||
|
+@item --error-poison-system-directories
|
||||||
|
+Give an error instead of a warning for @option{-L} options using
|
||||||
|
+system directories when cross linking.
|
||||||
|
@end table
|
||||||
|
|
||||||
|
@c man end
|
||||||
|
--- a/ld/ldfile.c
|
||||||
|
+++ b/ld/ldfile.c
|
||||||
|
@@ -327,6 +327,22 @@
|
||||||
|
else
|
||||||
|
new_dirs->name = xstrdup (name);
|
||||||
|
|
||||||
|
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
|
||||||
|
+ if (command_line.poison_system_directories
|
||||||
|
+ && ((!strncmp (name, "/lib", 4))
|
||||||
|
+ || (!strncmp (name, "/usr/lib", 8))
|
||||||
|
+ || (!strncmp (name, "/usr/local/lib", 14))
|
||||||
|
+ || (!strncmp (name, "/usr/X11R6/lib", 14))))
|
||||||
|
+ {
|
||||||
|
+ if (command_line.error_poison_system_directories)
|
||||||
|
+ einfo (_("%X%P: error: library search path \"%s\" is unsafe for "
|
||||||
|
+ "cross-compilation\n"), name);
|
||||||
|
+ else
|
||||||
|
+ einfo (_("%P: warning: library search path \"%s\" is unsafe for "
|
||||||
|
+ "cross-compilation\n"), name);
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/* Accumulate script and command line sourced
|
||||||
|
search paths at the end of the current list. */
|
||||||
|
#if BFD_SUPPORTS_PLUGINS
|
||||||
|
--- a/ld/ldlex.h
|
||||||
|
+++ b/ld/ldlex.h
|
||||||
|
@@ -471,6 +471,8 @@
|
||||||
|
OPTION_NO_LITERAL_MOVEMENT,
|
||||||
|
OPTION_ABI_WINDOWED,
|
||||||
|
OPTION_ABI_CALL0,
|
||||||
|
+ OPTION_NO_POISON_SYSTEM_DIRECTORIES,
|
||||||
|
+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* The initial parser states. */
|
||||||
|
--- a/ld/ldmain.c
|
||||||
|
+++ b/ld/ldmain.c
|
||||||
|
@@ -347,6 +347,8 @@
|
||||||
|
command_line.warn_mismatch = true;
|
||||||
|
command_line.warn_search_mismatch = true;
|
||||||
|
command_line.check_section_addresses = -1;
|
||||||
|
+ command_line.poison_system_directories = true;
|
||||||
|
+ command_line.error_poison_system_directories = true;
|
||||||
|
|
||||||
|
/* We initialize DEMANGLING based on the environment variable
|
||||||
|
COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
|
||||||
|
--- a/ld/lexsup.c
|
||||||
|
+++ b/ld/lexsup.c
|
||||||
|
@@ -648,6 +648,14 @@
|
||||||
|
" <method> is: share-unconflicted (default),\n"
|
||||||
|
" share-duplicated"),
|
||||||
|
TWO_DASHES },
|
||||||
|
+ { {"no-poison-system-directories", no_argument, NULL,
|
||||||
|
+ OPTION_NO_POISON_SYSTEM_DIRECTORIES},
|
||||||
|
+ '\0', NULL, N_("Do not warn for -L options using system directories"),
|
||||||
|
+ TWO_DASHES },
|
||||||
|
+ { {"error-poison-system-directories", no_argument, NULL,
|
||||||
|
+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES},
|
||||||
|
+ '\0', NULL, N_("Give an error for -L options using system directories"),
|
||||||
|
+ TWO_DASHES },
|
||||||
|
};
|
||||||
|
|
||||||
|
#define OPTION_COUNT ARRAY_SIZE (ld_options)
|
||||||
|
@@ -660,6 +668,7 @@
|
||||||
|
int ingroup = 0;
|
||||||
|
char *default_dirlist = NULL;
|
||||||
|
char *shortopts;
|
||||||
|
+ char *BR_paranoid_env;
|
||||||
|
struct option *longopts;
|
||||||
|
struct option *really_longopts;
|
||||||
|
int last_optind;
|
||||||
|
@@ -1785,6 +1794,14 @@
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
+ case OPTION_NO_POISON_SYSTEM_DIRECTORIES:
|
||||||
|
+ command_line.poison_system_directories = false;
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
+ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
|
||||||
|
+ command_line.error_poison_system_directories = true;
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
case OPTION_PUSH_STATE:
|
||||||
|
input_flags.pushed = xmemdup (&input_flags,
|
||||||
|
sizeof (input_flags),
|
||||||
|
@@ -1938,6 +1955,10 @@
|
||||||
|
command_line.soname = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ BR_paranoid_env = getenv("BR_COMPILER_PARANOID_UNSAFE_PATH");
|
||||||
|
+ if (BR_paranoid_env && strlen(BR_paranoid_env) > 0)
|
||||||
|
+ command_line.error_poison_system_directories = true;
|
||||||
|
+
|
||||||
|
while (ingroup)
|
||||||
|
{
|
||||||
|
einfo (_("%P: missing --end-group; added as last command line option\n"));
|
35
packages/binutils/2.43.1/0008-gold-Deal-with-absence-of-uchar-on-macOS.patch
vendored
Normal file
35
packages/binutils/2.43.1/0008-gold-Deal-with-absence-of-uchar-on-macOS.patch
vendored
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
From 5e16cd42ed6c0b626ee47601396517ddb8a6065f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Bryan Hundven <bryanhundven@gmail.com>
|
||||||
|
Date: Tue, 6 Feb 2024 16:34:38 +1300
|
||||||
|
Subject: [PATCH 8/8] gold: Deal with absence of <uchar> on macOS
|
||||||
|
|
||||||
|
Add code to provide fallback definitions of char16_t/char32_t on macOS.
|
||||||
|
---
|
||||||
|
gold/output.cc | 2 ++
|
||||||
|
gold/stringpool.cc | 2 ++
|
||||||
|
2 files changed, 4 insertions(+)
|
||||||
|
|
||||||
|
--- a/gold/output.cc
|
||||||
|
+++ b/gold/output.cc
|
||||||
|
@@ -29,7 +29,9 @@
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <algorithm>
|
||||||
|
+#if !defined(__APPLE__)
|
||||||
|
#include <uchar.h>
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_MMAN_H
|
||||||
|
#include <sys/mman.h>
|
||||||
|
--- a/gold/stringpool.cc
|
||||||
|
+++ b/gold/stringpool.cc
|
||||||
|
@@ -25,7 +25,9 @@
|
||||||
|
#include <cstring>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <vector>
|
||||||
|
+#if !defined(__APPLE__)
|
||||||
|
#include <uchar.h>
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#include "output.h"
|
||||||
|
#include "parameters.h"
|
12
packages/binutils/2.43.1/chksum
vendored
Normal file
12
packages/binutils/2.43.1/chksum
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
md5 binutils-2.43.1.tar.xz 9202d02925c30969d1917e4bad5a2320
|
||||||
|
sha1 binutils-2.43.1.tar.xz 86bfee61d18cb9ea84ca700ecb820d97bb4e92a7
|
||||||
|
sha256 binutils-2.43.1.tar.xz 13f74202a3c4c51118b797a39ea4200d3f6cfbe224da6d1d95bb938480132dfd
|
||||||
|
sha512 binutils-2.43.1.tar.xz 20977ad17729141a2c26d358628f44a0944b84dcfefdec2ba029c2d02f40dfc41cc91c0631044560d2bd6f9a51e1f15846b4b311befbe14f1239f14ff7d57824
|
||||||
|
md5 binutils-2.43.1.tar.bz2 5bae850dcd705c63bf17482b245a3e05
|
||||||
|
sha1 binutils-2.43.1.tar.bz2 e03fc19462023726509b3e3db1e9314061e8bcd9
|
||||||
|
sha256 binutils-2.43.1.tar.bz2 becaac5d295e037587b63a42fad57fe3d9d7b83f478eb24b67f9eec5d0f1872f
|
||||||
|
sha512 binutils-2.43.1.tar.bz2 f35423742bca1787250d211c060e2ff728820707224637d1d36bbfc293129269805ff3c1a46defd8ff2459ba7ad8114f216325476460b4725ed2ed41fe382521
|
||||||
|
md5 binutils-2.43.1.tar.gz 82dba8355b5848449c672804bfd21ac3
|
||||||
|
sha1 binutils-2.43.1.tar.gz e31a3af53988aa8ae275a598fbad10092764038b
|
||||||
|
sha256 binutils-2.43.1.tar.gz e4c38b893f590853fbe276a6b8a1268101e35e61849a07f6ee97b5ecc97fbff8
|
||||||
|
sha512 binutils-2.43.1.tar.gz 678386dd9797c90f18c29a59d0f1d99292b494ee63c5e41bcf8b28025ad34a69498ff3806f262b1a83538b95b9bc12f6eafac5209a98a6e581037925b29a0eb3
|
0
packages/binutils/2.43.1/version.desc
vendored
Normal file
0
packages/binutils/2.43.1/version.desc
vendored
Normal file
Loading…
Reference in New Issue
Block a user