diff options
author | Chris Packham <judge.packham@gmail.com> | 2024-08-22 13:17:30 +1200 |
---|---|---|
committer | Chris Packham <judge.packham@gmail.com> | 2024-08-30 09:53:47 +1200 |
commit | 8105791c34a4e48433facbac556e7aedb114caed (patch) | |
tree | e7d245858fdc547d4147b6659f06c056e605fe64 /packages/binutils/2.43.1/0005-Fix-darwin-build.patch | |
parent | 146fee59bc52ad123b0f0d243aee8ead4c7af26a (diff) | |
download | crosstool-ng-8105791c34a4e48433facbac556e7aedb114caed.tar.gz crosstool-ng-8105791c34a4e48433facbac556e7aedb114caed.tar.bz2 crosstool-ng-8105791c34a4e48433facbac556e7aedb114caed.zip |
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>
Diffstat (limited to 'packages/binutils/2.43.1/0005-Fix-darwin-build.patch')
-rw-r--r-- | packages/binutils/2.43.1/0005-Fix-darwin-build.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/packages/binutils/2.43.1/0005-Fix-darwin-build.patch b/packages/binutils/2.43.1/0005-Fix-darwin-build.patch new file mode 100644 index 00000000..a48b7478 --- /dev/null +++ b/packages/binutils/2.43.1/0005-Fix-darwin-build.patch @@ -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* |