pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/binutils binutils: Improve gas/gld handling and ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c42698f2b3e7
branches:  trunk
changeset: 445801:c42698f2b3e7
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Fri Jan 29 13:10:34 2021 +0000

description:
binutils: Improve gas/gld handling and cleanup.

Add a new "disable-ld" option that disables ld.  This is required on Darwin
where it is not currently built, but is also required for some SunOS setups
where an external GCC is used and we do not want a libgcc dependency on it.

There are now two ld-related PLIST variables, "gld" for the general handling
of whether GNU ld is built or not, and "ld" for the symlinks we create.

In addition Darwin also needs --disable-libctf to avoid a build issue, and an
additional PLIST variable to handle GNU as which is also not built on Darwin.

While here clean up a bunch of variable handling and NetBSD 5/6 workarounds,
and simplify the setup of SYMLINK_FILES.

Fixes build on Darwin, and SunOS when using an external GCC.  Ok fcambus@

diffstat:

 devel/binutils/Makefile     |  61 ++++++++++++---------------
 devel/binutils/PLIST.common |  98 ++++++++++++++++++++++----------------------
 devel/binutils/options.mk   |  24 +++++++++++
 3 files changed, 101 insertions(+), 82 deletions(-)

diffs (truncated from 384 to 300 lines):

diff -r f593dc1afeb6 -r c42698f2b3e7 devel/binutils/Makefile
--- a/devel/binutils/Makefile   Fri Jan 29 12:10:13 2021 +0000
+++ b/devel/binutils/Makefile   Fri Jan 29 13:10:34 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.96 2021/01/27 15:21:21 fcambus Exp $
+# $NetBSD: Makefile,v 1.97 2021/01/29 13:10:34 jperkin Exp $
 
 DISTNAME=      binutils-2.36
 CATEGORIES=    devel
@@ -19,14 +19,6 @@
 USE_LIBTOOL=           yes
 USE_TOOLS+=            gmake
 
-# PR pkg/48504, ksh is sufficient for NetBSD 5.2 and NetBSD 6.1
-.include "../../mk/bsd.prefs.mk"
-.if !empty(MACHINE_PLATFORM:MNetBSD-[5-6].*-*) && \
-       empty(MACHINE_PLATFORM:MNetBSD-6.99.*-*)
-USE_TOOLS+=            ksh
-CONFIG_SHELL=          ksh
-.endif
-
 TOOLS_BROKEN+=         perl
 GNU_CONFIGURE=         yes
 GNU_CONFIGURE_STRICT=  no
@@ -52,35 +44,44 @@
 
 INSTALLATION_DIRS=     ${PKGGNUDIR}bin ${PKGGNUDIR}${PKGMANDIR}/man1
 
-# gprof (XXX: and others?) cannot be built on all platforms
 #
-PLIST_VARS+=   gprof ld gold SunOS CTF
+# Supported utils and libraries differ quite a bit across platforms.
+#
+PLIST_VARS+=   ctf gas gold gprof ld
 
 .include "../../mk/bsd.prefs.mk"
 
+#
+# libctf does not build on thes platforms at present.
+#
+.if ${OPSYS} == "Darwin" || ${OPSYS} == "Linux"
+CONFIGURE_ARGS+=       --disable-libctf
+.else
+PLIST.ctf=             yes
+.endif
+
+.if ${OPSYS} != "Darwin"
+PLIST.gas=     yes
+.endif
+
 .if ${OPSYS} != "IRIX" && ${OPSYS} != "AIX" && ${OPSYS} != "Darwin"
 PLIST.gprof=   yes
 .endif
 
+#
+# The PLIST.ld variable controls whether we install "ld -> gld" symlinks.  They
+# are excluded on SunOS to avoid accidentally using the wrong "ld", and on
+# Darwin as ld/gas are not built.
+#
 .if ${OPSYS} != SunOS && ${OPSYS} != "Darwin"
 PLIST.ld=      yes
 .endif
 
