pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
binutils: GNU binary utilities
Module Name: pkgsrc-wip
Committed By: Jason W. Bacon <bacon4000%gmail.com@localhost>
Pushed By: outpaddling
Date: Tue Jul 30 06:17:42 2024 -0500
Changeset: c6d309857c8750c2d1f4e0068a17d4a1f4e9b515
Modified Files:
Makefile
Added Files:
binutils/DESCR
binutils/Makefile
binutils/PLIST.NetBSD
binutils/PLIST.common
binutils/PLIST.i386
binutils/PLIST.x86_64
binutils/buildlink3.mk
binutils/builtin.mk
binutils/distinfo
binutils/options.mk
binutils/override-as.mk
binutils/patches/patch-bfd_cache.c
binutils/patches/patch-gold_Makefile.in
binutils/patches/patch-gold_options.h
binutils/patches/patch-gold_system.h
binutils/patches/patch-gold_testsuite_Makefile.in
binutils/patches/patch-include_safe-ctype.h
binutils/patches/patch-ld_Makefile.am
binutils/patches/patch-ld_Makefile.in
binutils/patches/patch-ld_configure.tgt
binutils/patches/patch-ld_emulparams_aarch64nbsd.sh
binutils/patches/patch-ld_emulparams_aarch64nbsdb.sh
binutils/patches/patch-ld_emulparams_armelf__nbsd__eabi.sh
binutils/patches/patch-ld_emulparams_armelf__nbsd__eabihf.sh
binutils/patches/patch-ld_emulparams_armelfb__nbsd__eabi.sh
binutils/patches/patch-ld_emulparams_armelfb__nbsd__eabihf.sh
Log Message:
binutils: GNU binary utilities
Testing macOs patches
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=c6d309857c8750c2d1f4e0068a17d4a1f4e9b515
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
Makefile | 1 +
binutils/DESCR | 11 +
binutils/Makefile | 123 +++++++++++
binutils/PLIST.NetBSD | 6 +
binutils/PLIST.common | 233 +++++++++++++++++++++
binutils/PLIST.i386 | 14 ++
binutils/PLIST.x86_64 | 27 +++
binutils/buildlink3.mk | 14 ++
binutils/builtin.mk | 81 +++++++
binutils/distinfo | 20 ++
binutils/options.mk | 24 +++
binutils/override-as.mk | 26 +++
binutils/patches/patch-bfd_cache.c | 18 ++
binutils/patches/patch-gold_Makefile.in | 26 +++
binutils/patches/patch-gold_options.h | 33 +++
binutils/patches/patch-gold_system.h | 13 ++
binutils/patches/patch-gold_testsuite_Makefile.in | 15 ++
binutils/patches/patch-include_safe-ctype.h | 20 ++
binutils/patches/patch-ld_Makefile.am | 33 +++
binutils/patches/patch-ld_Makefile.in | 33 +++
binutils/patches/patch-ld_configure.tgt | 19 ++
.../patches/patch-ld_emulparams_aarch64nbsd.sh | 44 ++++
.../patches/patch-ld_emulparams_aarch64nbsdb.sh | 9 +
.../patch-ld_emulparams_armelf__nbsd__eabi.sh | 34 +++
.../patch-ld_emulparams_armelf__nbsd__eabihf.sh | 27 +++
.../patch-ld_emulparams_armelfb__nbsd__eabi.sh | 9 +
.../patch-ld_emulparams_armelfb__nbsd__eabihf.sh | 9 +
27 files changed, 922 insertions(+)
diffs:
diff --git a/Makefile b/Makefile
index 6ee2e46ebc..7d791d9cb6 100644
--- a/Makefile
+++ b/Makefile
@@ -295,6 +295,7 @@ SUBDIR+= bifrost
SUBDIR+= bigdft
SUBDIR+= bijiben
SUBDIR+= bindgraph
+SUBDIR+= binutils
SUBDIR+= binutils-git
SUBDIR+= binutils-gold-git
SUBDIR+= bio-mocha
diff --git a/binutils/DESCR b/binutils/DESCR
new file mode 100644
index 0000000000..8247f4b296
--- /dev/null
+++ b/binutils/DESCR
@@ -0,0 +1,11 @@
+The GNU binutils package contains essential tools to assemble, link and
+manipulate binary and object files. They are often used with a compiler
+and additional libraries for building software.
+
+It includes the GNU linker, the portable GNU assembler, ar for modifying
+archives (such as libraries), nm for listing symbols from object files,
+objdump for displaying object file information, ranlib for generating
+archive indexes, size for listing section sizes of object files,
+strings for outputing the printable characters in files, strip for
+stripping out symbols (like debugging information) from object files,
+and other tools.
diff --git a/binutils/Makefile b/binutils/Makefile
new file mode 100644
index 0000000000..b9961a1379
--- /dev/null
+++ b/binutils/Makefile
@@ -0,0 +1,123 @@
+# $NetBSD: Makefile,v 1.113 2023/08/28 15:09:33 fcambus Exp $
+
+DISTNAME= binutils-2.41
+CATEGORIES= devel
+MASTER_SITES= ${MASTER_SITE_GNU:=binutils/}
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://www.gnu.org/software/binutils/
+COMMENT= GNU binary utilities
+LICENSE= gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3
+
+CONFLICTS= avr-binutils<2.13.2.1nb1
+
+USE_PKGLOCALEDIR= yes
+REPLACE_LOCALEDIR_PATTERNS+= Make-in
+
+USE_LANGUAGES= c99 c++
+USE_LIBTOOL= yes
+USE_TOOLS+= gmake
+
+TOOLS_BROKEN+= perl
+GNU_CONFIGURE= yes
+GNU_CONFIGURE_STRICT= no
+# Standard lib dirs on RHEL are named *lib64
+LIB_PATH= /lib:/usr/lib
+.if exists(/usr/lib64)
+LIB_PATH:= /usr/lib64:${LIB_PATH}
+.endif
+.if exists(/lib64)
+LIB_PATH:= /lib64:${LIB_PATH}
+.endif
+CONFIGURE_ARGS+= --with-lib-path=${LIB_PATH}
+CONFIGURE_ARGS+= --program-prefix=g
+BINUTILS_PREFIX= ${PREFIX}/${MACHINE_GNU_PLATFORM}
+
+PLIST_SRC= ${PKGDIR}/PLIST.common
+PLIST_SRC+= ${WRKDIR}/PLIST_DYNAMIC
+
+INFO_FILES= yes
+TEST_TARGET= check
+
+TEST_DEPENDS+= dejagnu-[0-9]*:../../devel/dejagnu
+
+INSTALLATION_DIRS= ${PKGGNUDIR}bin ${PKGGNUDIR}${PKGMANDIR}/man1
+
+#
+# Supported utils and libraries differ quite a bit across platforms.
+#
+PLIST_VARS+= ctf gas gold gprof ld ldint
+
+.include "../../mk/bsd.prefs.mk"
+
+#
+# libctf does not build on these platforms at present.
+#
+.if ${OPSYS} == "Darwin" || ${OPSYS} == "Linux"
+CONFIGURE_ARGS+= --disable-libctf
+.else
+PLIST.ctf= yes
+.endif
+
+.if ${OPSYS} != "Darwin"
+PLIST.gas= yes
+PLIST.ldint= 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} == DragonFly \
+ || (${OPSYS} == FreeBSD && empty(OS_VERSION:M[12345678].*)) \
+ || (${OPSYS} == OpenBSD && empty(OS_VERSION:M[1234].*)) \
+ || (${OPSYS} == NetBSD && ${OPSYS_VERSION} > 050000) \
+ || ${OPSYS} == Linux
+PLIST.gold= yes
+USE_TOOLS+= bison
+CONFIGURE_ARGS+= --enable-gold --enable-plugins
+.endif
+
+.include "../../mk/compiler.mk"
+.if !empty(PKGSRC_COMPILER:Mclang)
+CFLAGS+= -Wno-unused-value -Wno-format-security \
+ -Wno-uninitialized -Wno-format -Wno-string-plus-int \
+ -Wno-empty-body -Wno-self-assign -Wno-unused-function \
+ -Wno-error=unused-const-variable
+.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} && \
+ find ${MACHINE_GNU_PLATFORM}/lib/ldscripts -type f -print \
+ | sort -r \
+ > ${WRKDIR}/PLIST_DYNAMIC
+.for f in ${SYMLINK_FILES}
+ set -e; \
+ if [ -f ${DESTDIR}${PREFIX}/bin/g${f:Q} ]; then \
+ ${LN} -sf ${PREFIX}/bin/g${f} ${DESTDIR}${PREFIX}/${PKGGNUDIR}bin/${f}; \
+ fi
+ if [ -f ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/g${f:Q}.1 ]; then \
+ ${LN} -sf ${PREFIX}/${PKGMANDIR}/man1/g${f}.1 \
+ ${DESTDIR}${PREFIX}/${PKGGNUDIR}${PKGMANDIR}/man1/${f}.1; \
+ fi
+.endfor
+
+.include "../../mk/dlopen.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/binutils/PLIST.NetBSD b/binutils/PLIST.NetBSD
new file mode 100644
index 0000000000..797264f870
--- /dev/null
+++ b/binutils/PLIST.NetBSD
@@ -0,0 +1,6 @@
+@comment $NetBSD: PLIST.NetBSD,v 1.2 2013/04/12 08:27:15 mef Exp $
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/i386nbsd.x
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/i386nbsd.xbn
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/i386nbsd.xn
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/i386nbsd.xr
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/i386nbsd.xu
diff --git a/binutils/PLIST.common b/binutils/PLIST.common
new file mode 100644
index 0000000000..d5743fae14
--- /dev/null
+++ b/binutils/PLIST.common
@@ -0,0 +1,233 @@
+@comment $NetBSD: PLIST.common,v 1.41 2023/07/31 14:08:34 fcambus Exp $
+${MACHINE_GNU_PLATFORM}/bin/ar
+${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
+${MACHINE_GNU_PLATFORM}/bin/objdump
+${MACHINE_GNU_PLATFORM}/bin/ranlib
+${MACHINE_GNU_PLATFORM}/bin/readelf
+${MACHINE_GNU_PLATFORM}/bin/strip
+bin/gaddr2line
+bin/gar
+${PLIST.gas}bin/gas
+bin/gc++filt
+${PLIST.gold}bin/gdwp
+bin/gelfedit
+${PLIST.gprof}bin/ggprof
+${PLIST.gld}bin/gld
+${PLIST.gld}bin/gld.bfd
+${PLIST.gold}bin/gld.gold
+bin/gnm
+bin/gobjcopy
+bin/gobjdump
+bin/granlib
+bin/greadelf
+bin/gsize
+bin/gstrings
+bin/gstrip
+gnu/bin/addr2line
+gnu/bin/ar
+${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
+${PLIST.gld}gnu/bin/ld.bfd
+${PLIST.gold}gnu/bin/ld.gold
+gnu/bin/nm
+gnu/bin/objcopy
+gnu/bin/objdump
+gnu/bin/ranlib
+gnu/bin/readelf
+gnu/bin/size
+gnu/bin/strings
+gnu/bin/strip
+gnu/man/man1/addr2line.1
+gnu/man/man1/ar.1
+${PLIST.gas}gnu/man/man1/as.1
+gnu/man/man1/c++filt.1
+gnu/man/man1/dlltool.1
+gnu/man/man1/elfedit.1
+${PLIST.gprof}gnu/man/man1/gprof.1
+${PLIST.ld}gnu/man/man1/ld.1
+gnu/man/man1/nm.1
+gnu/man/man1/objcopy.1
+gnu/man/man1/objdump.1
+gnu/man/man1/ranlib.1
+gnu/man/man1/readelf.1
+gnu/man/man1/size.1
+gnu/man/man1/strings.1
+gnu/man/man1/strip.1
+gnu/man/man1/windmc.1
+gnu/man/man1/windres.1
+include/ansidecl.h
+include/bfd.h
+include/bfdlink.h
+${PLIST.ctf}include/ctf-api.h
+${PLIST.ctf}include/ctf.h
+include/diagnostics.h
+include/dis-asm.h
+include/plugin-api.h
+include/sframe-api.h
+include/sframe.h
+include/symcat.h
+${PLIST.gas}info/as.info
+info/bfd.info
+info/binutils.info
+${PLIST.ctf}info/ctf-spec.info
+${PLIST.gprof}info/gprof.info
+${PLIST.gld}info/ld.info
+${PLIST.ldint}info/ldint.info
+info/sframe-spec.info
+${PLIST.gld}lib/bfd-plugins/libdep.so
+lib/libbfd.la
+${PLIST.ctf}lib/libctf-nobfd.la
+${PLIST.ctf}lib/libctf.la
+lib/libopcodes.la
+lib/libsframe.a
+lib/libsframe.la
+man/man1/gaddr2line.1
+man/man1/gar.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
+${PLIST.gld}man/man1/gld.1
+man/man1/gnm.1
+man/man1/gobjcopy.1
+man/man1/gobjdump.1
+man/man1/granlib.1
+man/man1/greadelf.1
+man/man1/gsize.1
+man/man1/gstrings.1
+man/man1/gstrip.1
+man/man1/gwindmc.1
+man/man1/gwindres.1
+share/locale/bg/LC_MESSAGES/binutils.mo
+${PLIST.gprof}share/locale/bg/LC_MESSAGES/gprof.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
+${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
+${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
+${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
+${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
+${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
+${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
+${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
+${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
+${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
+${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
+${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
+${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
+${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
+${PLIST.gld}share/locale/ja/LC_MESSAGES/ld.mo
+share/locale/ka/LC_MESSAGES/bfd.mo
+${PLIST.gprof}share/locale/ka/LC_MESSAGES/gprof.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
+${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
+${PLIST.gold}share/locale/ro/LC_MESSAGES/gold.mo
+${PLIST.gprof}share/locale/ro/LC_MESSAGES/gprof.mo
+share/locale/ro/LC_MESSAGES/opcodes.mo
+share/locale/ru/LC_MESSAGES/bfd.mo
+share/locale/ru/LC_MESSAGES/binutils.mo
+${PLIST.gas}share/locale/ru/LC_MESSAGES/gas.mo
+${PLIST.gprof}share/locale/ru/LC_MESSAGES/gprof.mo
+${PLIST.gld}share/locale/ru/LC_MESSAGES/ld.mo
+share/locale/rw/LC_MESSAGES/bfd.mo
+share/locale/rw/LC_MESSAGES/binutils.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
+${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
+${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
+${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
+${PLIST.gas}share/locale/tr/LC_MESSAGES/gas.mo
+${PLIST.gprof}share/locale/tr/LC_MESSAGES/gprof.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
+${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
+${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
+${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
+${PLIST.gas}share/locale/zh_CN/LC_MESSAGES/gas.mo
+${PLIST.gold}share/locale/zh_CN/LC_MESSAGES/gold.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
+${PLIST.gld}share/locale/zh_TW/LC_MESSAGES/ld.mo
diff --git a/binutils/PLIST.i386 b/binutils/PLIST.i386
new file mode 100644
index 0000000000..73cbeae9e8
--- /dev/null
+++ b/binutils/PLIST.i386
@@ -0,0 +1,14 @@
+@comment $NetBSD: PLIST.i386,v 1.1 2013/04/12 08:27:15 mef Exp $
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_i386.x
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_i386.xbn
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_i386.xc
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_i386.xd
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_i386.xdc
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_i386.xdw
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_i386.xn
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_i386.xr
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_i386.xs
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_i386.xsc
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_i386.xsw
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_i386.xu
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_i386.xw
diff --git a/binutils/PLIST.x86_64 b/binutils/PLIST.x86_64
new file mode 100644
index 0000000000..6a0370c9e9
--- /dev/null
+++ b/binutils/PLIST.x86_64
@@ -0,0 +1,27 @@
+@comment $NetBSD: PLIST.x86_64,v 1.2 2013/04/12 08:27:15 mef Exp $
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_k1om.x
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_k1om.xbn
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_k1om.xc
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_k1om.xd
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_k1om.xdc
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_k1om.xdw
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_k1om.xn
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_k1om.xr
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_k1om.xs
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_k1om.xsc
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_k1om.xsw
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_k1om.xu
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_k1om.xw
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_l1om.x
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_l1om.xbn
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_l1om.xc
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_l1om.xd
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_l1om.xdc
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_l1om.xdw
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_l1om.xn
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_l1om.xr
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_l1om.xs
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_l1om.xsc
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_l1om.xsw
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_l1om.xu
+${MACHINE_GNU_PLATFORM}/lib/ldscripts/elf_l1om.xw
diff --git a/binutils/buildlink3.mk b/binutils/buildlink3.mk
new file mode 100644
index 0000000000..16be15d94f
--- /dev/null
+++ b/binutils/buildlink3.mk
@@ -0,0 +1,14 @@
+# $NetBSD: buildlink3.mk,v 1.26 2022/06/28 11:31:40 wiz Exp $
+
+BUILDLINK_TREE+= binutils
+
+.if !defined(BINUTILS_BUILDLINK3_MK)
+BINUTILS_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.binutils+= binutils>=2.22
+BUILDLINK_ABI_DEPENDS.binutils?= binutils>=2.38nb1
+BUILDLINK_PKGSRCDIR.binutils?= ../../devel/binutils
+BUILDLINK_DEPMETHOD.binutils?= build
+.endif # BINUTILS_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -binutils
diff --git a/binutils/builtin.mk b/binutils/builtin.mk
new file mode 100644
index 0000000000..6a60e5ca4b
--- /dev/null
+++ b/binutils/builtin.mk
@@ -0,0 +1,81 @@
+# $NetBSD: builtin.mk,v 1.11 2019/11/03 10:39:06 rillig Exp $
+
+BINUTILS_PREFIX?= /usr
+
+BUILTIN_PKG:= binutils
+BUILTIN_FIND_FILES_VAR:= BINUTILS_FILES
+BUILTIN_FIND_FILES.BINUTILS_FILES:= ${BINUTILS_PREFIX}/include/bfd.h
+.include "../../mk/buildlink3/bsd.builtin.mk"
+
+###
+### Determine if there is a built-in implementation of the package and
+### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
+###
+.if !empty(BINUTILS_FILES:N__nonexistent__)
+IS_BUILTIN.binutils?= yes
+.else
+IS_BUILTIN.binutils?= no
+.endif
+
+###
+### Determine whether we should use the built-in implementation if it
+### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
+###
+.if !defined(USE_BUILTIN.binutils)
+. if ${PREFER.binutils} == "pkgsrc"
+USE_BUILTIN.binutils= no
+. else
+USE_BUILTIN.binutils= ${IS_BUILTIN.binutils}
+. if defined(BUILTIN_PKG.binutils) && \
+ !empty(IS_BUILTIN.binutils:M[yY][eE][sS])
+USE_BUILTIN.binutils= yes
+. for dep in ${BUILDLINK_API_DEPENDS.binutils}
+. if !empty(USE_BUILTIN.binutils:M[yY][eE][sS])
+USE_BUILTIN.binutils!= \
+ if ${PKG_ADMIN} pmatch ${dep:Q} ${BUILTIN_PKG.binutils:Q}; then \
+ ${ECHO} yes; \
+ else \
+ ${ECHO} no; \
+ fi
+. endif
+. endfor
+. endif
+#
+# Some platforms don't have a toolchain that can replace pkgsrc binutils.
+#
+_INCOMPAT_BINUTILS= NetBSD-0.*-* NetBSD-1.[01234]*-* \
+ NetBSD-1.5.*-* NetBSD-1.5[A-X]-*
+. for pattern in ${_INCOMPAT_BINUTILS} ${INCOMPAT_BINUTILS}
+. if !empty(MACHINE_PLATFORM:M${pattern})
+USE_BUILTIN.binutils= no
+. endif
+. endfor
+. endif # PREFER.binutils
+.endif
+MAKEVARS+= USE_BUILTIN.binutils
+
+# if USE_BINUTILS is defined, then force the use of a true binutils
+# implementation.
+#
+.if defined(USE_BINUTILS)
+. if !empty(IS_BUILTIN.binutils:M[nN][oO])
+USE_BUILTIN.binutils= no
+. endif
+.endif
+
+###
+### The section below only applies if we are not including this file
+### solely to determine whether a built-in implementation exists.
+###
+CHECK_BUILTIN.binutils?= no
+.if !empty(CHECK_BUILTIN.binutils:M[nN][oO])
+
+. if !empty(USE_BUILTIN.binutils:M[nN][oO])
+AR= ${BUILDLINK_PREFIX.binutils}/bin/gar
+AS= ${BUILDLINK_PREFIX.binutils}/bin/gas
+LD= ${BUILDLINK_PREFIX.binutils}/bin/gld
+NM= ${BUILDLINK_PREFIX.binutils}/bin/gnm
+RANLIB= ${BUILDLINK_PREFIX.binutils}/bin/granlib
+. endif
+
+.endif # CHECK_BUILTIN.binutils
diff --git a/binutils/distinfo b/binutils/distinfo
new file mode 100644
index 0000000000..52f5278db6
--- /dev/null
+++ b/binutils/distinfo
@@ -0,0 +1,20 @@
+$NetBSD: distinfo,v 1.51 2023/07/31 14:08:34 fcambus Exp $
+
+BLAKE2s (binutils-2.41.tar.bz2) = bd20a803c6f86632b62e27fce2cb07eb0ee4aa06fb374d80c8ba235568466dd2
+SHA512 (binutils-2.41.tar.bz2) = 8c4303145262e84598d828e1a6465ddbf5a8ff757efe3fd981948854f32b311afe5b154be3966e50d85cf5d25217564c1f519d197165aac8e82efcadc9e1e47c
+Size (binutils-2.41.tar.bz2) = 37132937 bytes
+SHA1 (patch-bfd_cache.c) = e2d96bad350552eacdffa83532f9dc9e15ee9be9
+SHA1 (patch-gold_Makefile.in) = e01d973f9625a1653851f796c123efec37102fbd
+SHA1 (patch-gold_options.h) = 03816bbf157d781820d96a4d3af0885dc2bbbaa9
+SHA1 (patch-gold_system.h) = 9b4130b5315763daa66e0a91a8be6d1df0d10344
+SHA1 (patch-gold_testsuite_Makefile.in) = 24ede750675829281436d728d77073638f58d6b9
+SHA1 (patch-include_safe-ctype.h) = 66e636f8200ff5e9b4bfa0a5aee13cd072a23887
+SHA1 (patch-ld_Makefile.am) = 884eb668545d3229809b7fc51cc05b51d799b51a
+SHA1 (patch-ld_Makefile.in) = 7a6a9fb3aed47ddaec0f36c8cec4e0bd6b926027
+SHA1 (patch-ld_configure.tgt) = 4e277c9aa53926059d3227c7e85b3eb3ac60f29d
+SHA1 (patch-ld_emulparams_aarch64nbsd.sh) = 6489e5996eefdb8ba66c73d7425443109d47e6a9
+SHA1 (patch-ld_emulparams_aarch64nbsdb.sh) = 9980f3ca8cb7cac1b56c71c482b691fa2f7659a1
+SHA1 (patch-ld_emulparams_armelf__nbsd__eabi.sh) = 464b0957f95a1a8ba6a92ee0091b929d9c980470
+SHA1 (patch-ld_emulparams_armelf__nbsd__eabihf.sh) = 972678f6bab6e910fe7ac29c6c06f1a438d308a0
+SHA1 (patch-ld_emulparams_armelfb__nbsd__eabi.sh) = 67a519cac8986ab2520861bbd1100782295637d2
+SHA1 (patch-ld_emulparams_armelfb__nbsd__eabihf.sh) = 6f58d6aa6d601544d9ad00a9ac4fdc704390a42c
diff --git a/binutils/options.mk b/binutils/options.mk
new file mode 100644
index 0000000000..516e5e04fa
--- /dev/null
+++ b/binutils/options.mk
@@ -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
diff --git a/binutils/override-as.mk b/binutils/override-as.mk
new file mode 100644
index 0000000000..2359eafd83
--- /dev/null
+++ b/binutils/override-as.mk
@@ -0,0 +1,26 @@
+# $NetBSD: override-as.mk,v 1.8 2015/02/04 14:13:29 jperkin Exp $
+
+# This Makefile fragment can be included by packages that wish to
+# override the default selection of as(1) and use the one from devel/binutils
+# instead.
+
+PKG_AS= ${PREFIX}/bin/gas
+
+.include "../../mk/compiler.mk"
+
+.if !empty(PKGSRC_COMPILER:Mgcc)
+
+SPECS_AS= ${WRAPPER_DIR}/specs.as
+WRAPPER_TARGETS+= ${SPECS_AS}
+
+${SPECS_AS}:
+ @${ECHO} "*invoke_as:" > ${SPECS_AS}
+ @${ECHO} "%{!S:-o %|.s |" >> ${SPECS_AS}
+ @${ECHO} "${PKG_AS} %(asm_options) %m.s %A }" >> ${SPECS_AS}
+
+_WRAP_EXTRA_ARGS.CC+= -specs=${SPECS_AS}
+_WRAP_EXTRA_ARGS.CXX+= -specs=${SPECS_AS}
+CWRAPPERS_APPEND.cc+= -specs=${SPECS_AS}
+CWRAPPERS_APPEND.cxx+= -specs=${SPECS_AS}
+
+.endif
diff --git a/binutils/patches/patch-bfd_cache.c b/binutils/patches/patch-bfd_cache.c
new file mode 100644
index 0000000000..14666b825e
--- /dev/null
+++ b/binutils/patches/patch-bfd_cache.c
@@ -0,0 +1,18 @@
+$NetBSD: patch-bfd_cache.c,v 1.5 2020/12/06 18:07:53 fcambus Exp $
+
+Fix sign-compare on SunOS.
+Handle 256 file descriptor limit in 32-bit SunOS environment.
+
+--- bfd/cache.c.orig 2020-07-24 09:12:19.000000000 +0000
++++ bfd/cache.c
+@@ -49,6 +49,10 @@ SUBSECTION
+ #include <sys/mman.h>
+ #endif
+
++#if defined(__sun) && !defined(_LP64)
++#include <limits.h>
++#endif
++
+ /* In some cases we can optimize cache operation when reopening files.
+ For instance, a flush is entirely unnecessary if the file is already
+ closed, so a flush would use CACHE_NO_OPEN. Similarly, a seek using
diff --git a/binutils/patches/patch-gold_Makefile.in b/binutils/patches/patch-gold_Makefile.in
new file mode 100644
index 0000000000..97e5617335
--- /dev/null
+++ b/binutils/patches/patch-gold_Makefile.in
@@ -0,0 +1,26 @@
+$NetBSD: patch-gold_Makefile.in,v 1.5 2020/12/06 18:07:53 fcambus Exp $
+
+ Don't bail out on the deprecation warnings for <ext/hash_map>
+
+ Don't use hard-coded -ldl.
+
+--- gold/Makefile.in.orig 2020-07-24 09:23:45.000000000 +0000
++++ gold/Makefile.in
+@@ -590,7 +590,7 @@ USE_NLS = @USE_NLS@
+ VERSION = @VERSION@
+ WARN_CFLAGS = @WARN_CFLAGS@
+ WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@
+-WARN_CXXFLAGS = @WARN_CXXFLAGS@
++WARN_CXXFLAGS = @WARN_CXXFLAGS@ -Wno-deprecated
+ WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@
+ XGETTEXT = @XGETTEXT@
+ YACC = @YACC@
+@@ -677,7 +677,7 @@ AM_CPPFLAGS = \
+ -DTOOLLIBDIR="\"$(tooldir)/lib\"" @INCINTL@
+
+ LIBIBERTY = ../libiberty/libiberty.a
+-@PLUGINS_TRUE@LIBDL = @DLOPEN_LIBS@
++@PLUGINS_TRUE@LIBDL = ${DL_LDFLAGS}
+ AM_YFLAGS = -d
+
+ # Automake 1.10+ disables lex and yacc output file regeneration if
diff --git a/binutils/patches/patch-gold_options.h b/binutils/patches/patch-gold_options.h
new file mode 100644
index 0000000000..2bf416bd03
--- /dev/null
+++ b/binutils/patches/patch-gold_options.h
@@ -0,0 +1,33 @@
+$NetBSD: patch-gold_options.h,v 1.6 2021/09/11 15:54:39 fcambus Exp $
+
+ The NetBSD real-time linker do not understand DT_RUNPATH or
+ DT_INIT_ARRAY. The current gold defaults are not suitable for it.
+ The last couple of DragonFly, FreeBSD, and OpenBSD releases do
+ support these tags.
+
+--- gold/options.h.orig 2021-07-08 11:37:20.000000000 +0000
++++ gold/options.h
+@@ -781,7 +781,11 @@ class General_options
+ N_("Output cross reference table"),
+ N_("Do not output cross reference table"));
+
++#if defined(__NetBSD__)
++ DEFINE_bool(ctors_in_init_array, options::TWO_DASHES, '\0', false,
++#else
+ DEFINE_bool(ctors_in_init_array, options::TWO_DASHES, '\0', true,
++#endif
+ N_("Use DT_INIT_ARRAY for all constructors"),
+ N_("Handle constructors as directed by compiler"));
+
+@@ -843,7 +847,11 @@ class General_options
+ N_("Do not create exception frame header"));
+
+ // Alphabetized under 'e' because the option is spelled --enable-new-dtags.
++#if defined(__NetBSD__)
++ 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"),
+ N_("Disable use of DT_RUNPATH"));
+
diff --git a/binutils/patches/patch-gold_system.h b/binutils/patches/patch-gold_system.h
new file mode 100644
index 0000000000..66e3ff806f
--- /dev/null
+++ b/binutils/patches/patch-gold_system.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-gold_system.h,v 1.5 2020/12/06 18:07:53 fcambus Exp $
+
+--- gold/system.h.orig 2020-07-24 09:12:20.000000000 +0000
++++ gold/system.h
+@@ -124,7 +124,7 @@ struct hash<std::string>
+ {
+ size_t
+ operator()(std::string s) const
+- { return __stl_hash_string(s.c_str()); }
++ { return __gnu_cxx::hash<const char *>()(s.c_str()); }
+ };
+
+ template<typename T>
diff --git a/binutils/patches/patch-gold_testsuite_Makefile.in b/binutils/patches/patch-gold_testsuite_Makefile.in
new file mode 100644
index 0000000000..48c76aeb55
--- /dev/null
+++ b/binutils/patches/patch-gold_testsuite_Makefile.in
@@ -0,0 +1,15 @@
+$NetBSD: patch-gold_testsuite_Makefile.in,v 1.2 2021/01/27 15:21:21 fcambus Exp $
+
+Don't use hard-coded -ldl.
+
+--- gold/testsuite/Makefile.in.orig 2021-01-09 10:59:18.000000000 +0000
++++ gold/testsuite/Makefile.in
+@@ -2810,7 +2810,7 @@ TEST_STRIP = $(top_builddir)/../binutils
+ TEST_AR = $(top_builddir)/../binutils/ar
+ TEST_NM = $(top_builddir)/../binutils/nm-new
+ TEST_AS = $(top_builddir)/../gas/as-new
+-@PLUGINS_TRUE@LIBDL = -ldl
++@PLUGINS_TRUE@LIBDL = ${DL_LDFLAGS}
+ @THREADS_TRUE@THREADFLAGS = @PTHREAD_CFLAGS@
+ @THREADS_TRUE@THREADLIBS = @PTHREAD_LIBS@
+ @OMP_SUPPORT_TRUE@TLS_TEST_C_CFLAGS = -fopenmp
diff --git a/binutils/patches/patch-include_safe-ctype.h b/binutils/patches/patch-include_safe-ctype.h
new file mode 100644
index 0000000000..b1ab602929
--- /dev/null
+++ b/binutils/patches/patch-include_safe-ctype.h
@@ -0,0 +1,20 @@
+$NetBSD: patch-include_safe-ctype.h,v 1.3 2020/12/06 18:07:53 fcambus Exp $
+
+--- include/safe-ctype.h.orig 2020-07-24 09:12:20.000000000 +0000
++++ include/safe-ctype.h
+@@ -120,6 +120,8 @@ extern const unsigned char _sch_tolower
+ So we include ctype.h here and then immediately redefine its macros. */
+
+ #include <ctype.h>
++
++#ifndef __cplusplus
+ #undef isalpha
+ #define isalpha(c) do_not_use_isalpha_with_safe_ctype
+ #undef isalnum
+@@ -146,5 +148,6 @@ extern const unsigned char _sch_tolower
+ #define toupper(c) do_not_use_toupper_with_safe_ctype
+ #undef tolower
+ #define tolower(c) do_not_use_tolower_with_safe_ctype
++#endif
+
+ #endif /* SAFE_CTYPE_H */
diff --git a/binutils/patches/patch-ld_Makefile.am b/binutils/patches/patch-ld_Makefile.am
new file mode 100644
index 0000000000..e03c5fc625
--- /dev/null
+++ b/binutils/patches/patch-ld_Makefile.am
@@ -0,0 +1,33 @@
+$NetBSD: patch-ld_Makefile.am,v 1.6 2023/07/31 14:08:34 fcambus Exp $
+
+NetBSD/aarch64 support patches for ld from src.
+
+--- ld/Makefile.am.orig 2023-07-02 23:00:00.000000000 +0000
++++ ld/Makefile.am
+@@ -173,6 +173,8 @@ ALL_EMULATION_SOURCES = \
+ earmelf_linux_fdpiceabi.c \
+ earmelf_nacl.c \
+ earmelf_nbsd.c \
++ earmelf_nbsd_eabi.c \
++ earmelf_nbsd_eabihf.c \
+ earmelf_phoenix.c \
+ earmelf_vxworks.c \
+ earmelfb.c \
+@@ -183,6 +185,8 @@ ALL_EMULATION_SOURCES = \
+ earmelfb_linux_fdpiceabi.c \
+ earmelfb_nacl.c \
+ earmelfb_nbsd.c \
++ earmelfb_nbsd_eabi.c \
++ earmelfb_nbsd_eabihf.c \
+ earmnto.c \
+ earmpe.c \
+ eavr1.c \
+@@ -388,6 +392,8 @@ ALL_64_EMULATION_SOURCES = \
+ eaarch64linux32.c \
+ eaarch64linux32b.c \
+ eaarch64linuxb.c \
++ eaarch64nbsd.c \
++ eaarch64nbsdb.c \
+ eaarch64nto.c \
+ eaarch64pe.c \
+ earm64pe.c \
diff --git a/binutils/patches/patch-ld_Makefile.in b/binutils/patches/patch-ld_Makefile.in
new file mode 100644
index 0000000000..cd8b5ad316
--- /dev/null
+++ b/binutils/patches/patch-ld_Makefile.in
@@ -0,0 +1,33 @@
+$NetBSD: patch-ld_Makefile.in,v 1.6 2023/07/31 14:08:34 fcambus Exp $
+
+NetBSD/aarch64 support patches for ld from src.
+
+--- ld/Makefile.in.orig 2023-07-02 23:00:00.000000000 +0000
++++ ld/Makefile.in
+@@ -674,6 +674,8 @@ ALL_EMULATION_SOURCES = \
+ earmelf_linux_fdpiceabi.c \
+ earmelf_nacl.c \
+ earmelf_nbsd.c \
++ earmelf_nbsd_eabi.c \
++ earmelf_nbsd_eabihf.c \
+ earmelf_phoenix.c \
+ earmelf_vxworks.c \
+ earmelfb.c \
+@@ -684,6 +686,8 @@ ALL_EMULATION_SOURCES = \
+ earmelfb_linux_fdpiceabi.c \
+ earmelfb_nacl.c \
+ earmelfb_nbsd.c \
++ earmelfb_nbsd_eabi.c \
++ earmelfb_nbsd_eabihf.c \
+ earmnto.c \
+ earmpe.c \
+ eavr1.c \
+@@ -888,6 +892,8 @@ ALL_64_EMULATION_SOURCES = \
+ eaarch64linux32.c \
+ eaarch64linux32b.c \
+ eaarch64linuxb.c \
++ eaarch64nbsd.c \
++ eaarch64nbsdb.c \
+ eaarch64nto.c \
+ eaarch64pe.c \
+ earm64pe.c \
diff --git a/binutils/patches/patch-ld_configure.tgt b/binutils/patches/patch-ld_configure.tgt
new file mode 100644
index 0000000000..c384b854d6
--- /dev/null
+++ b/binutils/patches/patch-ld_configure.tgt
@@ -0,0 +1,19 @@
+$NetBSD: patch-ld_configure.tgt,v 1.10 2023/07/31 14:08:34 fcambus Exp $
+
+NetBSD/aarch64 support patches for ld from src.
+
+--- ld/configure.tgt.orig 2023-07-02 23:00:00.000000000 +0000
++++ ld/configure.tgt
+@@ -118,6 +118,12 @@ aarch64-*-linux*) targ_emul=aarch64linux
+ aarch64-*-haiku*) targ_emul=aarch64haiku
+ targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb armelf_haiku $targ_extra_libpath"
+ ;;
++aarch64_be-*-netbsd*) targ_emul=aarch64nbsdb
++ targ_extra_emuls="aarch64nbsd aarch64elfb aarch64elf armelfb_nbsd_eabihf armelf_nbsd_eabihf armelfb_nbsd_eabi armelf_nbsd_eabi armelfb_nbsd armelf_nbsd armelf armelfb"
++ ;;
++aarch64-*-netbsd*) targ_emul=aarch64nbsd
++ targ_extra_emuls="aarch64nbsdb aarch64elf aarch64elfb armelf_nbsd_eabihf armelfb_nbsd_eabihf armelf_nbsd_eabi armelfb_nbsd_eabi armelf_nbsd armelfb_nbsd armelf armelfb"
++ ;;
+ aarch64-*-nto*) targ_emul=aarch64nto
+ targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb"
+ ;;
diff --git a/binutils/patches/patch-ld_emulparams_aarch64nbsd.sh b/binutils/patches/patch-ld_emulparams_aarch64nbsd.sh
new file mode 100644
index 0000000000..0faf2c2b4c
--- /dev/null
+++ b/binutils/patches/patch-ld_emulparams_aarch64nbsd.sh
@@ -0,0 +1,44 @@
+$NetBSD: patch-ld_emulparams_aarch64nbsd.sh,v 1.1 2022/01/24 15:10:46 fcambus Exp $
+
+NetBSD/aarch64 support patches for ld from src.
+
+--- ld/emulparams/aarch64nbsd.sh.orig 2022-01-24 10:48:11.335578875 +0000
++++ ld/emulparams/aarch64nbsd.sh
+@@ -0,0 +1,37 @@
++ARCH=aarch64
++MACHINE=
++NOP=0
++
++SCRIPT_NAME=elf
++ELFSIZE=64
++OUTPUT_FORMAT="elf64-littleaarch64"
++BIG_OUTPUT_FORMAT="elf64-bigaarch64"
++LITTLE_OUTPUT_FORMAT="elf64-littleaarch64"
++NO_REL_RELOCS=yes
++
++TEMPLATE_NAME=elf
++EXTRA_EM_FILE=aarch64elf
++
++GENERATE_SHLIB_SCRIPT=yes
++GENERATE_PIE_SCRIPT=yes
++
++MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
++COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
++SEPARATE_GOTPLT=24
++IREL_IN_PLT=
++
++TEXT_START_ADDR=0x200100000
++
++DATA_START_SYMBOLS='PROVIDE (__data_start = .);';
++
++# AArch64 does not support .s* sections.
++NO_SMALL_DATA=yes
++
++OTHER_BSS_SYMBOLS='__bss_start__ = .;'
++OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
++OTHER_END_SYMBOLS='__end__ = . ;'
++
++OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
++ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }'
++# Ensure each PLT entry is aligned to a cache line.
++PLT=".plt ${RELOCATING-0} : ALIGN(16) { *(.plt)${IREL_IN_PLT+ *(.iplt)} }"
diff --git a/binutils/patches/patch-ld_emulparams_aarch64nbsdb.sh b/binutils/patches/patch-ld_emulparams_aarch64nbsdb.sh
new file mode 100644
index 0000000000..3f569b58fa
--- /dev/null
+++ b/binutils/patches/patch-ld_emulparams_aarch64nbsdb.sh
@@ -0,0 +1,9 @@
+$NetBSD: patch-ld_emulparams_aarch64nbsdb.sh,v 1.1 2022/01/24 15:10:46 fcambus Exp $
+
+NetBSD/aarch64 support patches for ld from src.
+
+--- ld/emulparams/aarch64nbsdb.sh.orig 2022-01-24 10:48:14.877303134 +0000
++++ ld/emulparams/aarch64nbsdb.sh
+@@ -0,0 +1,2 @@
++. ${srcdir}/emulparams/aarch64nbsd.sh
++OUTPUT_FORMAT="elf64-bigaarch64"
diff --git a/binutils/patches/patch-ld_emulparams_armelf__nbsd__eabi.sh b/binutils/patches/patch-ld_emulparams_armelf__nbsd__eabi.sh
new file mode 100644
index 0000000000..f1c01392da
--- /dev/null
+++ b/binutils/patches/patch-ld_emulparams_armelf__nbsd__eabi.sh
@@ -0,0 +1,34 @@
+$NetBSD: patch-ld_emulparams_armelf__nbsd__eabi.sh,v 1.1 2022/01/24 15:10:46 fcambus Exp $
+
+NetBSD/aarch64 support patches for ld from src.
+
+--- ld/emulparams/armelf_nbsd_eabi.sh.orig 2022-01-24 10:52:48.194751022 +0000
++++ ld/emulparams/armelf_nbsd_eabi.sh
+@@ -0,0 +1,27 @@
++. ${srcdir}/emulparams/armelf_nbsd.sh
++
++# Use the ARM ABI-compliant exception-handling sections.
++OTHER_READONLY_SECTIONS="
++ .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) }
++ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); }
++ .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) }
++ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }"
++
++case "$target" in
++ arm*-*-netbsdelf*-*eabihf*)
++ case "$EMULATION_NAME" in
++ *armelf*eabi)
++ LIB_PATH='=/usr/lib/eabi'
++ ;;
++ esac
++ ;;
++ arm*-*-netbsdelf*-*eabi*)
++ ;;
++ aarch64*-*-netbsd* | arm*-*-netbsdelf*)
++ case "$EMULATION_NAME" in
++ *armelf*eabi)
++ LIB_PATH='=/usr/lib/eabi'
++ ;;
++ esac
++ ;;
++esac
diff --git a/binutils/patches/patch-ld_emulparams_armelf__nbsd__eabihf.sh b/binutils/patches/patch-ld_emulparams_armelf__nbsd__eabihf.sh
new file mode 100644
index 0000000000..48874d19bf
--- /dev/null
+++ b/binutils/patches/patch-ld_emulparams_armelf__nbsd__eabihf.sh
@@ -0,0 +1,27 @@
+$NetBSD: patch-ld_emulparams_armelf__nbsd__eabihf.sh,v 1.1 2022/01/24 15:10:46 fcambus Exp $
+
+NetBSD/aarch64 support patches for ld from src.
+
+--- ld/emulparams/armelf_nbsd_eabihf.sh.orig 2022-01-24 10:52:51.236067688 +0000
++++ ld/emulparams/armelf_nbsd_eabihf.sh
+@@ -0,0 +1,20 @@
++. ${srcdir}/emulparams/armelf_nbsd.sh
++
++# Use the ARM ABI-compliant exception-handling sections.
++OTHER_READONLY_SECTIONS="
++ .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) }
++ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); }
++ .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) }
++ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }"
++
++case "$target" in
++ arm*-*-netbsdelf*-*eabihf*)
++ ;;
++ aarch64*-*-netbsd* | arm*-*-netbsdelf*)
++ case "$EMULATION_NAME" in
++ *armelf*eabihf)
++ LIB_PATH='=/usr/lib/eabihf'
++ ;;
++ esac
++ ;;
++esac
diff --git a/binutils/patches/patch-ld_emulparams_armelfb__nbsd__eabi.sh b/binutils/patches/patch-ld_emulparams_armelfb__nbsd__eabi.sh
new file mode 100644
index 0000000000..8ed95d1478
--- /dev/null
+++ b/binutils/patches/patch-ld_emulparams_armelfb__nbsd__eabi.sh
@@ -0,0 +1,9 @@
+$NetBSD: patch-ld_emulparams_armelfb__nbsd__eabi.sh,v 1.1 2022/01/24 15:10:46 fcambus Exp $
+
+NetBSD/aarch64 support patches for ld from src.
+
+--- ld/emulparams/armelfb_nbsd_eabi.sh.orig 2022-01-24 10:55:29.085452037 +0000
++++ ld/emulparams/armelfb_nbsd_eabi.sh
+@@ -0,0 +1,2 @@
++. ${srcdir}/emulparams/armelf_nbsd_eabi.sh
++OUTPUT_FORMAT="elf32-bigarm"
diff --git a/binutils/patches/patch-ld_emulparams_armelfb__nbsd__eabihf.sh b/binutils/patches/patch-ld_emulparams_armelfb__nbsd__eabihf.sh
new file mode 100644
index 0000000000..6623f6597f
--- /dev/null
+++ b/binutils/patches/patch-ld_emulparams_armelfb__nbsd__eabihf.sh
@@ -0,0 +1,9 @@
+$NetBSD: patch-ld_emulparams_armelfb__nbsd__eabihf.sh,v 1.1 2022/01/24 15:10:46 fcambus Exp $
+
+NetBSD/aarch64 support patches for ld from src.
+
+--- ld/emulparams/armelfb_nbsd_eabihf.sh.orig 2022-01-24 10:55:35.489852209 +0000
++++ ld/emulparams/armelfb_nbsd_eabihf.sh
+@@ -0,0 +1,2 @@
++. ${srcdir}/emulparams/armelf_nbsd_eabihf.sh
++OUTPUT_FORMAT="elf32-bigarm"
Home |
Main Index |
Thread Index |
Old Index