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: Build gold linker on so...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0fca5122ef4c
branches:  trunk
changeset: 634230:0fca5122ef4c
user:      marino <marino%pkgsrc.org@localhost>
date:      Mon May 12 12:49:59 2014 +0000

description:
devel/binutils: Build gold linker on some platforms

The gold linker isn't a default option on binutils.  Change the Makefile
to make gold build on recent *BSD. Tested on NetBSD 6.1.4 and OpenBSD 5.5.
Gold is known to build on FreeBSD although FreeBSD 10 may need additional
patches.  Gold is part of the system binutils on DragonFly.

diffstat:

 devel/binutils/Makefile                       |  22 ++++++++++++++++++----
 devel/binutils/PLIST.common                   |  13 ++++++++++++-
 devel/binutils/distinfo                       |   3 ++-
 devel/binutils/patches/patch-gold_Makefile.in |  16 ++++++++++++++++
 4 files changed, 48 insertions(+), 6 deletions(-)

diffs (179 lines):

diff -r a80a4bed3dd8 -r 0fca5122ef4c devel/binutils/Makefile
--- a/devel/binutils/Makefile   Mon May 12 12:08:29 2014 +0000
+++ b/devel/binutils/Makefile   Mon May 12 12:49:59 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.57 2014/01/26 03:49:01 ryoon Exp $
+# $NetBSD: Makefile,v 1.58 2014/05/12 12:49:59 marino Exp $
 
 DISTNAME=      binutils-2.24
 CATEGORIES=    devel
@@ -44,20 +44,31 @@
 
 # gprof (XXX: and others?) cannot be built on all platforms
 #
-PLIST_VARS+=   gprof ld
+PLIST_VARS+=   gprof ld gold
 
 .include "../../mk/bsd.prefs.mk"
 
-.if ${OPSYS} != "IRIX"
+.if ${OPSYS} != IRIX
 PLIST.gprof=   yes
 EXTRA_FILES+=  gprof
 .endif
 
-.if ${OPSYS} != "SunOS"
+.if ${OPSYS} != SunOS
 PLIST.ld=      yes
 EXTRA_FILES+=  ld
 .endif
 
+.if ${OPSYS} == DragonFly \
+|| (${OPSYS} == FreeBSD && empty(OS_VERSION:M[12345678].*)) \
+|| (${OPSYS} == OpenBSD && empty(OS_VERSION:M[1234].*)) \
+|| (${OPSYS} == NetBSD && empty(OS_VERSION:M[12345].*))
+BUILD_GOLD=    yes
+PLIST.gold=    yes
+USE_TOOLS+=    bison
+EXTRA_FILES+=  dwp ld.gold
+CONFIGURE_ARGS+=--enable-gold --enable-plugins
+.endif
+
 CFLAGS.OpenBSD+=       -Wno-bounded
 
 .include "../../mk/compiler.mk"
@@ -86,6 +97,9 @@
 .if defined(PLIST.ld)
 SYMLINK_FILES+=        ld
 .endif
+.if defined(BUILD_GOLD)
+SYMLINK_FILES+=        ld.gold dwp
+.endif
 
 post-install:
        cd ${DESTDIR}${PREFIX} &&                                       \
diff -r a80a4bed3dd8 -r 0fca5122ef4c devel/binutils/PLIST.common
--- a/devel/binutils/PLIST.common       Mon May 12 12:08:29 2014 +0000
+++ b/devel/binutils/PLIST.common       Mon May 12 12:49:59 2014 +0000
@@ -1,13 +1,15 @@
-@comment $NetBSD: PLIST.common,v 1.22 2014/01/06 14:58:41 wiz Exp $
+@comment $NetBSD: PLIST.common,v 1.23 2014/05/12 12:49:59 marino Exp $
 ${MACHINE_GNU_PLATFORM}/bin/ar
 ${MACHINE_GNU_PLATFORM}/bin/as
 ${MACHINE_GNU_PLATFORM}/bin/ld
 ${MACHINE_GNU_PLATFORM}/bin/ld.bfd
+${PLIST.gold}${MACHINE_GNU_PLATFORM}/bin/ld.gold
 ${MACHINE_GNU_PLATFORM}/bin/nm
 ${MACHINE_GNU_PLATFORM}/bin/objcopy
 ${MACHINE_GNU_PLATFORM}/bin/objdump
 ${MACHINE_GNU_PLATFORM}/bin/ranlib
 ${MACHINE_GNU_PLATFORM}/bin/strip
+${PLIST.gold}bin/gdwp
 bin/gaddr2line
 bin/gar
 bin/gas
@@ -16,6 +18,7 @@
 bin/gelfedit
 bin/gld
 bin/gld.bfd
+${PLIST.gold}bin/gld.gold
 bin/gnm
 bin/gobjcopy
 bin/gobjdump
@@ -29,10 +32,12 @@
 gnu/bin/ar
 gnu/bin/as
 gnu/bin/c++filt
+${PLIST.gold}gnu/bin/dwp
 ${PLIST.gprof}gnu/bin/gprof
 gnu/bin/elfedit
 ${PLIST.ld}gnu/bin/ld
 gnu/bin/ld.bfd
+${PLIST.gold}gnu/bin/ld.gold
 gnu/bin/nm
 gnu/bin/objcopy
 gnu/bin/objdump
@@ -64,6 +69,7 @@
 include/bfd.h
 include/bfdlink.h
 include/dis-asm.h
