diff --git a/devel/binutils/Makefile b/devel/binutils/Makefile index 307e6b26e72f..76158eca0d44 100644 --- a/devel/binutils/Makefile +++ b/devel/binutils/Makefile @@ -1,184 +1,184 @@ PORTNAME= binutils -DISTVERSION= 2.41 +DISTVERSION= 2.40 +PORTREVISION= 4 PORTEPOCH?= 1 CATEGORIES?= devel MASTER_SITES= GNU \ SOURCEWARE/binutils/releases MAINTAINER?= cy@FreeBSD.org COMMENT?= GNU binary tools WWW= https://www.gnu.org/software/binutils/ LICENSE= GPLv3 LGPL3 LICENSE_COMB= multi LICENSE_FILE_GPLv3= ${WRKSRC}/COPYING3 LICENSE_FILE_LGPL3= ${WRKSRC}/COPYING3.LIB BUILD_DEPENDS= ${LOCALBASE}/lib/libgmp.so:math/gmp \ ${LOCALBASE}/lib/libmpfr.so:math/mpfr LIB_DEPENDS= libzstd.so:archivers/zstd FLAVORS= native aarch64 aarch64_none_elf amd64 arm_gnueabi arm_none_eabi \ avr i386 mingw32 mips mips64 powerpc powerpc64 powerpc64le riscv64 \ riscv64_none_elf s390x sparc64 riscv32_unknown_elf FLAVOR?= native USES= bison:alias compiler:env cpe gmake localbase libtool makeinfo perl5 pkgconfig tar:lz USE_PERL5= build CPE_VENDOR= gnu GNU_CONFIGURE= yes #TEST_DEPENDS+= runtest:misc/dejagnu CONFIGURE_ARGS+= --disable-werror \ --enable-deterministic-archives \ --with-sysroot=/ \ --enable-x86-relax-relocations=no \ --with-zstd \ --enable-default-compressed-debug-sections-algorithm=zstd MAKE_ARGS+= LIBDL="" V=1 MAKE_ENV+= ac_cv_func_sbrk=0 # Tests will always fail because --compress-debug-sections is always set to # zlib-gabi regardless of the compression setting by ./configure. # TEST_TARGET= check CONFLICTS= libbfd OPTIONS_DEFINE= NLS RELRO OPTIONS_SUB= yes RELRO_DESC= Enable relocation memory corruption mitigation (-z relro) by default RELRO_CONFIGURE_ON= --enable-relro RELRO_CONFIGURE_OFF= --enable-relro=no NLS_USES= gettext NLS_CONFIGURE_ENABLE= nls aarch64_COMMENT= GNU binutils for ${FLAVOR} development .if ${FLAVOR} != native PKGNAMEPREFIX= ${FLAVOR:C/_/-/g}- PLIST= ${PKGDIR}/pkg-plist-${FLAVOR:C/_/-/g} .if ${PKGNAMEPREFIX:M*-*-} BUTARGET?= ${PKGNAMEPREFIX}${OPSYS:tl}${OSREL} .else BUTARGET?= ${PKGNAMEPREFIX}unknown-${OPSYS:tl}${OSREL} .endif PLIST_SUB= BUTARGET=${BUTARGET} OPTIONS_EXCLUDE= NLS INFO_PATH= ${PKGNAMEPREFIX:S/-$//}/share/info .if ${FLAVOR} == aarch64 BROKEN_mips= fails to configure: error: C compiler cannot create executables BROKEN_mips64= fails to configure: error: C compiler cannot create executables .elif ${FLAVOR} == aarch64_none_elf || ${FLAVOR} == arm_none_eabi || ${FLAVOR} == riscv64_none_elf || ${FLAVOR} == mingw32 || ${FLAVOR} == avr || ${FLAVOR} == riscv32_unknown_elf BUTARGET= ${FLAVOR:C/_/-/g} .elif ${FLAVOR} == amd64 BUTARGET= x86_64-unknown-${OPSYS:tl}${OSREL} .endif .if ${FLAVOR} == mingw32 USES+= iconv .endif CONFIGURE_ARGS+= --target=${BUTARGET} .endif .if ${FLAVOR} == native CONFIGURE_ARGS+= --enable-shared PLIST_SUB+= SHARED='' .else CONFIGURE_ARGS+= --disable-shared PLIST_SUB+= SHARED='@comment' .endif .if ${FLAVOR} == native BUREMOVE= coffdump \ dlltool \ dllwrap \ nlmconv \ srconv \ sysdump \ windmc \ windres USES+= localbase CONFIGURE_ARGS+= --with-system-zlib \ --with-gmp=${LOCALBASE} \ --with-mpfr=${LOCALBASE} \ --enable-targets=all \ --enable-threads=yes # XXX Needed to support gcc10 and earlier: CONFIGURE_ARGS+= --with-isa-spec=2.2 INFO= as \ binutils \ ctf-spec \ gprof \ bfd \ ld \ - ldint \ sframe-spec .endif .include # Actual earliest version may differ slightly .if (${ARCH} != sparc64 && ${ARCH} != mips && ${ARCH} != mips64 && ${ARCH} != powerpcspe && ${ARCH} != powerpc && ${ARCH} != powerpc64 && ${ARCH} != riscv64 && !defined(PKGNAMEPREFIX)) || ((${ARCH} == powerpc || ${ARCH} == powerpc64) && ${CHOSEN_COMPILER_TYPE} != gcc && !defined(PKGNAMEPREFIX)) CONFIGURE_ARGS+= --enable-gold --enable-plugins CXXFLAGS+= -Wno-c++11-narrowing PLIST_SUB+= GOLD="" .else PLIST_SUB+= GOLD="@comment " .endif .if (${FLAVOR} == native && ${OPSYS} == FreeBSD) || \ (${FLAVOR} != native && ${BUTARGET:M*freebsd*}) CONFIGURE_ARGS+= --enable-new-dtags .endif .if ${ARCH} == amd64 CONFIGURE_TARGET= x86_64-portbld-freebsd${OSREL} .elif ${ARCH} == powerpcspe CONFIGURE_TARGET= powerpc-portbld-freebsd${OSREL} .else CONFIGURE_TARGET= ${ARCH}-portbld-freebsd${OSREL} .endif post-patch: ${REINPLACE_CMD} -e "s/-ldl//g" ${WRKSRC}/gold/testsuite/Makefile.in # Force the generation of man pages ${RM} ${WRKSRC}/binutils/doc/*.1 ${RM} ${WRKSRC}/gas/doc/*.1 ${RM} ${WRKSRC}/gprof/*.1 ${RM} ${WRKSRC}/ld/*.1 post-install: .if ${FLAVOR} == native @${STRIP_CMD} \ ${STAGEDIR}${PREFIX}/lib/lib*.so* \ ${STAGEDIR}${PREFIX}/lib/bfd-plugins/libdep.so ${INSTALL_DATA} ${WRKSRC}/include/plugin-api.h ${STAGEDIR}${PREFIX}/include/ @${FIND} -ds ${STAGEDIR}${PREFIX}/${CONFIGURE_TARGET} ! -type d | \ ${SED} -e 's,^${STAGEDIR}${PREFIX}/,,' >> ${TMPPLIST} .else .if ${PKGNAMEPREFIX:S/-$//} != ${BUTARGET} ${RM} -r ${STAGEDIR}${PREFIX}/${PKGNAMEPREFIX:S/-$//} .endif ${RM} ${STAGEDIR}${PREFIX}/${BUTARGET}/lib/ldscripts/i386bsd.* @if [ -d ${STAGEDIR}${PREFIX}/${INFO_PATH:H} ] ; then rm -rf ${STAGEDIR}${PREFIX}/${INFO_PATH:H}; fi ${LN} -fs ../../bin/${BUTARGET}-size ${STAGEDIR}${PREFIX}/${BUTARGET}/bin/size ${RM} -r ${STAGEDIR}${PREFIX}/lib/bfd-plugins .endif .for tool in ${BUREMOVE} @${RM} ${STAGEDIR}${PREFIX}/bin/${BUTARGET}-${tool} \ ${STAGEDIR}${PREFIX}/bin/${tool} \ ${STAGEDIR}${MANPREFIX}/man/man1/${BUTARGET}-${tool}.1 \ ${STAGEDIR}${MANPREFIX}/man/man1/${tool}.1 \ ${STAGEDIR}${PREFIX}/${BUTARGET}/bin/${tool} .endfor .if defined(BUREMOVE) && ${BUREMOVE:Mld} @${RM} -r ${STAGEDIR}${PREFIX}/${BUTARGET}/lib/ldscripts .endif .include diff --git a/devel/binutils/distinfo b/devel/binutils/distinfo index 04808f860761..14280232a4b2 100644 --- a/devel/binutils/distinfo +++ b/devel/binutils/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1690831336 -SHA256 (binutils-2.41.tar.lz) = eab3444055882ed5eb04e2743d03f0c0e1bc950197a4ddd31898cd5a2843d065 -SIZE (binutils-2.41.tar.lz) = 26307264 +TIMESTAMP = 1673799644 +SHA256 (binutils-2.40.tar.lz) = 48e65ecee1bbcf334d7efb4ea8487fe048dea522e5da3bdf7fa42b1ec779ea33 +SIZE (binutils-2.40.tar.lz) = 24784952 diff --git a/devel/binutils/files/patch-bfd_elf.c b/devel/binutils/files/patch-bfd_elf.c new file mode 100644 index 000000000000..7f27ebb80a10 --- /dev/null +++ b/devel/binutils/files/patch-bfd_elf.c @@ -0,0 +1,39 @@ +--- bfd/elf.c.orig 2023-01-14 00:00:00 UTC ++++ bfd/elf.c +@@ -3870,21 +3870,23 @@ assign_section_numbers (bfd *abfd, struct bfd_link_inf + { + case SHT_REL: + case SHT_RELA: +- /* A reloc section which we are treating as a normal BFD +- section. sh_link is the section index of the symbol +- table. sh_info is the section index of the section to +- which the relocation entries apply. We assume that an +- allocated reloc section uses the dynamic symbol table +- if there is one. Otherwise we guess the normal symbol +- table. FIXME: How can we be sure? */ +- if (d->this_hdr.sh_link == 0 && (sec->flags & SEC_ALLOC) != 0) ++ /* sh_link is the section index of the symbol table. ++ sh_info is the section index of the section to which the ++ relocation entries apply. */ ++ if (d->this_hdr.sh_link == 0) + { +- s = bfd_get_section_by_name (abfd, ".dynsym"); +- if (s != NULL) +- d->this_hdr.sh_link = elf_section_data (s)->this_idx; ++ /* FIXME maybe: If this is a reloc section which we are ++ treating as a normal section then we likely should ++ not be assuming its sh_link is .dynsym or .symtab. */ ++ if ((sec->flags & SEC_ALLOC) != 0) ++ { ++ s = bfd_get_section_by_name (abfd, ".dynsym"); ++ if (s != NULL) ++ d->this_hdr.sh_link = elf_section_data (s)->this_idx; ++ } ++ else ++ d->this_hdr.sh_link = elf_onesymtab (abfd); + } +- if (d->this_hdr.sh_link == 0) +- d->this_hdr.sh_link = elf_onesymtab (abfd); + + s = elf_get_reloc_section (sec); + if (s != NULL) diff --git a/devel/binutils/files/patch-ld_ldlang.c b/devel/binutils/files/patch-ld_ldlang.c new file mode 100644 index 000000000000..7652eabe9184 --- /dev/null +++ b/devel/binutils/files/patch-ld_ldlang.c @@ -0,0 +1,12 @@ +--- ld/ldlang.c.orig 2023-01-13 16:00:00.000000000 -0800 ++++ ld/ldlang.c 2023-05-13 21:48:06.006092000 -0700 +@@ -649,7 +649,8 @@ + looking at the sections for this file. */ + + /* Find the correct node to append this section. */ +- if (compare_section (sec->spec.sorted, section, (*tree)->section) < 0) ++ if (sec && sec->spec.sorted != none && sec->spec.sorted != by_none ++ && compare_section (sec->spec.sorted, section, (*tree)->section) < 0) + tree = &((*tree)->left); + else + tree = &((*tree)->right); diff --git a/devel/binutils/pkg-plist b/devel/binutils/pkg-plist index 0d52d79181c3..eeb7f38341b0 100644 --- a/devel/binutils/pkg-plist +++ b/devel/binutils/pkg-plist @@ -1,186 +1,185 @@ bin/addr2line bin/ar bin/as bin/c++filt %%GOLD%%bin/dwp bin/elfedit bin/gprof bin/ld bin/ld.bfd %%GOLD%%bin/ld.gold bin/nm bin/objcopy bin/objdump bin/ranlib bin/readelf bin/size bin/strings bin/strip include/ansidecl.h include/bfd.h include/bfdlink.h include/ctf-api.h include/ctf.h include/diagnostics.h include/dis-asm.h %%GOLD%%include/plugin-api.h include/sframe-api.h include/sframe.h include/symcat.h %%SHARED%%lib/bfd-plugins/libdep.so -%%SHARED%%lib/libbfd-2.41.so +%%SHARED%%lib/libbfd-2.40.so lib/libbfd.a %%SHARED%%lib/libbfd.so lib/libctf-nobfd.a %%SHARED%%lib/libctf-nobfd.so %%SHARED%%lib/libctf-nobfd.so.0 %%SHARED%%lib/libctf-nobfd.so.0.0.0 lib/libctf.a %%SHARED%%lib/libctf.so %%SHARED%%lib/libctf.so.0 %%SHARED%%lib/libctf.so.0.0.0 -%%SHARED%%lib/libopcodes-2.41.so +%%SHARED%%lib/libopcodes-2.40.so lib/libopcodes.a %%SHARED%%lib/libopcodes.so lib/libsframe.a %%SHARED%%lib/libsframe.so -%%SHARED%%lib/libsframe.so.1 -%%SHARED%%lib/libsframe.so.1.0.0 +%%SHARED%%lib/libsframe.so.0 +%%SHARED%%lib/libsframe.so.0.0.0 man/man1/addr2line.1.gz man/man1/ar.1.gz man/man1/as.1.gz man/man1/c++filt.1.gz man/man1/elfedit.1.gz man/man1/gprof.1.gz man/man1/ld.1.gz man/man1/nm.1.gz man/man1/objcopy.1.gz man/man1/objdump.1.gz man/man1/ranlib.1.gz man/man1/readelf.1.gz man/man1/size.1.gz man/man1/strings.1.gz man/man1/strip.1.gz %%NLS%%share/locale/bg/LC_MESSAGES/binutils.mo %%NLS%%share/locale/bg/LC_MESSAGES/gprof.mo %%NLS%%share/locale/bg/LC_MESSAGES/ld.mo %%NLS%%share/locale/ca/LC_MESSAGES/binutils.mo %%NLS%%share/locale/da/LC_MESSAGES/bfd.mo %%NLS%%share/locale/da/LC_MESSAGES/binutils.mo %%NLS%%share/locale/da/LC_MESSAGES/gprof.mo %%NLS%%share/locale/da/LC_MESSAGES/ld.mo %%NLS%%share/locale/da/LC_MESSAGES/opcodes.mo %%NLS%%share/locale/de/LC_MESSAGES/gprof.mo %%NLS%%share/locale/de/LC_MESSAGES/opcodes.mo %%NLS%%share/locale/eo/LC_MESSAGES/gprof.mo %%NLS%%share/locale/es/LC_MESSAGES/bfd.mo %%NLS%%share/locale/es/LC_MESSAGES/binutils.mo %%NLS%%share/locale/es/LC_MESSAGES/gas.mo %%NLS%%share/locale/es/LC_MESSAGES/gprof.mo %%NLS%%share/locale/es/LC_MESSAGES/ld.mo %%NLS%%share/locale/es/LC_MESSAGES/opcodes.mo %%NLS%%%%GOLD%%share/locale/es/LC_MESSAGES/gold.mo %%NLS%%share/locale/fi/LC_MESSAGES/bfd.mo %%NLS%%share/locale/fi/LC_MESSAGES/binutils.mo %%NLS%%share/locale/fi/LC_MESSAGES/gas.mo %%NLS%%share/locale/fi/LC_MESSAGES/gprof.mo %%NLS%%share/locale/fi/LC_MESSAGES/ld.mo %%NLS%%share/locale/fi/LC_MESSAGES/opcodes.mo %%NLS%%%%GOLD%%share/locale/fi/LC_MESSAGES/gold.mo %%NLS%%share/locale/fr/LC_MESSAGES/bfd.mo %%NLS%%share/locale/fr/LC_MESSAGES/binutils.mo %%NLS%%share/locale/fr/LC_MESSAGES/gas.mo %%NLS%%share/locale/fr/LC_MESSAGES/gprof.mo %%NLS%%share/locale/fr/LC_MESSAGES/ld.mo %%NLS%%share/locale/fr/LC_MESSAGES/opcodes.mo %%NLS%%%%GOLD%%share/locale/fr/LC_MESSAGES/gold.mo %%NLS%%share/locale/ga/LC_MESSAGES/gprof.mo %%NLS%%share/locale/ga/LC_MESSAGES/ld.mo %%NLS%%share/locale/ga/LC_MESSAGES/opcodes.mo %%NLS%%share/locale/hr/LC_MESSAGES/binutils.mo %%NLS%%share/locale/hu/LC_MESSAGES/gprof.mo %%NLS%%share/locale/id/LC_MESSAGES/gprof.mo %%NLS%%share/locale/id/LC_MESSAGES/opcodes.mo %%NLS%%share/locale/id/LC_MESSAGES/bfd.mo %%NLS%%share/locale/id/LC_MESSAGES/binutils.mo %%NLS%%share/locale/id/LC_MESSAGES/gas.mo %%NLS%%share/locale/id/LC_MESSAGES/ld.mo %%NLS%%%%GOLD%%share/locale/id/LC_MESSAGES/gold.mo %%NLS%%share/locale/it/LC_MESSAGES/binutils.mo %%NLS%%share/locale/it/LC_MESSAGES/gprof.mo %%NLS%%share/locale/it/LC_MESSAGES/ld.mo %%NLS%%share/locale/it/LC_MESSAGES/opcodes.mo %%NLS%%%%GOLD%%share/locale/it/LC_MESSAGES/gold.mo %%NLS%%share/locale/ja/LC_MESSAGES/bfd.mo %%NLS%%share/locale/ja/LC_MESSAGES/binutils.mo %%NLS%%share/locale/ja/LC_MESSAGES/gas.mo %%NLS%%share/locale/ja/LC_MESSAGES/gprof.mo %%NLS%%share/locale/ja/LC_MESSAGES/ld.mo -%%NLS%%share/locale/ka/LC_MESSAGES/bfd.mo %%NLS%%share/locale/ka/LC_MESSAGES/gprof.mo %%NLS%%share/locale/ms/LC_MESSAGES/gprof.mo %%NLS%%share/locale/nl/LC_MESSAGES/gprof.mo %%NLS%%share/locale/nl/LC_MESSAGES/opcodes.mo %%NLS%%share/locale/pt/LC_MESSAGES/bfd.mo %%NLS%%share/locale/pt/LC_MESSAGES/binutils.mo %%NLS%%share/locale/pt_BR/LC_MESSAGES/gprof.mo %%NLS%%share/locale/pt_BR/LC_MESSAGES/ld.mo %%NLS%%share/locale/pt_BR/LC_MESSAGES/opcodes.mo %%NLS%%share/locale/ro/LC_MESSAGES/bfd.mo %%NLS%%share/locale/ro/LC_MESSAGES/binutils.mo %%NLS%%%%GOLD%%share/locale/ro/LC_MESSAGES/gold.mo %%NLS%%share/locale/ro/LC_MESSAGES/gprof.mo %%NLS%%share/locale/ro/LC_MESSAGES/opcodes.mo %%NLS%%share/locale/ru/LC_MESSAGES/bfd.mo %%NLS%%share/locale/ru/LC_MESSAGES/binutils.mo %%NLS%%share/locale/ru/LC_MESSAGES/gas.mo %%NLS%%share/locale/ru/LC_MESSAGES/gprof.mo %%NLS%%share/locale/rw/LC_MESSAGES/bfd.mo %%NLS%%share/locale/rw/LC_MESSAGES/binutils.mo %%NLS%%share/locale/rw/LC_MESSAGES/gas.mo %%NLS%%share/locale/rw/LC_MESSAGES/gprof.mo %%NLS%%share/locale/sk/LC_MESSAGES/binutils.mo %%NLS%%share/locale/sr/LC_MESSAGES/bfd.mo %%NLS%%%%GOLD%%share/locale/sr/LC_MESSAGES/gold.mo %%NLS%%share/locale/sr/LC_MESSAGES/gprof.mo %%NLS%%share/locale/sr/LC_MESSAGES/binutils.mo %%NLS%%share/locale/sv/LC_MESSAGES/bfd.mo %%NLS%%share/locale/sv/LC_MESSAGES/binutils.mo %%NLS%%share/locale/sv/LC_MESSAGES/gprof.mo %%NLS%%share/locale/sv/LC_MESSAGES/ld.mo %%NLS%%share/locale/sv/LC_MESSAGES/opcodes.mo %%NLS%%share/locale/tr/LC_MESSAGES/bfd.mo %%NLS%%share/locale/tr/LC_MESSAGES/binutils.mo %%NLS%%share/locale/tr/LC_MESSAGES/gas.mo %%NLS%%share/locale/tr/LC_MESSAGES/gprof.mo %%NLS%%share/locale/tr/LC_MESSAGES/ld.mo %%NLS%%share/locale/tr/LC_MESSAGES/opcodes.mo %%NLS%%share/locale/uk/LC_MESSAGES/bfd.mo %%NLS%%share/locale/uk/LC_MESSAGES/binutils.mo %%NLS%%share/locale/uk/LC_MESSAGES/gas.mo %%NLS%%share/locale/uk/LC_MESSAGES/gprof.mo %%NLS%%share/locale/uk/LC_MESSAGES/ld.mo %%NLS%%share/locale/uk/LC_MESSAGES/opcodes.mo %%NLS%%share/locale/vi/LC_MESSAGES/bfd.mo %%NLS%%share/locale/vi/LC_MESSAGES/binutils.mo %%NLS%%share/locale/vi/LC_MESSAGES/gprof.mo %%NLS%%share/locale/vi/LC_MESSAGES/ld.mo %%NLS%%share/locale/de/LC_MESSAGES/ld.mo %%NLS%%share/locale/hr/LC_MESSAGES/bfd.mo %%NLS%%%%GOLD%%share/locale/ja/LC_MESSAGES/gold.mo %%NLS%%share/locale/ru/LC_MESSAGES/ld.mo %%NLS%%share/locale/sr/LC_MESSAGES/ld.mo %%NLS%%share/locale/sr/LC_MESSAGES/opcodes.mo %%NLS%%share/locale/sv/LC_MESSAGES/gas.mo %%NLS%%%%GOLD%%share/locale/sv/LC_MESSAGES/gold.mo %%NLS%%%%GOLD%%share/locale/uk/LC_MESSAGES/gold.mo %%NLS%%share/locale/vi/LC_MESSAGES/opcodes.mo %%NLS%%%%GOLD%%share/locale/vi/LC_MESSAGES/gold.mo %%NLS%%share/locale/zh_CN/LC_MESSAGES/bfd.mo %%NLS%%share/locale/zh_CN/LC_MESSAGES/binutils.mo %%NLS%%share/locale/zh_CN/LC_MESSAGES/gas.mo %%NLS%%share/locale/zh_CN/LC_MESSAGES/ld.mo %%NLS%%share/locale/zh_CN/LC_MESSAGES/opcodes.mo %%NLS%%%%GOLD%%share/locale/zh_CN/LC_MESSAGES/gold.mo %%NLS%%share/locale/zh_TW/LC_MESSAGES/binutils.mo %%NLS%%share/locale/zh_TW/LC_MESSAGES/ld.mo