GNOME Bugzilla – Bug 595789
Compilation of 2.7.4 fails using GCC 3.4.6 under Solaris 10/SPARC due to symbol version issue
Last modified: 2011-03-19 14:00:58 UTC
Compiling libxml2 2.7.4 on Sol 10/SPARC using GCC 3.4.6 fails with symbol version error. Assuming this is due to introduction of symbol versioning in 2.7.4. Any suggestions on how to overcome this issue are appreciated. Thanks in advance: libtool: link: gcc -shared -Wl,-z -Wl,text -Wl,-h -Wl,libxml2.so.2 -o .libs/libxml2.so.2.7.4 .libs/SAX.o .libs/entities.o .libs/encoding.o .libs/error.o .libs/parserInternals.o .libs/parser.o .libs/tree.o .libs/hash.o .libs/list.o .libs/xmlIO.o .libs/xmlmemory.o .libs/uri.o .libs/valid.o .libs/xlink.o .libs/HTMLparser.o .libs/HTMLtree.o .libs/debugXML.o .libs/xpath.o .libs/xpointer.o .libs/xinclude.o .libs/nanohttp.o .libs/nanoftp.o .libs/DOCBparser.o .libs/catalog.o .libs/globals.o .libs/threads.o .libs/c14n.o .libs/xmlstring.o .libs/xmlregexp.o .libs/xmlschemas.o .libs/xmlschemastypes.o .libs/xmlunicode.o .libs/xmlreader.o .libs/relaxng.o .libs/dict.o .libs/SAX2.o .libs/xmlwriter.o .libs/legacy.o .libs/chvalid.o .libs/pattern.o .libs/xmlsave.o .libs/xmlmodule.o .libs/schematron.o -R/usr/local/lib -R/usr/local/lib -R/usr/local/lib/lib -lpthread -L/usr/local/lib/lib -lz /usr/local/lib/libiconv.so -L/usr/local/lib -L/usr/lib -L/usr/openwin/lib -L/usr/local/ssl/lib -L/usr/local/BerkeleyDB.4.2/lib -lm -lsocket -lnsl -lc -Wl,-M -Wl,./libxml2.syms Undefined first referenced symbol in file _fini /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/crti.o (symbol has no version assigned) _init /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/crti.o (symbol has no version assigned) __xmlErrEncoding .libs/parserInternals.o (symbol has no version assigned) __xmlSubstituteEntitiesDefaultValue .libs/globals.o (symbol has no version assigned) __xmlBufferAllocScheme .libs/globals.o (symbol has no version assigned) __xmlRegisterNodeDefaultValue .libs/globals.o (symbol has no version assigned) __xmlLoaderErr .libs/xmlIO.o (symbol has no version assigned) xmlGenericErrorDefaultFunc .libs/error.o (symbol has no version assigned) __xmlDefaultSAXLocator .libs/globals.o (symbol has no version assigned) __xmlPedanticParserDefaultValue .libs/globals.o (symbol has no version assigned) __dso_handle /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/crtbegin.o (symbol has no version assigned) __xmlIOErr .libs/xmlIO.o (symbol has no version assigned) __xmlParserInputBufferCreateFilenameValue .libs/globals.o (symbol has no version assigned) __xmlStructuredError .libs/globals.o (symbol has no version assigned) __xmlLineNumbersDefaultValue .libs/globals.o (symbol has no version assigned) __xmlGenericErrorContext .libs/globals.o (symbol has no version assigned) __xmlSimpleError .libs/error.o (symbol has no version assigned) __xmlStructuredErrorContext .libs/globals.o (symbol has no version assigned) __xmlOutputBufferCreateFilename .libs/xmlIO.o (symbol has no version assigned) __xmlRaiseError .libs/error.o (symbol has no version assigned) xmlAutomataSetFlags .libs/xmlregexp.o (symbol has no version assigned) xmlXPtrAdvanceNode .libs/xpointer.o (symbol has no version assigned) __xmlGetWarningsDefaultValue .libs/globals.o (symbol has no version assigned) htmlDecodeEntities .libs/legacy.o (symbol has no version assigned) __xmlDoValidityCheckingDefaultValue .libs/globals.o (symbol has no version assigned) __xmlDeregisterNodeDefaultValue .libs/globals.o (symbol has no version assigned) __xmlGlobalInitMutexUnlock .libs/threads.o (symbol has no version assigned) xmlMallocBreakpoint .libs/xmlmemory.o (symbol has no version assigned) _lib_version /usr/ccs/lib/values-Xa.o (symbol has no version assigned) __xmlGlobalInitMutexDestroy .libs/threads.o (symbol has no version assigned) xmlAllocOutputBufferInternal .libs/xmlIO.o (symbol has no version assigned) xmlDllMain ./libxml2.syms xmlUpgradeOldNs .libs/legacy.o (symbol has no version assigned) __xmlParserVersion .libs/globals.o (symbol has no version assigned) __xmlLastError .libs/globals.o (symbol has no version assigned) xmlNsListDumpOutput .libs/xmlsave.o (symbol has no version assigned) __xmlLoadExtDtdDefaultValue .libs/globals.o (symbol has no version assigned) __xmlOutputBufferCreateFilenameValue .libs/globals.o (symbol has no version assigned) xmlCharEncFirstLineInt .libs/encoding.o (symbol has no version assigned) __xmlDefaultBufferSize .libs/globals.o (symbol has no version assigned) __docbDefaultSAXHandler .libs/globals.o (symbol has no version assigned) __xmlIndentTreeOutput .libs/globals.o (symbol has no version assigned) __xmlRegisterCallbacks .libs/tree.o (symbol has no version assigned) __xmlSaveNoEmptyTags .libs/globals.o (symbol has no version assigned) __xmlParserInputBufferCreateFilename .libs/xmlIO.o (symbol has no version assigned) __xmlGlobalInitMutexLock .libs/threads.o (symbol has no version assigned) __htmlDefaultSAXHandler .libs/globals.o (symbol has no version assigned) __xmlDefaultSAXHandler .libs/globals.o (symbol has no version assigned) __oldXMLWDcompatibility .libs/globals.o (symbol has no version assigned) __xmlTreeIndentString .libs/globals.o (symbol has no version assigned) __htmlParseContent .libs/HTMLparser.o (symbol has no version assigned) __xmlGenericError .libs/globals.o (symbol has no version assigned) __xmlParserDebugEntities .libs/globals.o (symbol has no version assigned) __xmlKeepBlanksDefaultValue .libs/globals.o (symbol has no version assigned) ld: fatal: Symbol referencing errors. No output written to .libs/libxml2.so.2.7.4
I don't understand what this means. And I especially don't understand how libxml2 could provide version info for symbols coming from the compiler own crti.o for exanmple. Check with the OS provider, I can't solve this myself. Daniel
Hello Daniel. Well, all that I know is that 2.7.3 compiles just fine in the same environment. So something was changed in 2.7.4 that directly or indirectly is resulting in this problem. Thanks for your time.
yes symbol versioning has been added in 2.7.4 based on code from libvirt which is working on Linux and Solaris. It works apparently fine for various gcc versions on Linux, I have no Sun box to test so I will need external input or patches to fixes things if broken. Daniel
Note this issue also exists on x86-64 Solaris 10 (5.10 Generic_138889-03), using gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath). This is using the default Solaris ld. libtool: link: cc -G -h libxml2.so.2 -o .libs/libxml2.so.2.7.5 .libs/SAX.o .lib s/entities.o .libs/encoding.o .libs/error.o .libs/parserInternals.o .libs/parser .o .libs/tree.o .libs/hash.o .libs/list.o .libs/xmlIO.o .libs/xmlmemory.o .libs/ uri.o .libs/valid.o .libs/xlink.o .libs/HTMLparser.o .libs/HTMLtree.o .libs/debu gXML.o .libs/xpath.o .libs/xpointer.o .libs/xinclude.o .libs/nanohttp.o .libs/na noftp.o .libs/DOCBparser.o .libs/catalog.o .libs/globals.o .libs/threads.o .libs /c14n.o .libs/xmlstring.o .libs/xmlregexp.o .libs/xmlschemas.o .libs/xmlschemast ypes.o .libs/xmlunicode.o .libs/xmlreader.o .libs/relaxng.o .libs/dict.o .libs/S AX2.o .libs/xmlwriter.o .libs/legacy.o .libs/chvalid.o .libs/pattern.o .libs/xml save.o .libs/xmlmodule.o .libs/schematron.o -lz -lm -lsocket -lnsl -lc -Wl,-M -Wl,./libxml2.syms Undefined first referenced symbol in file .XBKEKR_DLxyKmSP.xmlParserInputShrink.__func__ .libs/parserInternals.o (symbol has no version assigned) .XBKEKR_nLxyKW3R.xmlSchemaCheckDerivationOKRestriction2to4.__func__ .libs/xmlsch emas.o (symbol has no version assigned) .XBKEKR_ELxyKmYP.xmlParseBalancedChunkMemoryRecover.__func__ .libs/parser.o (sy mbol has no version assigned) .XBKEKR_PLxyKmOQ.xmlCopyElement.__func__ .libs/valid.o (symbol has no version a ssigned) .XBKEKR_xbxyKGkU.xmlSAX2GetLineNumber.__func__ .libs/SAX2.o (symbol has no vers ion assigned) .XAKEKR_WLxyKGtQ.rcsid .libs/xpath.o (symbol has no version assign ed) etc. etc. etc.
Sorry, above comment includes the output using cc, not gcc. However, gcc also fails. For information, version of ld is # ld -V ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.490 libtool: link: gcc -shared -Wl,-z -Wl,text -Wl,-h -Wl,libxml2.so.2 -o .libs/libxml2.so.2.7.5 .libs/SAX.o .libs/entities.o .libs/encoding.o .libs/error.o .libs/parserInternals.o .libs/parser.o .libs/tree.o .libs/hash.o .libs/list.o .libs/xmlIO.o .libs/xmlmemory.o .libs/uri.o .libs/valid.o .libs/xlink.o .libs/HTMLparser.o .libs/HTMLtree.o .libs/debugXML.o .libs/xpath.o .libs/xpointer.o .libs/xinclude.o .libs/nanohttp.o .libs/nanoftp.o .libs/DOCBparser.o .libs/catalog.o .libs/globals.o .libs/threads.o .libs/c14n.o .libs/xmlstring.o .libs/xmlregexp.o .libs/xmlschemas.o .libs/xmlschemastypes.o .libs/xmlunicode.o .libs/xmlreader.o .libs/relaxng.o .libs/dict.o .libs/SAX2.o .libs/xmlwriter.o .libs/legacy.o .libs/chvalid.o .libs/pattern.o .libs/xmlsave.o .libs/xmlmodule.o .libs/schematron.o -lz -lm -lsocket -lnsl -lc -Wl,-M -Wl,./libxml2.syms Undefined first referenced symbol in file _fini /usr/lib/crti.o (symbol has no version assigned) _init /usr/lib/crti.o (symbol has no version assigned) __xmlErrEncoding .libs/parserInternals.o (symbol has no version assigned) __xmlSubstituteEntitiesDefaultValue .libs/globals.o (symbol has no version assigned) __xmlBufferAllocScheme .libs/globals.o (symbol has no version assigned) __xmlRegisterNodeDefaultValue .libs/globals.o (symbol has no version assigned) __xmlLoaderErr .libs/xmlIO.o (symbol has no version assigned) xmlGenericErrorDefaultFunc .libs/error.o (symbol has no version assigned) __xmlDefaultSAXLocator .libs/globals.o (symbol has no version assigned) __xmlPedanticParserDefaultValue .libs/globals.o (symbol has no version assigned)
Ask Sun or someone to provide a patch, I can't fix that myself as this makes zero sense to me, especially problems coming from /usr/lib/crti.o ! Daniel
Created attachment 146865 [details] [review] VERSION_SCRIPT_FLAGS
Comment on attachment 146865 [details] [review] VERSION_SCRIPT_FLAGS I encountered similar errors compiling libxml2-2.7.6 using pkgsrc under solaris10.
*yay* thanks for the patch. Could any of the reporter (Stanley?, Chris?) test it and report back?
We rolled back to use an older version of libxml2. The application we were using it for is leaving us so we may not be able to do tests for this. I will try however.
Okay the current git seems to have fixed that part of the code though I was still able to find a test -n and replace it with test -z as in your patch, thanks ! Daniel
(Since this patch has been reverted, this bug report should be reopened) In fact the libvirt check is quite different; in this particular case VERSION_SCRIPT_FLAGS would be set to '-Wl,--version-script=' instead of '-Wl,-M -Wl,'.
This part of the patch *reverse* the results of the symbol versioning test, which means that it's now off on linux and solaris, and on for everything else (where it probably doesn't compile at all). - if test -n "$VERSION_SCRIPT_FLAGS"; then + if test -z "$VERSION_SCRIPT_FLAGS"; then I reverted this in my local builds and symbol versioning is back to working properly on Solaris and Linux w/GNU ld on both.