git: 5012011fb0bf - main - devel/binutils: Update from 2.39 to 2.40

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Fri, 24 Feb 2023 15:04:20 UTC
The branch main has been updated by cy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5012011fb0bfe69838c6526ece932e9225b7b5b4

commit 5012011fb0bfe69838c6526ece932e9225b7b5b4
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2023-02-14 15:30:25 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2023-02-24 15:00:43 +0000

    devel/binutils: Update from 2.39 to 2.40
    
    Update our binutils port from 2.39 to 2.40.
    
    Enable zstd support. Depend on the port in case the port is newer
    than base.
    
    Additional contributions by dizzy@:
    
    - Use DISTVERSION instead of PORTVERSION
    - Drop (reset) PORTREVISION
    - Define zstd as LIB_DEPENDS rather than DEPENDS
    - Add USES= localbase pkgconfig to fix (lib)zstd detection
    - Set zstd as default compression algorithm for compressed debug
      sections
    - Enable verbose output during build
    - Drop STATIC option, it's unsupported upstream and fails to build
    
    Also, disable tests because --compress-debug-sections is always set
    to zlib-gabi regardless of the compression setting by ./configure,
    resulting in failure.
    
    Exp-run PR:     268994
    Exp-run by:     antoine
---
 devel/binutils/Makefile                            | 24 ++++++++++++++--------
 devel/binutils/distinfo                            |  6 +++---
 .../files/patch-gold_testsuite_Makefile.in         | 14 -------------
 devel/binutils/pkg-plist                           |  7 +++++--
 4 files changed, 23 insertions(+), 28 deletions(-)

diff --git a/devel/binutils/Makefile b/devel/binutils/Makefile
index a7db40351340..2e773537d046 100644
--- a/devel/binutils/Makefile
+++ b/devel/binutils/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	binutils
-PORTVERSION=	2.39
+DISTVERSION=	2.40
 PORTEPOCH?=	1
 CATEGORIES?=	devel
 MASTER_SITES=	SOURCEWARE/binutils/releases
@@ -16,12 +16,14 @@ 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 libtool makeinfo perl5 tar:lz
+USES=		bison:alias compiler:env cpe gmake localbase libtool makeinfo perl5 pkgconfig tar:lz
 USE_PERL5=	build
 CPE_VENDOR=	gnu
 GNU_CONFIGURE=	yes
@@ -30,21 +32,24 @@ GNU_CONFIGURE=	yes
 CONFIGURE_ARGS+=	--disable-werror \
 			--enable-deterministic-archives \
 			--with-sysroot=/ \
-			--enable-x86-relax-relocations=no
-MAKE_ARGS+=	LIBDL=""
+			--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
-TEST_TARGET=	check
+
+# 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 STATIC
+OPTIONS_DEFINE=	NLS RELRO
 OPTIONS_SUB=	yes
-STATIC_PREVENTS=	NLS
 
 RELRO_DESC=	Enable relocation memory corruption mitigation (-z relro) by default
 RELRO_CONFIGURE_ON=	--enable-relro
 RELRO_CONFIGURE_OFF=	--enable-relro=no
-STATIC_LDFLAGS+=	-all-static
 NLS_USES=	gettext
 NLS_CONFIGURE_ENABLE=	nls
 
@@ -102,7 +107,8 @@ INFO=		as \
 		ctf-spec \
 		gprof \
 		bfd \
-		ld
+		ld \
+		sframe-spec
 .endif
 
 .include <bsd.port.pre.mk>
diff --git a/devel/binutils/distinfo b/devel/binutils/distinfo
index 29906643c282..14280232a4b2 100644
--- a/devel/binutils/distinfo
+++ b/devel/binutils/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1660760045
-SHA256 (binutils-2.39.tar.lz) = 5ab51668874d8533201b8edd2edb5e5d81d588205c6da300c8919bd7cf8664e8
-SIZE (binutils-2.39.tar.lz) = 24759528
+TIMESTAMP = 1673799644
+SHA256 (binutils-2.40.tar.lz) = 48e65ecee1bbcf334d7efb4ea8487fe048dea522e5da3bdf7fa42b1ec779ea33
+SIZE (binutils-2.40.tar.lz) = 24784952
diff --git a/devel/binutils/files/patch-gold_testsuite_Makefile.in b/devel/binutils/files/patch-gold_testsuite_Makefile.in
deleted file mode 100644
index 2f8a15371a24..000000000000
--- a/devel/binutils/files/patch-gold_testsuite_Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
---- 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
diff --git a/devel/binutils/pkg-plist b/devel/binutils/pkg-plist
index 71a7c06f83ac..aa64c3d08214 100644
--- a/devel/binutils/pkg-plist
+++ b/devel/binutils/pkg-plist
@@ -23,13 +23,15 @@ 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
-%%STATIC%%lib/bfd-plugins/libdep.a
-%%NO_STATIC%%lib/bfd-plugins/libdep.so
+lib/bfd-plugins/libdep.so
 lib/libbfd.a
 lib/libctf-nobfd.a
 lib/libctf.a
 lib/libopcodes.a
+lib/libsframe.a
 man/man1/addr2line.1.gz
 man/man1/ar.1.gz
 man/man1/as.1.gz
@@ -111,6 +113,7 @@ man/man1/strip.1.gz
 %%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%%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