https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63622

--- Comment #9 from howarth at bromo dot med.uc.edu ---
The darwin linker developer's analysis of this failing linkage is as follows...

That link line contains “-undefined dynamic_lookup” which is almost always a
bad idea.  Removing it shows the problem.  The symbol __ZTCSt9strstream16_So is
not defined in an object file.  So that option means “assume it will be in some
dylib (DSO) at runtime).  But the function __ZNSt9strstreamC1Ev contains:

__ZNSt9strstreamC1Ev:
...
0000000000001f75    leaq    __ZTCSt9strstream16_So+24(%rip), %rax
…

That code gen requires the target vtable to be in the same linkage unit, but is
is in DSO.  The only way to possible make it work is to have a text relocation
which adjusts the LEA at launch time.  But darwin x86_64 does not support text
relocations.

You should remove the “-undefined dynamic_lookup” from the link line and fix
the build to have all required symbols defined.

Reply via email to