Opened 6 years ago

Last modified 6 years ago

#55988 new defect

xercesc3 @3.2.1: ld: duplicate symbol xercesc_3_2::ArrayJanitor<unsigned char>::ArrayJanitor(unsigned char*)in xercesc/util/.libs/TransService.o and xercesc/util/.libs/PlatformUtils.o

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: nerdling (Jeremy Lavergne)
Priority: Normal Milestone:
Component: ports Version:
Keywords: tiger leopard snowleopard Cc: scantor (Scott Cantor), rleigh-codelibre (Roger Leigh), MarcChenevier
Port: xercesc3

Description

xercesc3 @3.2.1 fails to build on Mac OS X Snow Leopard:

ld: duplicate symbol xercesc_3_2::ArrayJanitor<unsigned char>::ArrayJanitor(unsigned char*)in xercesc/util/.libs/TransService.o and xercesc/util/.libs/PlatformUtils.o

https://build.macports.org/builders/ports-10.6_x86_64_legacy-builder/builds/58003/steps/install-dependencies/logs/stdio

This is a new problem for 3.2.1; 3.2.0 built fine.

Attachments (1)

xercesc3.ppc.fail.log (500.8 KB) - added by kencu (Ken) 6 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 6 years ago by scantor (Scott Cantor)

I know there was a fix to an export somewhere but I wouldn't have expected it to affect anything but Windows. I'll try and find the commit/JIRA issue to link to. May be compiler specific since the last RC built for me on a Mac before the release was done. Or it's specific to that OS X version.

comment:2 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

It's definitely specific to Snow Leopard and earlier, probably due to the fact that those OS versions use gcc-4.2. It doesn't like redefinitions. I think clang is more forgiving of them.

comment:4 Changed 6 years ago by scantor (Scott Cantor)

I don't have non-current OS X access, so probably can't really verify a fix but I reopened the apparently regression-causing issue on the upstream side. A temp fix/patch is likely just reversing that change.

comment:5 Changed 6 years ago by rleigh-codelibre (Roger Leigh)

The change in question is https://github.com/apache/xerces-c/commit/d5cce44617374665e34458aa7cc22654c56e682a which on the face of it should be completely harmless. Template instantiations in different translation units should be elided by the linker, and I don't see anything particularly special about this helper function in this regard, or why the change should have made any difference.

I'd be cautious about reverting this change, because it resolves problems on contemporary platforms which have affected multiple users, while this platform and compiler are well out of support and are not as high a priority. However, if we can find a solution that works on all platforms and compilers, that would be great.

I no longer have a snow leopard system to investigate this in more detail. If anyone could provide me with shell access to one, I'd be happy to investigate in more detail.

Kind regards, Roger

comment:6 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: rleigh-codelibre added

I'm able to reproduce duplicate symbol errors on Sierra by using the MacPorts copy of the old Apple gcc-4.2 compiler:

sudo port -d build xercesc3 configure.compiler=apple-gcc-4.2

The apple-gcc42 port has a pre-fetch block that prevents its installation on Sierra or later; you can edit the port and remove that block to allow this testing. (sudo port edit apple-gcc42)

comment:7 Changed 6 years ago by scantor (Scott Cantor)

Roger, are you sure that's the change? I was referring to the other one to do with export of the ArrayJanitor template, I thought that was a different commit.

comment:8 Changed 6 years ago by rleigh-codelibre (Roger Leigh)

You're probably right. I'll take a closer look through the changes tomorrow, and also see if I can set up macports in a VM since my work mac is on homebrew.

comment:9 Changed 6 years ago by rleigh-codelibre (Roger Leigh)

The commit is SVN r1820126 as on the linked ticket: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/TransService.hpp?r1=1820126&r2=1820125&pathrev=1820126

I'll have to have a read up on Windows dllexport stuff to see how you are supposed to avoid this stuff leaking into multiple translation units.

Last edited 6 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:10 Changed 6 years ago by rleigh-codelibre (Roger Leigh)

Please see this patch: https://issues.apache.org/jira/secure/attachment/12913843/0001-Explicitly-export-ArrayJanitor-templates.patch

I've tested it on High Sierra with GCC 4.2, but I can't test it with Snow Leopard. If anyone could try building 3.2.1 with this patch, that would be appreciated.

Thanks, Roger

comment:11 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: MarcChenevier added

Has duplicate #56095.

comment:12 Changed 6 years ago by MarcChenevier

Yes thank you it is the same problem I see, but I don't know how build 3.2.1 with the patch of rleigh-codelibre with Snow Leopard, can you explain Thanks, Marc

comment:13 Changed 6 years ago by kencu (Ken)

Just reproduced this on 10.5.8 / PPC. Will try the provided patch. Log attached.

Changed 6 years ago by kencu (Ken)

Attachment: xercesc3.ppc.fail.log added

comment:14 Changed 6 years ago by kencu (Ken)

sadly, the patch from <https://trac.macports.org/ticket/55988#comment:10> didn't fix it.

Note: See TracTickets for help on using tickets.