-.if ${OPSYS} == SunOS
-PLIST.SunOS=   yes
-.endif
-
-# Temporary: libctf should be mature on Linux in the near future
-.if ${OPSYS} != Linux
-PLIST.CTF=     yes
-.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].*)) \
        || ${OPSYS} == Linux
-BUILD_GOLD=            yes
 PLIST.gold=            yes
 USE_TOOLS+=            bison
 CONFIGURE_ARGS+=       --enable-gold --enable-plugins
@@ -94,18 +95,12 @@
                -Wno-error=unused-const-variable
 .endif
 
-SYMLINK_FILES= addr2line ar as c++filt dlltool elfedit ld.bfd          \
-               nlmconv nm objcopy objdump ranlib readelf size strings  \
-               strip windmc windres
-.if defined(PLIST.gprof)
-SYMLINK_FILES+=        gprof
-.endif
-.if defined(PLIST.ld)
-SYMLINK_FILES+=        ld
-.endif
-.if defined(BUILD_GOLD)
-SYMLINK_FILES+=        ld.gold dwp
-.endif
+.include "options.mk"
+
+SYMLINK_FILES= addr2line ar ${PLIST.gas:Das} c++filt dlltool elfedit \
+               ${PLIST.gprof:Dgprof} ${PLIST.ld:Dld} ${PLIST.gld:Dld.bfd} \
+               ${PLIST.gold:Dld.gold dwp} nlmconv nm objcopy objdump \
+               ranlib readelf size strings strip windmc windres
 
 post-install:
        cd ${DESTDIR}${PREFIX} &&                                       \
diff -r f593dc1afeb6 -r c42698f2b3e7 devel/binutils/PLIST.common
--- a/devel/binutils/PLIST.common       Fri Jan 29 12:10:13 2021 +0000
+++ b/devel/binutils/PLIST.common       Fri Jan 29 13:10:34 2021 +0000
@@ -1,8 +1,8 @@
-@comment $NetBSD: PLIST.common,v 1.35 2021/01/28 11:07:55 jperkin Exp $
+@comment $NetBSD: PLIST.common,v 1.36 2021/01/29 13:10:34 jperkin Exp $
 ${MACHINE_GNU_PLATFORM}/bin/ar
-${MACHINE_GNU_PLATFORM}/bin/as
-${MACHINE_GNU_PLATFORM}/bin/ld
-${MACHINE_GNU_PLATFORM}/bin/ld.bfd
+${PLIST.gas}${MACHINE_GNU_PLATFORM}/bin/as
+${PLIST.gld}${MACHINE_GNU_PLATFORM}/bin/ld
+${PLIST.gld}${MACHINE_GNU_PLATFORM}/bin/ld.bfd
 ${PLIST.gold}${MACHINE_GNU_PLATFORM}/bin/ld.gold
 ${MACHINE_GNU_PLATFORM}/bin/nm
 ${MACHINE_GNU_PLATFORM}/bin/objcopy
@@ -12,13 +12,13 @@
 ${MACHINE_GNU_PLATFORM}/bin/strip
 bin/gaddr2line
 bin/gar
-bin/gas
+${PLIST.gas}bin/gas
 bin/gc++filt
 ${PLIST.gold}bin/gdwp
 bin/gelfedit
 ${PLIST.gprof}bin/ggprof
-bin/gld
-bin/gld.bfd
+${PLIST.gld}bin/gld
+${PLIST.gld}bin/gld.bfd
 ${PLIST.gold}bin/gld.gold
 bin/gnm
 bin/gobjcopy
@@ -30,13 +30,13 @@
 bin/gstrip
 gnu/bin/addr2line
 gnu/bin/ar
