Skip to content

Commit

Permalink
devel/binutils: Update to 2.37
Browse files Browse the repository at this point in the history
ChangeLog:
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ChangeLog;h=641d82c5358c863fbaba07a61e14a135c5785959;hb=116a737f438d03a1bd6aa706b6ea0b4022f3b7e2

exp-run by antoine@

Related commit: bae65d8 - Fix build with upcoming  binutils

PR:	251385
Reported by:	jflopezfernandez@gmail.com (maintainer)
Reviewed by:	arrowd@, koobs@, linimon@, tobik@
  • Loading branch information
Yasuhiro Kimura authored and fernape committed Aug 10, 2021
1 parent 36c70fb commit a0e752d
Show file tree
Hide file tree
Showing 16 changed files with 340 additions and 320 deletions.
52 changes: 26 additions & 26 deletions devel/binutils/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Created by: Martin Matuska <mm@FreeBSD.org>

PORTNAME= binutils
PORTVERSION= 2.33.1
PORTREVISION= 4
PORTVERSION= 2.37
PORTEPOCH?= 1
CATEGORIES?= devel
MASTER_SITES= SOURCEWARE/binutils/releases
Expand All @@ -12,40 +11,44 @@ COMMENT?= GNU binary tools

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

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

RELRO_CONFIGURE_ON= --enable-relro
BUILD_DEPENDS= ${LOCALBASE}/lib/libgmp.so:math/gmp \
${LOCALBASE}/lib/libmpfr.so:math/mpfr

CONFLICTS= libbfd-[0-9]*
USES= bison:alias compiler:env cpe gmake libtool makeinfo perl5 tar:xz
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
MAKE_ARGS+= LIBDL=""
MAKE_ENV+= ac_cv_func_sbrk=0
TEST_TARGET= check

CONFLICTS= libbfd-[0-9]*

OPTIONS_DEFINE= NLS RELRO STATIC
OPTIONS_SUB= yes
STATIC_PREVENTS= NLS

RELRO_DESC= Enable relocation memory corruption mitigation (-z relro) by default

LICENSE_FILE_GPLv3= ${WRKSRC}/COPYING3
LICENSE_FILE_LGPL3= ${WRKSRC}/COPYING3.LIB

USES= bison:alias cpe gmake libtool tar:xz compiler:env
CPE_VENDOR= gnu
GNU_CONFIGURE= yes

RELRO_CONFIGURE_ON= --enable-relro
RELRO_CONFIGURE_OFF= --enable-relro=no
OPTIONS_SUB= yes
STATIC_LDFLAGS+= -all-static
NLS_USES= gettext
NLS_CONFIGURE_ENABLE= nls

STATIC_LDFLAGS+= -all-static

aarch64_COMMENT= GNU binutils for ${FLAVOR} development

.if ${FLAVOR} != native
Expand All @@ -70,6 +73,10 @@ BUTARGET= ${FLAVOR:C/_/-/g}
BUTARGET= x86_64-unknown-${OPSYS:tl}${OSREL}
.endif

.if ${FLAVOR} == mingw32
USES+= iconv
.endif

CONFIGURE_ARGS+= --disable-shared \
--target=${BUTARGET}
.endif
Expand All @@ -96,14 +103,6 @@ INFO= as \
ld
.endif

CONFIGURE_ARGS+= --disable-werror \
--enable-deterministic-archives \
--with-sysroot=/ \
--enable-x86-relax-relocations=no

MAKE_ENV+= ac_cv_func_sbrk=0
MAKE_ARGS+= LIBDL=""

.include <bsd.port.pre.mk>

# Actual earliest version may differ slightly
Expand Down Expand Up @@ -140,6 +139,7 @@ post-install:
${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} \
Expand Down
6 changes: 3 additions & 3 deletions devel/binutils/distinfo
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TIMESTAMP = 1575361927
SHA256 (binutils-2.33.1.tar.xz) = ab66fc2d1c3ec0359b8e08843c9f33b63e8707efdff5e4cc5c200eae24722cbf
SIZE (binutils-2.33.1.tar.xz) = 21490848
TIMESTAMP = 1626719973
SHA256 (binutils-2.37.tar.xz) = 820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c
SIZE (binutils-2.37.tar.xz) = 22916924
65 changes: 0 additions & 65 deletions devel/binutils/files/patch-0b398d6.diff

This file was deleted.

12 changes: 6 additions & 6 deletions devel/binutils/files/patch-bfd_elfxx-sparc.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
--- bfd/elfxx-sparc.c.orig 2013-11-08 11:13:48.000000000 +0100
+++ bfd/elfxx-sparc.c 2014-10-10 16:30:23.316125000 +0200
@@ -2942,12 +2942,14 @@
--- bfd/elfxx-sparc.c.orig 2021-07-08 13:37:19.000000000 +0200
+++ bfd/elfxx-sparc.c 2021-07-21 09:32:51.373421000 +0200
@@ -2784,12 +2784,14 @@
Elf_Internal_Rela *relend;
int num_relocs;
bfd_boolean is_vxworks_tls;
bool is_vxworks_tls;
+ const struct elf_backend_data *bed;

htab = _bfd_sparc_elf_hash_table (info);
Expand All @@ -15,9 +15,9 @@

if (elf_hash_table (info)->hgot == NULL)
got_base = 0;
@@ -3528,6 +3530,8 @@
@@ -3448,6 +3450,8 @@
bfd_set_error (bfd_error_bad_value);
return FALSE;
return false;
}
+ if (bed->elf_osabi == ELFOSABI_FREEBSD)
+ outrel.r_addend -= osec->vma;
Expand Down
12 changes: 0 additions & 12 deletions devel/binutils/files/patch-gas-configure.tgt

