diff options
author | Michel Zou | 2018-04-25 18:33:27 +0200 |
---|---|---|
committer | Michel Zou | 2018-04-25 18:33:27 +0200 |
commit | 3113b445e5b4d02c694e22aa98a2d39eb52778cf (patch) | |
tree | 5d9c46d2b18f537d2bcc55582d70b9716ffdc27f | |
parent | faa8eb5dfabcbe6072be5fcb82a79c9c386e9f88 (diff) | |
download | aur-3113b445e5b4d02c694e22aa98a2d39eb52778cf.tar.gz |
2.30
-rw-r--r-- | .SRCINFO | 12 | ||||
-rw-r--r-- | 0200-remove-provide-qualifiers.patch | 146 | ||||
-rw-r--r-- | PKGBUILD | 12 |
3 files changed, 161 insertions, 9 deletions
@@ -1,8 +1,8 @@ # Generated by mksrcinfo v8 -# Tue Apr 17 07:53:39 UTC 2018 +# Wed Apr 25 16:33:27 UTC 2018 pkgbase = mingw-w64-binutils pkgdesc = Cross binutils for the MinGW-w64 cross-compiler - pkgver = 2.29.1 + pkgver = 2.30 pkgrel = 1 url = http://www.gnu.org/software/binutils arch = x86_64 @@ -12,10 +12,12 @@ pkgbase = mingw-w64-binutils depends = zlib options = !libtool options = !emptydirs - source = https://ftp.gnu.org/gnu/binutils/binutils-2.29.1.tar.gz - source = https://ftp.gnu.org/gnu/binutils/binutils-2.29.1.tar.gz.sig - sha256sums = 0d9d2bbf71e17903f26a676e7fba7c200e581c84b8f2f43e72d875d0e638771c + source = https://ftp.gnu.org/gnu/binutils/binutils-2.30.tar.gz + source = https://ftp.gnu.org/gnu/binutils/binutils-2.30.tar.gz.sig + source = 0200-remove-provide-qualifiers.patch + sha256sums = 8c3850195d1c093d290a716e20ebcaa72eda32abf5e3d8611154b39cff79e9ea sha256sums = SKIP + sha256sums = 40f124febb3ee60239988127cf16d6a4d1bd41b156db8ec843a6871492fcca28 pkgname = mingw-w64-binutils diff --git a/0200-remove-provide-qualifiers.patch b/0200-remove-provide-qualifiers.patch new file mode 100644 index 000000000000..14c0e28290e2 --- /dev/null +++ b/0200-remove-provide-qualifiers.patch @@ -0,0 +1,146 @@ +From a985e9b9deabd81e16754584f4397a638e9d3f36 Mon Sep 17 00:00:00 2001 +From: Nick Clifton <nickc@redhat.com> +Date: Mon, 5 Feb 2018 09:12:42 +0000 +Subject: [PATCH] Import patch from mainline to remove PROVODE qualifiers + around definitions of __CTOR_LIST__ and __DTOR_LIST__ in PE linker scripts. + + PR 22762 + * scripttempl/pe.sc: Remove PROVIDE()s from __CTOR_LIST__ and + __DTOR_LIST__ symbols. Add a comment explaining why this is + necessary. + * scripttemp/pep.sc: Likewise. + * ld.texinfo (PROVIDE): Add a note about the effect of common + symbols. +--- + ld/ChangeLog | 14 ++++++++++++++ + ld/ld.texinfo | 6 ++++++ + ld/scripttempl/pe.sc | 24 ++++++++++++++++++++---- + ld/scripttempl/pep.sc | 24 ++++++++++++++++++++---- + 4 files changed, 60 insertions(+), 8 deletions(-) + +diff --git a/ld/ChangeLog b/ld/ChangeLog +index 0f00265..bf129a1 100644 +--- a/ld/ChangeLog ++++ b/ld/ChangeLog +@@ -1,3 +1,17 @@ ++2018-02-05 Nick Clifton <nickc@redhat.com> ++ ++ Import from mainline: ++ ++ 2018-02-03 Nick Clifton <nickc@redhat.com> ++ ++ PR 22762 ++ * scripttempl/pe.sc: Remove PROVIDE()s from __CTOR_LIST__ and ++ __DTOR_LIST__ symbols. Add a comment explaining why this is ++ necessary. ++ * scripttemp/pep.sc: Likewise. ++ * ld.texinfo (PROVIDE): Add a note about the effect of common ++ symbols. ++ + 2018-01-27 Nick Clifton <nickc@redhat.com> + + Back to development. +diff --git a/ld/ld.texinfo b/ld/ld.texinfo +index c89915f..764c401 100644 +--- a/ld/ld.texinfo ++++ b/ld/ld.texinfo +@@ -4001,6 +4001,12 @@ underscore), the linker will silently use the definition in the program. + If the program references @samp{etext} but does not define it, the + linker will use the definition in the linker script. + ++Note - the @code{PROVIDE} directive considers a common symbol to be ++defined, even though such a symbol could be combined with the symbol ++that the @code{PROVIDE} would create. This is particularly important ++when considering constructor and destructor list symbols such as ++@samp{__CTOR_LIST__} as these are often defined as common symbols. ++ + @node PROVIDE_HIDDEN + @subsection PROVIDE_HIDDEN + @cindex PROVIDE_HIDDEN +diff --git a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc +index c8a45ca..f56d783 100644 +--- a/ld/scripttempl/pe.sc ++++ b/ld/scripttempl/pe.sc +@@ -98,8 +98,22 @@ SECTIONS + ${RELOCATING+*(.glue_7t)} + ${RELOCATING+*(.glue_7)} + ${CONSTRUCTING+ +- PROVIDE(___CTOR_LIST__ = .); +- PROVIDE(__CTOR_LIST__ = .); ++ /* Note: we always define __CTOR_LIST__ and ___CTOR_LIST__ here, ++ we do not PROVIDE them. This is because the ctors.o startup ++ code in libgcc defines them as common symbols, with the ++ expectation that they will be overridden by the definitions ++ here. If we PROVIDE the symbols then they will not be ++ overridden and global constructors will not be run. ++ ++ This does mean that it is not possible for a user to define ++ their own __CTOR_LIST__ and __DTOR_LIST__ symbols. If that ++ ability is needed a custom linker script will have to be ++ used. (The custom script can just be a copy of this script ++ with the PROVIDE() qualifiers added). ++ ++ See PR 22762 for more details. */ ++ ___CTOR_LIST__ = .; ++ __CTOR_LIST__ = .; + LONG (-1); + KEEP(*(.ctors)); + KEEP(*(.ctor)); +@@ -107,8 +121,10 @@ SECTIONS + LONG (0); + } + ${CONSTRUCTING+ +- PROVIDE(___DTOR_LIST__ = .); +- PROVIDE(__DTOR_LIST__ = .); ++ /* See comment about __CTOR_LIST__ above. The same reasoning ++ applies here too. */ ++ ___DTOR_LIST__ = .; ++ __DTOR_LIST__ = .; + LONG (-1); + KEEP(*(.dtors)); + KEEP(*(.dtor)); +diff --git a/ld/scripttempl/pep.sc b/ld/scripttempl/pep.sc +index 8daacb2..3c6c84d 100644 +--- a/ld/scripttempl/pep.sc ++++ b/ld/scripttempl/pep.sc +@@ -99,8 +99,22 @@ SECTIONS + ${RELOCATING+*(.glue_7)} + ${CONSTRUCTING+. = ALIGN(8);} + ${CONSTRUCTING+ +- PROVIDE(___CTOR_LIST__ = .); +- PROVIDE(__CTOR_LIST__ = .); ++ /* Note: we always define __CTOR_LIST__ and ___CTOR_LIST__ here, ++ we do not PROVIDE them. This is because the ctors.o startup ++ code in libgcc defines them as common symbols, with the ++ expectation that they will be overridden by the definitions ++ here. If we PROVIDE the symbols then they will not be ++ overridden and global constructors will not be run. ++ ++ This does mean that it is not possible for a user to define ++ their own __CTOR_LIST__ and __DTOR_LIST__ symbols. If that ++ ability is needed a custom linker script will have to be ++ used. (The custom script can just be a copy of this script ++ with the PROVIDE() qualifiers added). ++ ++ See PR 22762 for more details. */ ++ ___CTOR_LIST__ = .; ++ __CTOR_LIST__ = .; + LONG (-1); LONG (-1); + KEEP (*(.ctors)); + KEEP (*(.ctor)); +@@ -108,8 +122,10 @@ SECTIONS + LONG (0); LONG (0); + } + ${CONSTRUCTING+ +- PROVIDE(___DTOR_LIST__ = .); +- PROVIDE(__DTOR_LIST__ = .); ++ /* See comment about __CTOR_LIST__ above. The same reasoning ++ applies here too. */ ++ ___DTOR_LIST__ = .; ++ __DTOR_LIST__ = .; + LONG (-1); LONG (-1); + KEEP (*(.dtors)); + KEEP (*(.dtor)); +-- +2.9.3 + @@ -4,7 +4,7 @@ _targets="i686-w64-mingw32 x86_64-w64-mingw32" pkgname=mingw-w64-binutils -pkgver=2.29.1 +pkgver=2.30 pkgrel=1 pkgdesc="Cross binutils for the MinGW-w64 cross-compiler" arch=('x86_64') @@ -14,9 +14,10 @@ groups=('mingw-w64-toolchain' 'mingw-w64') depends=('zlib') options=('!libtool' '!emptydirs') validpgpkeys=('3A24BC1E8FB409FA9F14371813FCEF89DD9E3C4F') # Nick Clifton (Chief Binutils Maintainer) <nickc@redhat.com> -source=("https://ftp.gnu.org/gnu/binutils/binutils-${pkgver}.tar.gz"{,.sig}) -sha256sums=('0d9d2bbf71e17903f26a676e7fba7c200e581c84b8f2f43e72d875d0e638771c' - 'SKIP') +source=("https://ftp.gnu.org/gnu/binutils/binutils-${pkgver}.tar.gz"{,.sig} 0200-remove-provide-qualifiers.patch) +sha256sums=('8c3850195d1c093d290a716e20ebcaa72eda32abf5e3d8611154b39cff79e9ea' + 'SKIP' + '40f124febb3ee60239988127cf16d6a4d1bd41b156db8ec843a6871492fcca28') prepare() { cd "$srcdir"/binutils-${pkgver} @@ -24,6 +25,9 @@ prepare() { sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in # hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS" sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure + + # https://sourceware.org/bugzilla/show_bug.cgi?id=22762 + patch -p1 -i "${srcdir}"/0200-remove-provide-qualifiers.patch } build() { |