Opened 4 years ago

Closed 2 years ago

#61041 closed defect (fixed)

icu @67.1_2: ld: duplicate symbol icu_67::number::NumberFormatterSettings<icu_67::number::UnlocalizedNumberFormatter>::copyErrorTo(UErrorCode&) const in number_skeletons.o and number_fluent.o

Reported by: kencu (Ken) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: tiger leopard Cc:
Port: icu

Description (last modified by kencu (Ken))

Tiger and Leopard PPC, building with gcc6 or gcc7:

ld: duplicate symbol icu_67::number::NumberFormatterSettings<icu_67::number::UnlocalizedNumberFormatter>::copyErrorTo(UErrorCode&) const in number_skeletons.o and number_fluent.o
collect2: error: ld returned 1 exit status
gnumake[1]: *** [../lib/libicui18n.67.1.dylib] Error 1

Attachments (2)

icu-tiger-fail.log (404.2 KB) - added by kencu (Ken) 4 years ago.
icu-gcc7-x86_64.log (728.3 KB) - added by kencu (Ken) 4 years ago.

Download all attachments as: .zip

Change History (15)

Changed 4 years ago by kencu (Ken)

Attachment: icu-tiger-fail.log added

comment:1 Changed 4 years ago by kencu (Ken)

Description: modified (diff)
Keywords: leopard added

comment:2 Changed 4 years ago by kencu (Ken)

Same error on 10.5 PPC.

comment:3 Changed 4 years ago by kencu (Ken)

I am still not able to get past this error -- it has to do with c++ templates being instantiated in multiple cpp files. Apparently somehow this can work, but not with gcc7 on Tiger or Leopard it doesn't.

If anyone has any insight into this magic, love to hear about it. Probably only Michael or Ionic know enough c++ to work through this one.

In the meantime, all I can think of to do is roll back to icu @65 pending some kind of resolution. That is what I've done in my own repos...

comment:4 Changed 4 years ago by kencu (Ken)

For the curious, the issue appear to involve this bit of code:

<https://github.com/unicode-org/icu/blob/7c8f857da820506b061604db21a6bbd3ec908f0f/icu4c/source/i18n/number_skeletons.cpp#L1705>

which takes you to this explanation:

<https://stackoverflow.com/a/495056/1407170>

and this bit of c++ wisdom:

<https://isocpp.org/wiki/faq/templates#templates-defn-vs-decl>

which is causing the symbols to be multiply defined, and the linker to (therefore) barf.

comment:5 Changed 4 years ago by kencu (Ken)

Just to be a bit frustrating, it seems to build fine with gcc7 on x86_64 on MacOS 10.14.

Changed 4 years ago by kencu (Ken)

Attachment: icu-gcc7-x86_64.log added

comment:6 Changed 4 years ago by rmottola (Riccardo)

Hmm... so you have it on tiger&leopard with gcc, but not 10.14 One test would be gcc x86 on 10.4/10.5 - maybe the code path is different on newer OS and not used? My C++ foo is weak,

comment:7 Changed 4 years ago by rmottola (Riccardo)

I found this reference bug in ICU

https://unicode-org.atlassian.net/browse/ICU-20455

However, in the suggested file I don't find template classes, but direct implementations, so I could not add any external keyword (even if the article you mention suggests extern templates are useless/ignored)

so... I just asked unicode, let's see https://unicode-org.atlassian.net/browse/ICU-21439

comment:8 Changed 4 years ago by kencu (Ken)

I did work around this once -- unfortunately I did not write down all the steps, but I recall the solution was here <https://isocpp.org/wiki/faq/templates#separate-template-fn-defn-from-decl> and I believe I did one of the two recommended fixes.

I'll see if I can recreate what I did ... it was a few months ago.

comment:9 Changed 4 years ago by kencu (Ken)

Owner: set to kencu
Status: newaccepted

comment:10 Changed 3 years ago by kencu (Ken)

Owner: kencu deleted
Status: acceptedassigned

comment:11 Changed 2 years ago by catap (Kirill A. Korinsky)

Ken, is it still relevant?

comment:12 Changed 2 years ago by kencu (Ken)

No, haven't seen this one in a while, happy to say. Not sure what fixed it, but ...

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

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.