+${PLIST.gold}include/plugin-api.h
 include/symcat.h
 info/as.info
 info/bfd.info
@@ -105,12 +111,14 @@
 share/locale/es/LC_MESSAGES/bfd.mo
 share/locale/es/LC_MESSAGES/binutils.mo
 share/locale/es/LC_MESSAGES/gas.mo
+${PLIST.gold}share/locale/es/LC_MESSAGES/gold.mo
 ${PLIST.gprof}share/locale/es/LC_MESSAGES/gprof.mo
 share/locale/es/LC_MESSAGES/ld.mo
 share/locale/es/LC_MESSAGES/opcodes.mo
 share/locale/fi/LC_MESSAGES/bfd.mo
 share/locale/fi/LC_MESSAGES/binutils.mo
 share/locale/fi/LC_MESSAGES/gas.mo
+${PLIST.gold}share/locale/fi/LC_MESSAGES/gold.mo
 ${PLIST.gprof}share/locale/fi/LC_MESSAGES/gprof.mo
 share/locale/fi/LC_MESSAGES/ld.mo
 share/locale/fi/LC_MESSAGES/opcodes.mo
@@ -128,6 +136,7 @@
 share/locale/id/LC_MESSAGES/bfd.mo
 share/locale/id/LC_MESSAGES/binutils.mo
 share/locale/id/LC_MESSAGES/gas.mo
+${PLIST.gold}share/locale/id/LC_MESSAGES/gold.mo
 share/locale/id/LC_MESSAGES/ld.mo
 share/locale/id/LC_MESSAGES/opcodes.mo
 share/locale/it/LC_MESSAGES/binutils.mo
@@ -137,6 +146,7 @@
 share/locale/ja/LC_MESSAGES/bfd.mo
 share/locale/ja/LC_MESSAGES/binutils.mo
 share/locale/ja/LC_MESSAGES/gas.mo
+${PLIST.gold}share/locale/it/LC_MESSAGES/gold.mo
 ${PLIST.gprof}share/locale/ja/LC_MESSAGES/gprof.mo
 share/locale/ja/LC_MESSAGES/ld.mo
 ${PLIST.gprof}share/locale/ms/LC_MESSAGES/gprof.mo
@@ -176,6 +186,7 @@
 share/locale/uk/LC_MESSAGES/opcodes.mo
 share/locale/vi/LC_MESSAGES/bfd.mo
 share/locale/vi/LC_MESSAGES/binutils.mo
+${PLIST.gold}share/locale/vi/LC_MESSAGES/gold.mo
 share/locale/vi/LC_MESSAGES/ld.mo
 share/locale/vi/LC_MESSAGES/opcodes.mo
 share/locale/zh_CN/LC_MESSAGES/bfd.mo
diff -r a80a4bed3dd8 -r 0fca5122ef4c devel/binutils/distinfo
--- a/devel/binutils/distinfo   Mon May 12 12:08:29 2014 +0000
+++ b/devel/binutils/distinfo   Mon May 12 12:49:59 2014 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.15 2014/01/26 03:49:01 ryoon Exp $
+$NetBSD: distinfo,v 1.16 2014/05/12 12:49:59 marino Exp $
 
 SHA1 (binutils-2.24.tar.bz2) = 7ac75404ddb3c4910c7594b51ddfc76d4693debb
 RMD160 (binutils-2.24.tar.bz2) = b4aa3ea5ba9d0d9f817b2cf136e7f911f692af8d
@@ -7,6 +7,7 @@
 SHA1 (patch-bfd_cache.c) = 14848eb2bfafb0eddd3328bded305131dec42488
 SHA1 (patch-configure.ac) = 7bd7b90e57d850705286f2cc6464ecc45e0657c0
 SHA1 (patch-gas_config_tc-i386.c) = 16b04ee6c3c46db375c883b4338bf5d796174458
+SHA1 (patch-gold_Makefile.in) = e65a81557c49a168e6bbd966e37ce1ad4be34d72
 SHA1 (patch-ld_Makefile.am) = 908d0e0e366d08929d27416a3361e1869abd0076
 SHA1 (patch-ld_Makefile.in) = 68eba0b8a12211915a1eb99770011090f5c21ff2
 SHA1 (patch-ld_configure.tgt) = 7809d739e9a681c0ebe3d60f30dc759accdff6b9
diff -r a80a4bed3dd8 -r 0fca5122ef4c devel/binutils/patches/patch-gold_Makefile.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/binutils/patches/patch-gold_Makefile.in     Mon May 12 12:49:59 2014 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-gold_Makefile.in,v 1.1 2014/05/12 12:50:00 marino Exp $
+
+ Only DragonFly had -ldl stubs.  The other BSDs will fail to link libdl
+ so this patch removes the -ldl linker flag.
+
+--- gold/Makefile.in.orig      2014-05-12 12:02:19.000000000 +0000
++++ gold/Makefile.in
+@@ -419,7 +419,7 @@ AM_CPPFLAGS = \
+       -DTOOLLIBDIR="\"$(tooldir)/lib\"" @INCINTL@
+ 
+ LIBIBERTY = ../libiberty/libiberty.a
+-@PLUGINS_TRUE@LIBDL = @DLOPEN_LIBS@
++@PLUGINS_TRUE@LIBDL =
+ @THREADS_TRUE@THREADSLIB = -lpthread
+ AM_YFLAGS = -d
+ 



Home | Main Index | Thread Index | Old Index