summaryrefslogtreecommitdiff
path: root/devel/binutils
diff options
context:
space:
mode:
authormarino <marino@pkgsrc.org>2014-05-12 16:33:20 +0000
committermarino <marino@pkgsrc.org>2014-05-12 16:33:20 +0000
commitec1c4d1e4a5770d8c9c7e20e217456ae4e077f97 (patch)
tree8e778972b6aa33618211cd7ac60a70661385be64 /devel/binutils
parentbde272227a44598982bd42f88fb6c3085b156f09 (diff)
downloadpkgsrc-ec1c4d1e4a5770d8c9c7e20e217456ae4e077f97.tar.gz
devel/binutils: Change default behavior of gold for NetBSD & OpenBSD
The Gold linker defaults to the use of --new-dtags which uses DT_RUNPATH instead of DT_RPATH. In previous version of binutils, --new-dtags would write set both DT_RUNPATH and DT_PATH, but not anymore. The problem is that neither NetBSD nor OpenBSD runtime linkers properly handle it AFAICT. Use macros to make DT_RPATH get set when -rpath switch is used so that linked libraries can get found on these platforms. Similarly, it appears that DT_INIT_ARRAY tags are also not handled by rtld, so don't use these tags by default otherwise C++ will not link on these platforms. The copy-as-needed attribute has been left at its binutils default of --no-copy-dt-needed. This has been the default since binutils 2.22.
Diffstat (limited to 'devel/binutils')
-rw-r--r--devel/binutils/Makefile4
-rw-r--r--devel/binutils/distinfo3
-rw-r--r--devel/binutils/patches/patch-gold_options.h36
3 files changed, 40 insertions, 3 deletions
diff --git a/devel/binutils/Makefile b/devel/binutils/Makefile
index 64204b724c1..112bd6d849c 100644
--- a/devel/binutils/Makefile
+++ b/devel/binutils/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.59 2014/05/12 13:17:01 jperkin Exp $
+# $NetBSD: Makefile,v 1.60 2014/05/12 16:33:20 marino Exp $
DISTNAME= binutils-2.24
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GNU:=binutils/}
diff --git a/devel/binutils/distinfo b/devel/binutils/distinfo
index 7d8b8a0dd72..96d0404dead 100644
--- a/devel/binutils/distinfo
+++ b/devel/binutils/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.17 2014/05/12 13:17:01 jperkin Exp $
+$NetBSD: distinfo,v 1.18 2014/05/12 16:33:20 marino Exp $
SHA1 (binutils-2.24.tar.bz2) = 7ac75404ddb3c4910c7594b51ddfc76d4693debb
RMD160 (binutils-2.24.tar.bz2) = b4aa3ea5ba9d0d9f817b2cf136e7f911f692af8d
@@ -8,6 +8,7 @@ SHA1 (patch-bfd_cache.c) = 5f98b965514286c8110516dd665924709708e78c
SHA1 (patch-configure.ac) = 7bd7b90e57d850705286f2cc6464ecc45e0657c0
SHA1 (patch-gas_config_tc-i386.c) = 16b04ee6c3c46db375c883b4338bf5d796174458
SHA1 (patch-gold_Makefile.in) = e65a81557c49a168e6bbd966e37ce1ad4be34d72
+SHA1 (patch-gold_options.h) = 3a1f9f59a1ce105f8f8d5a09fe60e0fe673b61a9
SHA1 (patch-ld_Makefile.am) = 908d0e0e366d08929d27416a3361e1869abd0076
SHA1 (patch-ld_Makefile.in) = 68eba0b8a12211915a1eb99770011090f5c21ff2
SHA1 (patch-ld_configure.tgt) = 7809d739e9a681c0ebe3d60f30dc759accdff6b9
diff --git a/devel/binutils/patches/patch-gold_options.h b/devel/binutils/patches/patch-gold_options.h
new file mode 100644
index 00000000000..1d536d89798
--- /dev/null
+++ b/devel/binutils/patches/patch-gold_options.h
@@ -0,0 +1,36 @@
+$NetBSD: patch-gold_options.h,v 1.1 2014/05/12 16:33:20 marino Exp $
+
+ The NetBSD and OpenBSD real-time linkers do not understand DT_RUNPATH
+ or DT_INIT_ARRAY. The current gold defaults are not suitable for them.
+ The last couple of DragonFly and FreeBSD releases do support these tags.
+
+--- gold/options.h.orig 2013-11-04 15:33:39.000000000 +0000
++++ gold/options.h
+@@ -716,9 +716,15 @@ class General_options
+ N_("Output cross reference table"),
+ N_("Do not output cross reference table"));
+
++#if defined(__NetBSD__) || defined(__OpenBSD__)
++ DEFINE_bool(ctors_in_init_array, options::TWO_DASHES, '\0', false,
++ N_("Use DT_INIT_ARRAY for all constructors"),
++ N_("Handle constructors as directed by compiler (default)"));
++#else
+ DEFINE_bool(ctors_in_init_array, options::TWO_DASHES, '\0', true,
+ N_("Use DT_INIT_ARRAY for all constructors (default)"),
+ N_("Handle constructors as directed by compiler"));
++#endif
+
+ DEFINE_bool(define_common, options::TWO_DASHES, 'd', false,
+ N_("Define common symbols"),
+@@ -949,7 +955,11 @@ class General_options
+ N_("Do not page align data, do not make text readonly"),
+ N_("Page align data, make text readonly"));
+
++#if defined(__NetBSD__) || defined(__OpenBSD__)
++ DEFINE_enable(new_dtags, options::EXACTLY_TWO_DASHES, '\0', false,
++#else
+ DEFINE_enable(new_dtags, options::EXACTLY_TWO_DASHES, '\0', true,
++#endif
+ N_("Enable use of DT_RUNPATH and DT_FLAGS"),
+ N_("Disable use of DT_RUNPATH and DT_FLAGS"));
+