Hello, during the compilation of libxstl-1.1.33 I encountered the following linkage error on Solaris.
CCLD xsltproc ld: warning: file /builds/lbukata/29251802.libxslt.ST/components/libxslt/build/i86/libxslt/.libs/libxslt.so: linked to ../libxslt/.libs/libxslt.so: attempted multiple inclusion of file Undefined first referenced symbol in file xsltCopyTree ../libxslt/.libs/libxslt.so xsltDefaultTrace ../libxslt/.libs/libxslt.so ld: fatal: symbol referencing errors It seems that xsltCopyTree and xsltDefaultTrace symbols defined in transform.c are required to build xsltproc binary. $ nm ./build/amd64/libxslt/.libs/libxslt.so | grep CopyTree [719] | 0| 0|NOTY |GLOB |0 |UNDEF |xsltCopyTree [230] | 276544| 1108|FUNC |LOCL |0 |20 |xsltCopyTree $ nm ./build/amd64/libxslt/.libs/libxslt.so | grep xsltDefaultTrace [402] | 0| 0|NOTY |GLOB |0 |UNDEF |xsltDefaultTrace [222] | 1367520| 8|OBJT |LOCL |0 |24 |xsltDefaultTrace I believe that the global symbols are undefined because they are declared as static. The proposed patch simply removes the static keywords to resolve this issue. Thanks.
>From 29eb788d888c215ef7229b15792aac64c1f0139c Mon Sep 17 00:00:00 2001 From: Libor Bukata <libor.buk...@oracle.com> Date: Thu, 14 Feb 2019 14:19:47 +0100 Subject: [PATCH] Resolve undefined symbols on Solaris. This patch fixes the error that occurs during the linkage phase of xsltproc binary. Symbols xsltCopyTree and xsltDefaultTrace cannot be externally referenced from libxslt.so library if they are defined as static. This patch simply removes the static keywords to fix the compilation issues. --- libxslt/transform.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libxslt/transform.c b/libxslt/transform.c index 1379391..3f26a7e 100644 --- a/libxslt/transform.c +++ b/libxslt/transform.c @@ -90,7 +90,7 @@ int xsltMaxVars = 15000; static xmlNsPtr xsltCopyNamespaceListInternal(xmlNodePtr node, xmlNsPtr cur); -static xmlNodePtr +xmlNodePtr xsltCopyTree(xsltTransformContextPtr ctxt, xmlNodePtr invocNode, xmlNodePtr node, xmlNodePtr insert, int isLRE, int topElemVisited); @@ -469,7 +469,7 @@ xsltGetXIncludeDefault(void) { return(xsltDoXIncludeDefault); } -static unsigned long xsltDefaultTrace = (unsigned long) XSLT_TRACE_ALL; +unsigned long xsltDefaultTrace = (unsigned long) XSLT_TRACE_ALL; /** * xsltDebugSetDefaultTrace: @@ -1618,7 +1618,7 @@ occupied: * * Returns a pointer to the new tree, or NULL in case of error */ -static xmlNodePtr +xmlNodePtr xsltCopyTree(xsltTransformContextPtr ctxt, xmlNodePtr invocNode, xmlNodePtr node, xmlNodePtr insert, int isLRE, int topElemVisited) -- 1.8.3.1
_______________________________________________ xslt mailing list, project page http://xmlsoft.org/XSLT/ xslt@gnome.org https://mail.gnome.org/mailman/listinfo/xslt