git: 2b7869778cf1 - main - security/gnutls: fix build with lld 17

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Mon, 26 Feb 2024 08:31:44 UTC
The branch main has been updated by bapt:

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

commit 2b7869778cf1e412eb3f7940e43a4a393bfd4a68
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2024-02-26 08:27:12 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2024-02-26 08:31:17 +0000

    security/gnutls: fix build with lld 17
    
    Since lld17 the default is to have the LDFLAGS --no-undefined-version
    activated by default, which means that versions scripts should not
    contain undefined symbols
    
    2 bugs in gnutls:
    1/ the configure scripts tests an empty binary against a list of version
    symbols, meaning it breaks in configure (hence the activation of
    --enable-ld-version-scripts) which means currently provided gnutls
    packages are build without version scripts which breaks existing
    installations...
    2/ the version script used to link the binary can contain undefined
    symbols depending on the options used to build (hence the addition of
    the LDFLAGS.
---
 security/gnutls/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/security/gnutls/Makefile b/security/gnutls/Makefile
index 5a7a38512a6a..e50fc1de0620 100644
--- a/security/gnutls/Makefile
+++ b/security/gnutls/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	gnutls
 PORTVERSION=	3.7.10
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	security net
 MASTER_SITES=	GNUPG/gnutls/v${PORTVERSION:R}
 
@@ -31,7 +31,9 @@ CONFIGURE_ARGS=	--disable-guile \
 		--without-brotli \
 		--without-zstd \
 		--without-tpm \
-		--without-tpm2
+		--without-tpm2 \
+		--enable-ld-version-script
+LDFLAGS=	-Wl,--undefined-version
 MAKE_ENV=	MAKEINFOFLAGS=--no-split
 INSTALL_TARGET=	install-strip
 TEST_TARGET=	check