a few c++ object files fail to be linked when compiled with -Os optimization option of gcc

Jérôme Bouat jerome.bouat at laposte.net
Fri Dec 27 18:15:59 UTC 2024


Hello.

With the master branch, a configuration with the following arguments of "autogen.sh" fails to build :
./autogen.sh [...] CFLAGS="-pipe -Os" CXXFLAGS="-pipe -Os"

I get the bellow error :
/usr/bin/ld : /home/d/tmp/lo/workdir/CxxObject/xmloff/source/core/xmlimp.o : dans la fonction « SvXMLImport::SetAutoStyles(SvXMLStylesContext*) » :
xmlimp.cxx:(.text+0x8a3f) : référence indéfinie vers « non-virtual thunk to cppu::WeakImplHelper<com::sun::star::xml::sax::XFastAttributeList, com::sun::star::util::XCloneable>::acquire() »

Next I commented the content of the method definition. Then I could compile further.

Only a few source files are concerned by this problem.

If I :
1. make clean
2. restore the files to the master version (git restore --source=master xmloff/source/core/xmlimp.cxx)
3. check that my local files have no difference (git diff)
4. run again autogen.sh without my CFLAGS and CXXFLAGS arguments.

Then it properly builds.

Below is my gcc C++ compiler version :
~$ g++ --version | head -1
g++ (Debian 12.2.0-14) 12.2.0
~$


More information about the LibreOffice mailing list