Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 664170 - app-office/libreoffice-6.0.3.2: buiild failure with -O1: libswuilo.so final link failed; recompile with -fPIC
Summary: app-office/libreoffice-6.0.3.2: buiild failure with -O1: libswuilo.so final l...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Office Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-21 10:33 UTC by paradox_ptr
Modified: 2020-11-28 17:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
archived libreoffice emerge build.log (build.log.7z,419.39 KB, application/x-7z-compressed)
2018-08-21 10:33 UTC, paradox_ptr
Details
emerge environment (environment,247.23 KB, text/plain)
2018-08-21 10:34 UTC, paradox_ptr
Details
emerge info (emerge_info,6.82 KB, text/plain)
2018-08-21 10:35 UTC, paradox_ptr
Details
libreoffice-6.0.6.2 build.log (build_6.0.6.2.log.7z,419.99 KB, application/x-7z-compressed)
2018-08-23 05:03 UTC, paradox_ptr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description paradox_ptr 2018-08-21 10:33:52 UTC
Created attachment 544248 [details]
archived libreoffice emerge build.log

Emerge libreoffice fails at linkage. Profile is linux/amd64/17.0.
Strange thing is that I already have the same version of libreoffice installed, and the last time it got built without trouble:

$ eix libreoffice$
[I] app-office/libreoffice
     Installed versions:  6.0.3.2(09:48:33 PM 06/23/2018)(branding cups gtk -bluetooth -coinmp -dbus -debug -eds -firebird -googledrive -gstreamer -gtk2 -java -jemalloc -kde -libressl -mysql -odk -pdfimport -postgres -test -vlc ELIBC="-FreeBSD" LIBREOFFICE_EXTENSIONS="-nlpsolver -scripting-beanshell -scripting-javascript -wiki-publisher" PYTHON_SINGLE_TARGET="python3_6 -python2_7 -python3_4 -python3_5" PYTHON_TARGETS="python2_7 python3_6 -python3_4 -python3_5")

Attached log is from rebuilding it with USE=+dbus, but same exact problem occurs   at the same place if I do plain
# emerge -1 libreoffice

revdep-rebuild shows that the system is consistent, and I have rebuilt @world at least once since switching to 17.0 profile.

build.log attached.

