git: fb389b02e81f - main - devel/tevent: fix build with lld 17

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sun, 15 Oct 2023 15:45:36 UTC
The branch main has been updated by dim:

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

commit fb389b02e81f0500376d29bbd80fa61ba4bb6e40
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-09-28 17:23:16 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-10-15 15:44:42 +0000

    devel/tevent: fix build with lld 17
    
    Building devel/tevent with lld 17 results in the following link errors:
    
      11:57:46 runner ['cc', '-Wl,--version-script=/wrkdirs/usr/ports/devel/tevent/work/tevent-0.13.0/bin/default/tevent.vscript', '-shared', '-Wl,-h,libtevent.so.0', 'lib/replace/replace.c.2.o', 'lib/replace/strptime.c.2.o', 'lib/replace/xattr.c.2.o', 'tevent.c.1.o', 'tevent_debug.c.1.o', 'tevent_fd.c.1.o', 'tevent_immediate.c.1.o', 'tevent_queue.c.1.o', 'tevent_req.c.1.o', 'tevent_wrapper.c.1.o', 'tevent_poll.c.1.o', 'tevent_threads.c.1.o', 'tevent_signal.c.1.o', 'tevent_standard.c.1.o', 'tevent_timed.c.1.o', 'tevent_util.c.1.o', 'tevent_wakeup.c.1.o', '-o/wrkdirs/usr/ports/devel/tevent/work/tevent-0.13.0/bin/default/libtevent.so', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-L/usr/local/lib', '-ltalloc', '-lpthread', '-fstack-protector-strong', '-Wl,-no-undefined']
      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.
    
    PR:             274147
    Approved by:    maintainer timeout (2 weeks)
    MFH:            2023Q4
---
 devel/tevent/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/devel/tevent/Makefile b/devel/tevent/Makefile
index e9f08adf4ef0..b270fe5d1203 100644
--- a/devel/tevent/Makefile
+++ b/devel/tevent/Makefile
@@ -55,6 +55,10 @@ CFLAGS+=			${CFLAGS_${CHOSEN_COMPILER_TYPE}}
 CFLAGS_clang=			-fno-color-diagnostics
 CONFIGURE_ENV+=			NOCOLOR=yes
 MAKE_ENV+=			NOCOLOR=yes
+# Some symbols in tevent'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
 
 post-patch:
 				@${REINPLACE_CMD} -e 's|%%PKGCONFIGDIR%%|${PKGCONFIGDIR}|g' \