git: 3d3866a1abd5 - 2023Q3 - devel/binutils: fix build with lld 17

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Fri, 15 Sep 2023 14:08:52 UTC
The branch 2023Q3 has been updated by cy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3d3866a1abd528929cb6a357cd63402bdccc7b47

commit 3d3866a1abd528929cb6a357cd63402bdccc7b47
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-09-14 23:41:41 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2023-09-15 14:07:46 +0000

    devel/binutils: fix build with lld 17
    
    Some versioned symbols in libctf are undefined when libctf-nobfd.so is
    linked. Suppress errors with lld >= 17 due to these undefined symbols.
    
    PR:     273791
    MFH:    2023Q3
    (cherry picked from commit 495843badfe7d717f01466b9f41763524e670379)
---
 devel/binutils/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/devel/binutils/Makefile b/devel/binutils/Makefile
index 0530c4bbc988..ff17de61ebfd 100644
--- a/devel/binutils/Makefile
+++ b/devel/binutils/Makefile
@@ -39,6 +39,10 @@ CONFIGURE_ARGS+=	--disable-werror \
 MAKE_ARGS+=	LIBDL="" V=1
 MAKE_ENV+=	ac_cv_func_sbrk=0
 
+# Some versioned symbols in libctf are undefined when libctf-nobfd.so is linked.
+# Suppress errors with lld >= 17 due to these undefined symbols.
+LDFLAGS+=	-Wl,--undefined-version
+
 # Tests will always fail because --compress-debug-sections is always set to
 # zlib-gabi regardless of the compression setting by ./configure.
 # TEST_TARGET=	check