git: 0dd2f4a0cca9 - main - libc: only export hesiod symbols when enabled

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Tue, 16 Apr 2024 21:14:39 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=0dd2f4a0cca9332784d6a233dee8d211517fe7ba

commit 0dd2f4a0cca9332784d6a233dee8d211517fe7ba
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2024-04-16 17:00:54 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2024-04-16 21:14:20 +0000

    libc: only export hesiod symbols when enabled
    
    Create a seperate symbol file for hesiod and conditionally include it.
    This allows linkage with --no-undefined-version.
    
    Differential Revision:  https://reviews.freebsd.org/D44184
---
 lib/libc/net/Makefile.inc      |  1 +
 lib/libc/net/Symbol.hesiod.map | 12 ++++++++++++
 lib/libc/net/Symbol.map        | 10 ----------
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/lib/libc/net/Makefile.inc b/lib/libc/net/Makefile.inc
index 1305500176a3..cd4ccaefac92 100644
--- a/lib/libc/net/Makefile.inc
+++ b/lib/libc/net/Makefile.inc
@@ -168,6 +168,7 @@ MLINKS+=sourcefilter.3 setipv4sourcefilter.3 \
 
 .if ${MK_HESIOD} != "no"
 SRCS+=	hesiod.c
+SYM_MAPS+=${LIBC_SRCTOP}/net/Symbol.hesiod.map
 MAN+=	hesiod.3
 MLINKS+=hesiod.3 hesiod_init.3 \
 	hesiod.3 hesiod_resolve.3 \
diff --git a/lib/libc/net/Symbol.hesiod.map b/lib/libc/net/Symbol.hesiod.map
new file mode 100644
index 000000000000..bb020c969ee9
--- /dev/null
+++ b/lib/libc/net/Symbol.hesiod.map
@@ -0,0 +1,12 @@
+FBSD_1.0 {
+	hesiod_init;
+	hesiod_end;
+	hesiod_to_bind;
+	hesiod_resolve;
+	hesiod_free_list;
+	hes_init;
+	hes_to_bind;
+	hes_resolve;
+	hes_error;
+	hes_free;
+};
diff --git a/lib/libc/net/Symbol.map b/lib/libc/net/Symbol.map
index 4831868c0e55..454ce8486986 100644
--- a/lib/libc/net/Symbol.map
+++ b/lib/libc/net/Symbol.map
@@ -54,16 +54,6 @@ FBSD_1.0 {
 	endservent;
 	getservent;
 	getservent_r;
-	hesiod_init;
-	hesiod_end;
-	hesiod_to_bind;
-	hesiod_resolve;
-	hesiod_free_list;
-	hes_init;
-	hes_to_bind;
-	hes_resolve;
-	hes_error;
-	hes_free;
 	htonl;
 	htons;
 	ntohl;