-gnu/bin/as
+${PLIST.gas}gnu/bin/as
 gnu/bin/c++filt
 ${PLIST.gold}gnu/bin/dwp
 gnu/bin/elfedit
 ${PLIST.gprof}gnu/bin/gprof
 ${PLIST.ld}gnu/bin/ld
-gnu/bin/ld.bfd
+${PLIST.gld}gnu/bin/ld.bfd
 ${PLIST.gold}gnu/bin/ld.gold
 gnu/bin/nm
 gnu/bin/objcopy
@@ -48,7 +48,7 @@
 gnu/bin/strip
 gnu/man/man1/addr2line.1
 gnu/man/man1/ar.1
-gnu/man/man1/as.1
+${PLIST.gas}gnu/man/man1/as.1
 gnu/man/man1/c++filt.1
 gnu/man/man1/dlltool.1
 gnu/man/man1/elfedit.1
@@ -68,30 +68,30 @@
 include/bfd.h
 include/bfd_stdint.h
 include/bfdlink.h
-${PLIST.CTF}include/ctf-api.h
-${PLIST.CTF}include/ctf.h
+${PLIST.ctf}include/ctf-api.h
+${PLIST.ctf}include/ctf.h
 include/diagnostics.h
 include/dis-asm.h
 include/plugin-api.h
 include/symcat.h
-info/as.info
+${PLIST.gas}info/as.info
 info/bfd.info
 info/binutils.info
 ${PLIST.gprof}info/gprof.info
-info/ld.info
-lib/bfd-plugins/libdep.so
+${PLIST.gld}info/ld.info
+${PLIST.gld}lib/bfd-plugins/libdep.so
 lib/libbfd.la
-${PLIST.CTF}lib/libctf-nobfd.la
-${PLIST.CTF}lib/libctf.la
+${PLIST.ctf}lib/libctf-nobfd.la
+${PLIST.ctf}lib/libctf.la
 lib/libopcodes.la
 man/man1/gaddr2line.1
 man/man1/gar.1
-man/man1/gas.1
+${PLIST.gas}man/man1/gas.1
 man/man1/gc++filt.1
 man/man1/gdlltool.1
 man/man1/gelfedit.1
 ${PLIST.gprof}man/man1/ggprof.1
-man/man1/gld.1
+${PLIST.gld}man/man1/gld.1
 man/man1/gnm.1
 man/man1/gobjcopy.1
 man/man1/gobjdump.1
@@ -104,69 +104,69 @@
 man/man1/gwindres.1
 share/locale/bg/LC_MESSAGES/binutils.mo
 ${PLIST.gprof}share/locale/bg/LC_MESSAGES/gprof.mo
-share/locale/bg/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/bg/LC_MESSAGES/ld.mo
 share/locale/ca/LC_MESSAGES/binutils.mo
 share/locale/da/LC_MESSAGES/bfd.mo
 share/locale/da/LC_MESSAGES/binutils.mo
 ${PLIST.gprof}share/locale/da/LC_MESSAGES/gprof.mo
-share/locale/da/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/da/LC_MESSAGES/ld.mo
 share/locale/da/LC_MESSAGES/opcodes.mo
 ${PLIST.gprof}share/locale/de/LC_MESSAGES/gprof.mo
-share/locale/de/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/de/LC_MESSAGES/ld.mo
 share/locale/de/LC_MESSAGES/opcodes.mo
 ${PLIST.gprof}share/locale/eo/LC_MESSAGES/gprof.mo
 share/locale/es/LC_MESSAGES/bfd.mo
 share/locale/es/LC_MESSAGES/binutils.mo
-share/locale/es/LC_MESSAGES/gas.mo
+${PLIST.gas}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
+${PLIST.gld}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.gas}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
+${PLIST.gld}share/locale/fi/LC_MESSAGES/ld.mo
 share/locale/fi/LC_MESSAGES/opcodes.mo
 share/locale/fr/LC_MESSAGES/bfd.mo
 share/locale/fr/LC_MESSAGES/binutils.mo
