pkgsrc-Changes archive

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

CVS commit: pkgsrc/devel/binutils



Module Name:    pkgsrc
Committed By:   jperkin
Date:           Fri Jan 29 13:10:34 UTC 2021

Modified Files:
        pkgsrc/devel/binutils: Makefile PLIST.common
Added Files:
        pkgsrc/devel/binutils: options.mk

Log Message:
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@


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 pkgsrc/devel/binutils/Makefile
cvs rdiff -u -r1.35 -r1.36 pkgsrc/devel/binutils/PLIST.common
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/binutils/options.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/binutils/Makefile
diff -u pkgsrc/devel/binutils/Makefile:1.96 pkgsrc/devel/binutils/Makefile:1.97
--- pkgsrc/devel/binutils/Makefile:1.96 Wed Jan 27 15:21:21 2021
+++ pkgsrc/devel/binutils/Makefile      Fri Jan 29 13:10:34 2021
@@ -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_LANGUAGES=               c c++
 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,27 +44,37 @@ TEST_DEPENDS+=      dejagnu-[0-9]*:../../deve
 
 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"
 
-.if ${OPSYS} != "IRIX" && ${OPSYS} != "AIX" && ${OPSYS} != "Darwin"
-PLIST.gprof=   yes
+#
+# 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} != SunOS && ${OPSYS} != "Darwin"
-PLIST.ld=      yes
+.if ${OPSYS} != "Darwin"
+PLIST.gas=     yes
 .endif
 
-.if ${OPSYS} == SunOS
-PLIST.SunOS=   yes
+.if ${OPSYS} != "IRIX" && ${OPSYS} != "AIX" && ${OPSYS} != "Darwin"
+PLIST.gprof=   yes
 .endif
 
-# Temporary: libctf should be mature on Linux in the near future
-.if ${OPSYS} != Linux
-PLIST.CTF=     yes
+#
+# 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} == DragonFly \
@@ -80,7 +82,6 @@ PLIST.CTF=    yes
        || (${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 @@ CFLAGS+=    -Wno-unused-value -Wno-format-s
                -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} &&                                       \

Index: pkgsrc/devel/binutils/PLIST.common
diff -u pkgsrc/devel/binutils/PLIST.common:1.35 pkgsrc/devel/binutils/PLIST.common:1.36
--- pkgsrc/devel/binutils/PLIST.common:1.35     Thu Jan 28 11:07:55 2021
+++ pkgsrc/devel/binutils/PLIST.common  Fri Jan 29 13:10:34 2021
@@ -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/readelf
 ${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/gstrings
 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/strings
 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/ansidecl.h
 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/gwindmc.1
 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 @@ ${PLIST.gprof}share/locale/ro/LC_MESSAGE
 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
 share/locale/rw/LC_MESSAGES/binutils.mo
-share/locale/rw/LC_MESSAGES/gas.mo
+${PLIST.gas}share/locale/rw/LC_MESSAGES/gas.mo
 ${PLIST.gprof}share/locale/rw/LC_MESSAGES/gprof.mo
 share/locale/sk/LC_MESSAGES/binutils.mo
 share/locale/sr/LC_MESSAGES/bfd.mo
 share/locale/sr/LC_MESSAGES/binutils.mo
 ${PLIST.gold}share/locale/sr/LC_MESSAGES/gold.mo
 ${PLIST.gprof}share/locale/sr/LC_MESSAGES/gprof.mo
-share/locale/sr/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/sr/LC_MESSAGES/ld.mo
 share/locale/sr/LC_MESSAGES/opcodes.mo
 share/locale/sv/LC_MESSAGES/bfd.mo
 share/locale/sv/LC_MESSAGES/binutils.mo
-share/locale/sv/LC_MESSAGES/gas.mo
+${PLIST.gas}share/locale/sv/LC_MESSAGES/gas.mo
 ${PLIST.gold}share/locale/sv/LC_MESSAGES/gold.mo
 ${PLIST.gprof}share/locale/sv/LC_MESSAGES/gprof.mo
-share/locale/sv/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/sv/LC_MESSAGES/ld.mo
 share/locale/sv/LC_MESSAGES/opcodes.mo
 share/locale/tr/LC_MESSAGES/bfd.mo
 share/locale/tr/LC_MESSAGES/binutils.mo
-share/locale/tr/LC_MESSAGES/gas.mo
+${PLIST.gas}share/locale/tr/LC_MESSAGES/gas.mo
 ${PLIST.gprof}share/locale/tr/LC_MESSAGES/gprof.mo
-share/locale/tr/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/tr/LC_MESSAGES/ld.mo
 share/locale/tr/LC_MESSAGES/opcodes.mo
 share/locale/uk/LC_MESSAGES/bfd.mo
 share/locale/uk/LC_MESSAGES/binutils.mo
-share/locale/uk/LC_MESSAGES/gas.mo
+${PLIST.gas}share/locale/uk/LC_MESSAGES/gas.mo
 ${PLIST.gold}share/locale/uk/LC_MESSAGES/gold.mo
 ${PLIST.gprof}share/locale/uk/LC_MESSAGES/gprof.mo
-share/locale/uk/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/uk/LC_MESSAGES/ld.mo
 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
 ${PLIST.gprof}share/locale/vi/LC_MESSAGES/gprof.mo
-share/locale/vi/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/vi/LC_MESSAGES/ld.mo
 share/locale/vi/LC_MESSAGES/opcodes.mo
 share/locale/zh_CN/LC_MESSAGES/bfd.mo
 share/locale/zh_CN/LC_MESSAGES/binutils.mo
-share/locale/zh_CN/LC_MESSAGES/gas.mo
+${PLIST.gas}share/locale/zh_CN/LC_MESSAGES/gas.mo
 ${PLIST.gold}share/locale/zh_CN/LC_MESSAGES/gold.mo
-share/locale/zh_CN/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/zh_CN/LC_MESSAGES/ld.mo
 share/locale/zh_CN/LC_MESSAGES/opcodes.mo
 share/locale/zh_TW/LC_MESSAGES/binutils.mo
-share/locale/zh_TW/LC_MESSAGES/ld.mo
+${PLIST.gld}share/locale/zh_TW/LC_MESSAGES/ld.mo

Added files:

Index: pkgsrc/devel/binutils/options.mk
diff -u /dev/null pkgsrc/devel/binutils/options.mk:1.1
--- /dev/null   Fri Jan 29 13:10:34 2021
+++ pkgsrc/devel/binutils/options.mk    Fri Jan 29 13:10:34 2021
@@ -0,0 +1,24 @@
+# $NetBSD: options.mk,v 1.1 2021/01/29 13:10:34 jperkin Exp $
+
+PKG_OPTIONS_VAR=       PKG_OPTIONS.binutils
+PKG_SUPPORTED_OPTIONS= disable-ld
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "Darwin"
+PKG_SUGGESTED_OPTIONS= disable-ld
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+PLIST_VARS+=   gld
+
+#
+# Disable ld completely.  With the introduction of "libdep.so" this may now be
+# required on some systems to avoid a dependency on libgcc.
+#
+.if !empty(PKG_OPTIONS:Mdisable-ld)
+CONFIGURE_ARGS+=       --disable-ld
+.else
+PLIST.gld=             yes
+.endif



Home | Main Index | Thread Index | Old Index