pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/binutils devel/binutils: Change default behavior...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f2ec2cfdebb6
branches:  trunk
changeset: 634239:f2ec2cfdebb6
user:      marino <marino%pkgsrc.org@localhost>
date:      Mon May 12 16:33:20 2014 +0000

description:
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:

 devel/binutils/Makefile                     |   4 +-
 devel/binutils/distinfo                     |   3 +-
 devel/binutils/patches/patch-gold_options.h |  36 +++++++++++++++++++++++++++++
 3 files changed, 40 insertions(+), 3 deletions(-)

diffs (70 lines):

diff -r 6b2934e0d6f3 -r f2ec2cfdebb6 devel/binutils/Makefile
--- a/devel/binutils/Makefile   Mon May 12 15:23:48 2014 +0000
+++ b/devel/binutils/Makefile   Mon May 12 16:33:20 2014 +0000
@@ -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 -r 6b2934e0d6f3 -r f2ec2cfdebb6 devel/binutils/distinfo
--- a/devel/binutils/distinfo   Mon May 12 15:23:48 2014 +0000
+++ b/devel/binutils/distinfo   Mon May 12 16:33:20 2014 +0000
@@ -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-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 -r 6b2934e0d6f3 -r f2ec2cfdebb6 devel/binutils/patches/patch-gold_options.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/binutils/patches/patch-gold_options.h       Mon May 12 16:33:20 2014 +0000
@@ -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"));
+ 



Home | Main Index | Thread Index | Old Index