dante: Fix build with lld

getipnodebyname() and freehostent() are only interposed when the
platform has getipnodebyname(), which glibc and musl do not, but they
are always exported, so lld fails with:

  error: version script assignment of 'global' to symbol 'freehostent' failed: symbol not defined

Only export them when configure finds getipnodebyname().

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
Khem Raj committed 2026-11-11 22:46:09 -08:00
1 parent d64581f309
commit e4e972fe54
2 files changed
+41 -1

No files matched your search

@@ -0,0 +1,39 @@
From d873c1b2ddf6818e3f814ab7f9c1ae34fe3da847 Mon Sep 17 00:00:00 2001
From: Khem Raj <khem.raj@oss.qualcomm.com>
Date: Mon, 9 Nov 2026 08:37:30 -0800
Subject: [PATCH] Only export getipnodebyname and freehostent where they exist
dlib only interposes getipnodebyname() and freehostent() when the
platform has getipnodebyname() (Solaris), but they are always listed in
the exported symbols, so with glibc linkers that check the version
script, like lld, fail with:
error: version script assignment of 'global' to symbol 'freehostent' failed: symbol not defined
Leave them out of the symbol list when getipnodebyname() is not found.
Upstream-Status: Pending
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
mapfile.m4 | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/mapfile.m4 b/mapfile.m4
index 644a94b..5daa801 100644
--- a/mapfile.m4
+++ b/mapfile.m4
@@ -13,7 +13,13 @@ if test x"$sol64" = xt; then
PLDDIRS="$PLDDIRS dlib64/"
fi
for symdir in $PLDDIRS; do
- cat include/symbols_preload.txt >> $symdir/$MAPFILE
+ #getipnodebyname() and freehostent() are only interposed where they exist
+ if test x"$ac_cv_func_getipnodebyname" = xyes; then
+ cat include/symbols_preload.txt >> $symdir/$MAPFILE
+ else
+ grep -v -e '^freehostent$' -e '^getipnodebyname$' \
+ include/symbols_preload.txt >> $symdir/$MAPFILE
+ fi
#platform dependent symbols
case $host in
@@ -12,7 +12,8 @@ LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b3a8e7dc09bb720460f28c9d3796afa5"
SRC_URI = "https://www.inet.no/dante/files/dante-${PV}.tar.gz \
"
file://0001-Only-export-getipnodebyname-and-freehostent-where-th.patch \
"
SRC_URI[sha256sum] = "1973c7732f1f9f0a4c0ccf2c1ce462c7c25060b25643ea90f9b98f53a813faec"
# without --without-gssapi, config.log will contain reference to /usr/lib