/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/app-office/libreoffice-6.0.3.2/work/libreoffice-6.0.3.2/workdir/CxxObject/sw/source/ui/config/mailconfigpage.o: warning: relocation agai      nst `_ZThn80_N4cppu30PartialWeakComponentImplHelperIJN3com3sun4star4mail19XConnectionListenerEEE7acquireEv' in read-only section `.text'
/var/tmp/portage/app-office/libreoffice-6.0.3.2/work/libreoffice-6.0.3.2/workdir/CxxObject/sw/source/ui/config/mailconfigpage.o: In function `SwTestAccountSettingsDialog::Test()':
mailconfigpage.cxx:(.text+0x4726): undefined reference to `non-virtual thunk to cppu::PartialWeakComponentImplHelper<com::sun::star::mail::XConnectionListener>::acquire()'
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/app-office/libreoffice-6.0.3.2/work/libreoffice-6.0.3.2/workdir/CxxObject/sw/source/ui/config/mailconfigpage.o: relocation R_X86_64_PC32       against undefined symbol `_ZThn80_N4cppu30PartialWeakComponentImplHelperIJN3com3sun4star4mail19XConnectionListenerEEE7acquireEv' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [/var/tmp/portage/app-office/libreoffice-6.0.3.2/work/libreoffice-6.0.3.2/sw/Library_swui.mk:20: /var/tmp/portage/app-office/libreoffice-6.0.3.2/work/libreoffice-6.0.3.2/instdir/program/libswuilo.so] Error 1
Comment 1 paradox_ptr 2018-08-21 10:34:42 UTC
Created attachment 544250 [details]
emerge environment
Comment 2 paradox_ptr 2018-08-21 10:35:09 UTC
Created attachment 544252 [details]
emerge info

GENTOO_VM=  CLASSPATH="" JAVA_HOME=""
JAVACFLAGS="" COMPILER=""
Comment 3 Andreas Sturmlechner gentoo-dev 2018-08-21 18:59:45 UTC
I'm not sure either. Please try with 6.0.6.2, which is currently slated for stabilisation.
Comment 4 paradox_ptr 2018-08-23 05:03:11 UTC
Created attachment 544608 [details]
libreoffice-6.0.6.2 build.log

Same problem here.

/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/app-office/libreoffice-6.0.6.2/work/libreoffice-6.0.6.2/workdir/CxxObject/sw/source/ui/config/mailconfigpage.o: warning: relocation against `_ZThn80_N4cppu30PartialWeakComponentImplHelperIJN3com3sun4star4mail19XConnectionListenerEEE7acquireEv' in read-only section `.text'
/var/tmp/portage/app-office/libreoffice-6.0.6.2/work/libreoffice-6.0.6.2/workdir/CxxObject/sw/source/ui/config/mailconfigpage.o: In function `SwTestAccountSettingsDialog::Test()':
mailconfigpage.cxx:(.text+0x4726): undefined reference to `non-virtual thunk to cppu::PartialWeakComponentImplHelper<com::sun::star::mail::XConnectionListener>::acquire()'
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/app-office/libreoffice-6.0.6.2/work/libreoffice-6.0.6.2/workdir/CxxObject/sw/source/ui/config/mailconfigpage.o: relocation R_X86_64_PC32 against undefined symbol `_ZThn80_N4cppu30PartialWeakComponentImplHelperIJN3com3sun4star4mail19XConnectionListenerEEE7acquireEv' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
Comment 5 paradox_ptr 2019-03-14 03:44:33 UTC
So, I've only now gotten around to look into this further.

Problem has nothing to do with -fPIC - it's undefined reference to _ZThn80_N4cppu30PartialWeakComponentImplHelperIJN3com3sun4star4mail19XConnectionListenerEEE7acquireEv (non-virtual thunk to cppu::PartialWeakComponentImplHelper<com::sun::star::mail::XConnectionListener>::acquire()) that is the problem.

So, I looked up where this template is defined (I expected multiple object files, since header with implementation is included in multiple places - https://github.com/LibreOffice/core/search?utf8=%E2%9C%93&q=%22compbase.hxx%22)

But the only one with it appears to be uibase/dbui/mailmergehelper.on:
# find CxxObject/ -type f -exec sh -c 'file $1 | grep "ELF" &>/dev/null && objdump -d $1 | grep 
000000000000000e <_ZThn80_N4cppu30PartialWeakComponentImplHelperIJN3com3sun4star4mail19XConnectionListenerEEE7acquireEv>:
  16:	e8 00 00 00 00       	callq  1b <_ZThn80_N4cppu30PartialWeakComponentImplHelperIJN3com3sun4star4mail19XConnectionListenerEEE7acquireEv+0xd>
CxxObject/sw/source/uibase/dbui/mailmergehelper.on

And this object file is not passed to ld when libswuilo.so is made.
If I manually call ld with this extra file appended, g++ links the library just fine.

It's really strange that nobody else but me appears to be affected by this issue, since it still reliably persists for me - both 6.1.5.2 and 6.2.1.2 from repo fail to build in the exact same way.

Is this something I shoudl report to libreoffice devs?

Isn't compiled template definitions supposed to be included in every object file, and linker then throws away all the references but one?
Comment 6 paradox_ptr 2019-03-27 11:52:44 UTC
libreoffice builds normally if i change gcc optimization to -O2. But fails like I described with -O1.
Comment 7 Andreas K. Hüttel archtester gentoo-dev 2020-11-28 17:19:13 UTC
Do you still have this problem with current versions?