Compilation error: mailconfigpage.cxx:(.text+0x3171): undefined reference to `non-virtual thunk to cppu::PartialWeakComponentImplHelper<com::sun::star::mail::XConnectionListener>::acquire()'

Stephan Bergmann sbergman at redhat.com
Fri Mar 22 07:42:58 UTC 2019


On 21/03/2019 23:11, David Rohr wrote:
> During compilation on gentoo linux 64 bit with GCC 8.3 of libreoffice
> 6.2.1.2 I get the following error:
> 
> mailconfigpage.cxx:(.text+0x3171): undefined reference to `non-virtual
> thunk to
> cppu::PartialWeakComponentImplHelper<com::sun::star::mail::XConnectionListener>::acquire()'
> 
> I can fix this by appending
> template class
> cppu::PartialWeakComponentImplHelper<com::sun::star::mail::XConnectionListener>;
> at the end of mailconfigpage.cxx
> 
> I filed a bug report here
> (https://bugs.documentfoundation.org/show_bug.cgi?id=124225) but was
> asked to write to the mailing list instead.

This looks like a compiler bug.  Any such thunks should be emitted 
weakly in mailconfigpage.o.  (What complicates things is that there can 
be thunks for that virtual function with different offsets, and while 
the offsets are encoded in the mangled symbol names, the demangled 
version is just "non-virtual thunk to ..." without a mention of the 
offset, and ld unhelpfully only reports the demangled name.)  For 
example, in my Linux x86-64 build, I have

> $ nm workdir/CxxObject/sw/source/ui/config/mailconfigpage.o | grep '_ZThn.*_N4cppu30PartialWeakComponentImplHelperIJN3com3sun4star4mail19XConnectionListenerEEE7acquireEv'
> 0000000000000000 W _ZThn32_N4cppu30PartialWeakComponentImplHelperIJN3com3sun4star4mail19XConnectionListenerEEE7acquireEv
> 0000000000000000 W _ZThn72_N4cppu30PartialWeakComponentImplHelperIJN3com3sun4star4mail19XConnectionListenerEEE7acquireEv
> 0000000000000000 W _ZThn80_N4cppu30PartialWeakComponentImplHelperIJN3com3sun4star4mail19XConnectionListenerEEE7acquireEv


More information about the LibreOffice mailing list