Undefined symbols on Solaris
Libor Bukata via xslt <[email protected]> Thu, 14 Feb 2019 14:43:04 +0100
| Newsgroups | gmane.comp.gnome.lib.xslt |
|---|---|
| Organization | Oracle Corporation |
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--------------1A19E291679AAAD384B33617
Content-Type: multipart/alternative;
boundary="------------388F1A508DA6D10232B8D4E9"
--------------388F1A508DA6D10232B8D4E9
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
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.
--------------388F1A508DA6D10232B8D4E9
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<pre>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.</pre>
</body>
</html>
--------------388F1A508DA6D10232B8D4E9--
--------------1A19E291679AAAD384B33617
Content-Type: text/x-patch;
name="undef_symbs.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="undef_symbs.patch"
From 29eb788d888c215ef7229b15792aac64c1f0139c Mon Sep 17 00:00:00 2001
From: Libor Bukata <[email protected]>
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
--------------1A19E291679AAAD384B33617
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
xslt mailing list, project page http://xmlsoft.org/XSLT/
[email protected]
https://mail.gnome.org/mailman/listinfo/xslt
--------------1A19E291679AAAD384B33617--