This file was deleted.

45 changes: 45 additions & 0 deletions devel/binutils/files/patch-gold_gc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From 10b4dbbf281397e2827820c715c39559c7f7a29d Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@gmail.com>
Date: Tue, 20 Jul 2021 18:46:57 +0930
Subject: [PATCH] PR28106, build of 2.37 fails on FreeBSD and Clang

https://en.cppreference.com/w/cpp/types/NULL says NULL might be
defined as nullptr.
https://en.cppreference.com/w/cpp/language/reinterpret_cast says
reinterpret_cast can't be used on nullptr.
PR gold/28106
PR gold/27815
* gc.h (gc_process_relocs): Use static_cast in Section_id constructor.
(cherry picked from commit b97bd976233ee4d43c2fe18f6356e62779cbe82d)
---
gold/ChangeLog | 6 ++++++
gold/gc.h | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git gold/gc.h gold/gc.h
index 6ebd81f3fd0..4a1368f5abe 100644
--- gold/gc.h
+++ gold/gc.h
@@ -247,7 +247,7 @@ gc_process_relocs(
if (is_ordinary)
(*secvec).push_back(Section_id(src_obj, dst_indx));
else
- (*secvec).push_back(Section_id(reinterpret_cast<Relobj*>(NULL), 0));
+ (*secvec).push_back(Section_id(static_cast<Relobj*>(NULL), 0));
// If the target of the relocation is an STT_SECTION symbol,
// make a note of that by storing -1 in the symbol vector.
if (lsym.get_st_type() == elfcpp::STT_SECTION)
@@ -329,7 +329,7 @@ gc_process_relocs(
if (is_ordinary && dst_obj != NULL)
(*secvec).push_back(Section_id(dst_obj, dst_indx));
else
- (*secvec).push_back(Section_id(reinterpret_cast<Relobj*>(NULL), 0));
+ (*secvec).push_back(Section_id(static_cast<Relobj*>(NULL), 0));
(*symvec).push_back(gsym);
(*addendvec).push_back(std::make_pair(
static_cast<long long>(symvalue),
--
2.32.0
14 changes: 14 additions & 0 deletions devel/binutils/files/patch-gold_testsuite_Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- gold/testsuite/Makefile.in.orig 2021-07-02 07:48:07 UTC
+++ gold/testsuite/Makefile.in
@@ -9585,9 +9585,9 @@ uninstall-am:
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ cp -f incr_comdat_test_2_v3.o incr_comdat_test_1_tmp.o
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie incr_comdat_test_1.o incr_comdat_test_1_tmp.o
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_1.o: exception_test_1.cc gcctestdir/as
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -Wa,-madd-bnd-prefix -o $@ $<
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_2.o: exception_test_2.cc gcctestdir/as
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -Wa,-madd-bnd-prefix -o $@ $<
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -o $@ $<
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@gnu_property_test.stdout: gnu_property_test
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -lhSWn $< >$@
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@gnu_property_test: gcctestdir/ld gnu_property_a.o gnu_property_b.o gnu_property_c.o
34 changes: 0 additions & 34 deletions devel/binutils/files/patch-libctf_swap.h

This file was deleted.

18 changes: 10 additions & 8 deletions devel/binutils/files/patch-mips64.diff
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,24 @@
# Generic vectors
targ_selvecs="${targ_selvecs} mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
;;
--- ld/configure.tgt.orig 2015-07-17 20:52:58.728911150 +0000
+++ ld/configure.tgt 2015-07-17 21:03:29.559869219 +0000
@@ -491,12 +491,12 @@
targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
targ_extra_libpath=$targ_extra_emuls ;;

--- ./ld/configure.tgt.orig 2021-01-09 19:47:34.000000000 +0900
+++ ./ld/configure.tgt 2021-05-13 16:24:16.129568000 +0900
@@ -548,13 +548,13 @@
targ_extra_libpath=$targ_extra_emuls
;;
mips64*el-*-freebsd* | mips64*el-*-kfreebsd*-gnu)
- targ_emul=elf32ltsmipn32_fbsd
- targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmip_fbsd elf32btsmip_fbsd elf32btsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd"
+ targ_emul=elf64ltsmip_fbsd
+ targ_extra_emuls="elf32ltsmip_fbsd elf32btsmip_fbsd elf32ltsmipn32_fbsd elf32btsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip"
targ_extra_libpath=$targ_extra_emuls ;;
targ_extra_libpath=$targ_extra_emuls
;;
mips64*-*-freebsd* | mips64*-*-kfreebsd*-gnu)
- targ_emul=elf32btsmipn32_fbsd
- targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmip_fbsd elf32btsmip_fbsd elf32ltsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd"
+ targ_emul=elf64btsmip_fbsd
+ targ_extra_emuls="elf32btsmip_fbsd elf32ltsmip_fbsd elf32btsmipn32_fbsd elf32ltsmipn32_fbsd elf64btsmip_fbsd elf64ltsmip_fbsd elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip"
targ_extra_libpath=$targ_extra_emuls ;;
targ_extra_libpath=$targ_extra_emuls
;;
mips*el-*-freebsd* | mips*el-*-kfreebsd*-gnu)
targ_emul=elf32ltsmip_fbsd
Loading

0 comments on commit a0e752d

Please sign in to comment.