-share/locale/fr/LC_MESSAGES/gas.mo
+${PLIST.gas}share/locale/fr/LC_MESSAGES/gas.mo
 ${PLIST.gold}share/locale/fr/LC_MESSAGES/gold.mo
 ${PLIST.gprof}share/locale/fr/LC_MESSAGES/gprof.mo
-share/locale/fr/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/fr/LC_MESSAGES/ld.mo
 share/locale/fr/LC_MESSAGES/opcodes.mo
 ${PLIST.gprof}share/locale/ga/LC_MESSAGES/gprof.mo
-share/locale/ga/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/ga/LC_MESSAGES/ld.mo
 share/locale/ga/LC_MESSAGES/opcodes.mo
 share/locale/hr/LC_MESSAGES/bfd.mo
 share/locale/hr/LC_MESSAGES/binutils.mo
 ${PLIST.gprof}share/locale/hu/LC_MESSAGES/gprof.mo
 share/locale/id/LC_MESSAGES/bfd.mo
 share/locale/id/LC_MESSAGES/binutils.mo
-share/locale/id/LC_MESSAGES/gas.mo
+${PLIST.gas}share/locale/id/LC_MESSAGES/gas.mo
 ${PLIST.gold}share/locale/id/LC_MESSAGES/gold.mo
 ${PLIST.gprof}share/locale/id/LC_MESSAGES/gprof.mo
-share/locale/id/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/id/LC_MESSAGES/ld.mo
 share/locale/id/LC_MESSAGES/opcodes.mo
 share/locale/it/LC_MESSAGES/binutils.mo
 ${PLIST.gold}share/locale/it/LC_MESSAGES/gold.mo
 ${PLIST.gprof}share/locale/it/LC_MESSAGES/gprof.mo
-share/locale/it/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/it/LC_MESSAGES/ld.mo
 share/locale/it/LC_MESSAGES/opcodes.mo
 share/locale/ja/LC_MESSAGES/bfd.mo
 share/locale/ja/LC_MESSAGES/binutils.mo
-share/locale/ja/LC_MESSAGES/gas.mo
+${PLIST.gas}share/locale/ja/LC_MESSAGES/gas.mo
 ${PLIST.gold}share/locale/ja/LC_MESSAGES/gold.mo
 ${PLIST.gprof}share/locale/ja/LC_MESSAGES/gprof.mo
-share/locale/ja/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/ja/LC_MESSAGES/ld.mo
 ${PLIST.gprof}share/locale/ms/LC_MESSAGES/gprof.mo
 ${PLIST.gprof}share/locale/nl/LC_MESSAGES/gprof.mo
 share/locale/nl/LC_MESSAGES/opcodes.mo
 share/locale/pt/LC_MESSAGES/bfd.mo
 share/locale/pt/LC_MESSAGES/binutils.mo
 ${PLIST.gprof}share/locale/pt_BR/LC_MESSAGES/gprof.mo
-share/locale/pt_BR/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/pt_BR/LC_MESSAGES/ld.mo
 share/locale/pt_BR/LC_MESSAGES/opcodes.mo
 share/locale/ro/LC_MESSAGES/bfd.mo
 share/locale/ro/LC_MESSAGES/binutils.mo
@@ -174,51 +174,51 @@
 share/locale/ro/LC_MESSAGES/opcodes.mo
 share/locale/ru/LC_MESSAGES/bfd.mo
 share/locale/ru/LC_MESSAGES/binutils.mo
-share/locale/ru/LC_MESSAGES/gas.mo
+${PLIST.gas}share/locale/ru/LC_MESSAGES/gas.mo
 ${PLIST.gprof}share/locale/ru/LC_MESSAGES/gprof.mo
-share/locale/ru/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/ru/LC_MESSAGES/ld.mo
 share/locale/rw/LC_MESSAGES/bfd.mo



Home | Main Index | Thread Index | Old Index