git: 637ee716d9ee - main - net/samba416: Fix build with lld 17

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Sat, 30 Dec 2023 07:17:02 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=637ee716d9ee3d36fbd6c4944a937806cd1b4608

commit 637ee716d9ee3d36fbd6c4944a937806cd1b4608
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2023-12-30 05:52:53 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-12-30 07:16:43 +0000

    net/samba416: Fix build with lld 17
    
    Building net/samba416 with lld 17 results in the following link errors:
    
    runner ['cc', '-Wl,--as-needed', '-Wl,--version-script=/wrkdirs/share/dim/ports/net/samba413/work/samba-4.13.17/bin/default/lib/replace/replace.vscript', '-shared', 'lib/replace/replace.c.2.o', 'lib/replace/strptime.c.2.o', 'lib/replace/cwrap.c.2.o', 'lib/replace/xattr.c.2.o', '-o/wrkdirs/share/dim/ports/net/samba413/work/samba-4.13.17/bin/default/lib/replace/libreplace-samba4.so', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-L/usr/local/lib', '-L/usr/local/lib', '-fstack-protector-strong', '-L/usr/local/lib', '-Wl,-z,relro,-z,now', '-Wl,-no-undefined', '-Wl,--export-dynamic']
    ld: error: version script assignment of 'local' to symbol '_end' failed: symbol not defined
    ld: error: version script assignment of 'local' to symbol '__bss_start' failed: symbol not defined
    ld: error: version script assignment of 'local' to symbol '_edata' failed: symbol not defined
    cc: error: linker command failed with exit code 1 (use -v to see invocation)
    
    Since the linker version scripts are generated dynamically, suppress
    errors with lld >= 17 due to these undefined symbols.
    
    Same patch from 8bc0f1e by dim@ to unbreak build on FreeBSD 15.
    
    This is required as the DEFAULT version of sambe is being switched.
    
    Approved by:    portmgr (blanket)
---
 net/samba416/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/samba416/Makefile b/net/samba416/Makefile
index 91962ceac147..3509bbf20e90 100644
--- a/net/samba416/Makefile
+++ b/net/samba416/Makefile
@@ -558,6 +558,10 @@ MAKE_ENV+=			RPCGEN_CPP="${CPP}"
 #.if ${readline_ARGS} == port
 #CFLAGS+=			-D_FUNCTION_DEF
 #.endif
+# Some symbols in samba's linker version scripts are not defined, but since the
+# scripts are generated dynamically, suppress errors with lld >= 17 due to these
+# undefined symbols.
+LDFLAGS+=			-Wl,--undefined-version
 
 SAMBA4_SUB=			SAMBA4_LOGDIR="${SAMBA4_LOGDIR}" \
 				SAMBA4_RUNDIR="${SAMBA4_RUNDIR}" \