Skip to content

Commit

Permalink
binutils: try to work around msvc lib linking regression
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Feb 7, 2023
1 parent 5777893 commit f1a0873
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
13 changes: 13 additions & 0 deletions mingw-w64-binutils/3001-try-fix-compare_section-abort.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/ld/ldlang.c b/ld/ldlang.c
index b66d8c6bc1d..a909c71e771 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -649,7 +649,7 @@ wild_sort (lang_wild_statement_type *wild,
looking at the sections for this file. */

/* Find the correct node to append this section. */
- if (compare_section (sec->spec.sorted, section, (*tree)->section) < 0)
+ if (sec != NULL && sec->spec.sorted != none && sec->spec.sorted != by_none && compare_section (sec->spec.sorted, section, (*tree)->section) < 0)
tree = &((*tree)->left);
else
tree = &((*tree)->right);
10 changes: 8 additions & 2 deletions mingw-w64-binutils/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ _realname=binutils
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=2.40
pkgrel=1
pkgrel=2
pkgdesc="A set of programs to assemble and manipulate binary and object files (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64')
Expand All @@ -26,6 +26,7 @@ source=(https://ftp.gnu.org/gnu/binutils/${_realname}-${pkgver}.tar.bz2{,.sig}
specify-timestamp.patch
libiberty-unlink-handle-windows-nul.patch
bfd-real-fopen-handle-windows-nul.patch
3001-try-fix-compare_section-abort.patch
)
sha256sums=('f8298eb153a4b37d112e945aa5cb2850040bcf26a3ea65b5a715c83afe05e48a'
'SKIP'
Expand All @@ -37,7 +38,8 @@ sha256sums=('f8298eb153a4b37d112e945aa5cb2850040bcf26a3ea65b5a715c83afe05e48a'
'a094660ec95996c00b598429843b7869037732146442af567ada9f539bd40480'
'27696da8ecfff307537a461b205fad44d6abc1fa648fbf839e72a1d3ea71c40a'
'7ccbd418695733c50966068fa9755a6abb156f53af23701d2bc097c63e9e0030'
'dda1cf0c1825283a8b3708d1a4087dd650f4fbc3f8aa571e211cfe3e1458c8f8')
'dda1cf0c1825283a8b3708d1a4087dd650f4fbc3f8aa571e211cfe3e1458c8f8'
'ddfa01ed6ce1c0608bbcd462ced8383b5f9f686c2b49fb510a41637fff2ca019')
validpgpkeys=('EAF1C276A747E9ED86210CBAC3126D3B4AE55E93'
'3A24BC1E8FB409FA9F14371813FCEF89DD9E3C4F')

Expand Down Expand Up @@ -81,6 +83,10 @@ prepare() {

# https://sourceware.org/bugzilla/show_bug.cgi?id=29947
patch -p1 -i "${srcdir}/bfd-real-fopen-handle-windows-nul.patch"

# https://sourceware.org/bugzilla/show_bug.cgi?id=30079#c2
# XXX: Update to upstream fix once there is one
patch -p1 -i "${srcdir}/3001-try-fix-compare_section-abort.patch"
}

build() {
Expand Down

0 comments on commit f1a0873

Please sign in to comment.