Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 640248 - app-office/libreoffice-6.0.2.1 on profile 17.0 - mailconfigpage.o: build failure with -O1
Summary: app-office/libreoffice-6.0.2.1 on profile 17.0 - mailconfigpage.o: build fail...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Office Team
URL:
Whiteboard:
Keywords:
: 672734 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-12-08 12:19 UTC by Matt Whitlock
Modified: 2024-01-29 05:53 UTC (History)
4 users (show)

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


Attachments
build.log.xz (2224,354.85 KB, application/x-xz)
2018-01-21 10:34 UTC, Matt Whitlock
Details
libreoffice-fix-missing-template-instantiation.patch (libreoffice-fix-missing-template-instantiation.patch,542 bytes, patch)
2018-04-12 01:24 UTC, Matt Whitlock
Details | Diff
libreoffice-fix-missing-template-instantiation.patch (libreoffice-fix-missing-template-instantiation.patch,543 bytes, patch)
2019-03-13 03:48 UTC, Matt Whitlock
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Whitlock 2017-12-08 12:19:50 UTC
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: /var/tmp/portage/app-office/libreoffice-5.4.3.2/work/libreoffice-5.4.3.2/workdir/CxxObject/sw/source/ui/config/mailconfigpage.o: requires dynamic R_X86_64_PC32 reloc against '_ZThn80_N4cppu30PartialWeakComponentImplHelperIJN3com3sun4star4mail19XConnectionListenerEEE7acquireEv' which may overflow at runtime; recompile with -fPIC
/var/tmp/portage/app-office/libreoffice-5.4.3.2/work/libreoffice-5.4.3.2/workdir/CxxObject/sw/source/ui/config/mailconfigpage.o:mailconfigpage.cxx:function SwTestAccountSettingsDialog::Test(): error: undefined reference to 'non-virtual thunk to cppu::PartialWeakComponentImplHelper<com::sun::star::mail::XConnectionListener>::acquire()'
collect2: error: ld returned 1 exit status
make[1]: *** [/var/tmp/portage/app-office/libreoffice-5.4.3.2/work/libreoffice-5.4.3.2/sw/Library_swui.mk:20: /var/tmp/portage/app-office/libreoffice-5.4.3.2/work/libreoffice-5.4.3.2/instdir/program/libswuilo.so] Error 1


# emerge --info '=app-office/libreoffice-5.4.3.2::gentoo'
Portage 2.3.16 (python 3.5.4-final-0, default/linux/amd64/17.0/desktop/plasma, gcc-7.2.0, glibc-2.26-r3, 4.14.3-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.14.3-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q6600_@_2.40GHz-with-gentoo-2.4.1
KiB Mem:     8165588 total,    324252 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Thu, 07 Dec 2017 11:15:01 +0000
Head commit of repository gentoo: 66854f2f1e051919e41c280bae478378067b4788
sh dash 0.5.9.1-r3
ld GNU gold (Gentoo 2.29.1 p3 2.29.1) 1.14
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
ccache version 3.3.4 [enabled]
app-shells/bash:          4.4_p12::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.26.1-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.4-r1::gentoo
dev-util/ccache:          3.3.4-r1::gentoo
dev-util/cmake:           3.10.0::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            7.2.0::gentoo
sys-devel/gcc-config:     1.9.0-r1::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r3::gentoo
Repositories:

local
    location: /var/db/portage/repos/local
    masters: gentoo
    priority: -2000

bitcoin
    location: /var/lib/layman/bitcoin
    sync-type: laymansync
    sync-uri: https://gitlab.com/bitcoin/gentoo.git
    masters: gentoo
    priority: -1500

fw-overlay
    location: /var/lib/layman/fw-overlay
    sync-type: laymansync
    sync-uri: https://github.com/no-hope/fw-overlay.git
    masters: gentoo
    priority: -1500

kde
    location: /var/lib/layman/kde
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/proj/kde.git
    masters: gentoo
    priority: -1500

vmware
    location: /var/lib/layman/vmware
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/vmware.git
    masters: gentoo
    priority: -1500

gentoo
    location: /var/db/portage/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.us.gentoo.org/gentoo-portage/
    priority: -1000
    sync-rsync-extra-opts: 

crossdev
    location: /var/db/portage/repos/crossdev
    masters: gentoo

toolchain
    location: /var/lib/layman/toolchain
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/toolchain.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O3 -ggdb -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/X11/xkb /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0 /usr/share/themes/oxygen-gtk/gtk-3.0 /var/yp/Makefile"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dbus-1 /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.0/ext-active/ /etc/php/apache2-php7.1/ext-active/ /etc/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cgi-php7.1/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/php/cli-php7.1/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O3 -ggdb -pipe"
DISTDIR="/var/cache/portage/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner --unordered-display --usepkg"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.leaseweb.com/gentoo/ http://mirrors.rit.edu/gentoo/ http://mirror.lug.udel.edu/pub/gentoo/ http://gentoo.mirrors.pair.com/ http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O2 -Wl,--as-needed"
MAKEOPTS="-j5 -l8"
PKGDIR="/var/cache/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acpi activities alsa amd64 berkdb branding bzip2 cairo cdda cdparanoia cdr cli consolekit cracklib crypt cups curl cxx dbus declarative dri dts dvd dvdr emboss encode evdev exif fam ffmpeg firefox flac fontconfig gdbm gif git glamor gmp gstreamer gtk iconv icu id3tag ipv6 jpeg kde kipi kwallet lame lcms libnotify libsamplerate lzma mad matroska mng modules mp3 mp4 mpeg multilib ncurses nptl nsplugin ogg opengl openmp opus pango pcre pdf phonon php plasma png policykit ppds qml qt3support qt5 quicktime readline sdl seccomp session smp spell ssl startup-notification subversion svg taglib tcmalloc theora threads tiff truetype udev udisks unicode upower usb v4l vaapi vdpau vnc vorbis vpx webkit widgets x264 xcb xcomposite xml xv xvid xvmc zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" L10N="en-US en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_US en" LIRC_DEVICES="mceusb" LLVM_TARGETS="AMDGPU" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" QEMU_SOFTMMU_TARGETS="arm" RUBY_TARGETS="ruby23" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

app-office/libreoffice-5.4.3.2::gentoo was built with the following:
USE="branding cups dbus gstreamer gtk kde -bluetooth -coinmp -collada -debug -eds -firebird -gltf -gnome -googledrive -gtk3 -java -jemalloc -libressl -mysql -odk -pdfimport -postgres -quickstarter -test -vlc" ABI_X86="(64)" LIBREOFFICE_EXTENSIONS="-nlpsolver -scripting-beanshell -scripting-javascript -wiki-publisher" PYTHON_SINGLE_TARGET="python3_4 -python2_7 -python3_5 -python3_6" PYTHON_TARGETS="python2_7 python3_4 -python3_5 -python3_6"
CFLAGS="-march=native -O3 -ggdb -pipe -O1 -g0"
CXXFLAGS="-march=native -O3 -ggdb -pipe -O1 -g0"


# emerge -pqv app-office/libreoffice
[ebuild   R   ] app-office/libreoffice-5.4.3.2  USE="branding cups dbus gstreamer gtk kde -bluetooth -coinmp -collada -debug -eds -firebird -gltf -gnome -googledrive -gtk3 -java -jemalloc -libressl -mysql -odk -pdfimport -postgres -quickstarter {-test} -vlc" LIBREOFFICE_EXTENSIONS="-nlpsolver -scripting-beanshell -scripting-javascript -wiki-publisher" PYTHON_SINGLE_TARGET="python3_5* -python2_7 -python3_4* -python3_6" PYTHON_TARGETS="python2_7 python3_5* -python3_4* -python3_6"
Comment 1 Matt Whitlock 2017-12-27 23:55:37 UTC
This problem persists in app-office/libreoffice-5.4.4.2.

When attempting to link using the BFD linker, a different error message presents:

/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: /var/tmp/portage/app-office/libreoffice-5.4.4.2/work/libreoffice-5.4.4.2/workdir/CxxObject/sw/source/ui/config/mailconfigpage.o: warning: relocation against `_ZThn80_N4cppu30PartialWeakComponentImplHelperIJN3com3sun4star4mail19XConnectionListenerEEE7acquireEv' in readonly section `.text'
/var/tmp/portage/app-office/libreoffice-5.4.4.2/work/libreoffice-5.4.4.2/workdir/CxxObject/sw/source/ui/config/mailconfigpage.o: In function `SwTestAccountSettingsDialog::Test()':
mailconfigpage.cxx:(.text+0x473c): undefined reference to `non-virtual thunk to cppu::PartialWeakComponentImplHelper<com::sun::star::mail::XConnectionListener>::acquire()'
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: /var/tmp/portage/app-office/libreoffice-5.4.4.2/work/libreoffice-5.4.4.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.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: final link failed: Bad value
collect2: error: ld returned 1 exit status
Comment 2 Matt Whitlock 2017-12-28 01:05:33 UTC
Some more information...

There are two objects that use the referenced symbol.

# nm /var/tmp/portage/app-office/libreoffice-5.4.4.2/work/libreoffice-5.4.4.2/workdir/CxxObject/sw/source/ui/config/mailconfigpage.o | fgrep '_ZThn80_N4cppu30PartialWeakComponentImplHelperIJN3com3sun4star4mail19XConnectionListenerEEE7acquireEv' | c++filt
                 U non-virtual thunk to cppu::PartialWeakComponentImplHelper<com::sun::star::mail::XConnectionListener>::acquire()

# nm /var/tmp/portage/app-office/libreoffice-5.4.4.2/work/libreoffice-5.4.4.2/workdir/CxxObject/sw/source/uibase/dbui/mailmergehelper.o | fgrep '_ZThn80_N4cppu30PartialWeakComponentImplHelperIJN3com3sun4star4mail19XConnectionListenerEEE7acquireEv' | c++filt
0000000000000020 W non-virtual thunk to cppu::PartialWeakComponentImplHelper<com::sun::star::mail::XConnectionListener>::acquire()


As you can see, the symbol is undefined in mailconfigpage.o but is weakly defined in mailmergehelper.o.

I have been unable to determine why mailconfigpage.o does not define the symbol but mailmergehelper.o does. The pre-processed sources for both compilation units define the class SwConnectionListener, which derives from cppu::WeakComponentImplHelper<com::sun::star::mail::XConnectionListener>, which derives from cppu::PartialWeakComponentImplHelper<com::sun::star::mail::XConnectionListener>, so the inline virtual method definitions seemingly should be present as weak symbols in both object files.

By manually adding mailmergehelper.o to libswuilo.so, the link completes successfully, and the ebuild finishes successfully. Note that mailmergehelper.o normally lives only in libswlo.so, and libswuilo.so dynamically links with libswlo.so, but the referenced symbol is not exported by libswlo.so.
Comment 3 Andreas Sturmlechner gentoo-dev 2018-01-20 02:32:01 UTC
Please try again with ccache disabled and -O2 instead of -O3.
Comment 4 Matt Whitlock 2018-01-20 12:39:36 UTC
(In reply to Andreas Sturmlechner from comment #3)
> Please try again with ccache disabled and -O2 instead of -O3.

Notice I use -O1 on LibreOffice. I would automatically filter out the -O3 instead of just appending -O1 except that Portage's configuration syntax doesn't have full support for POSIX shell-like variable substitution.

I'll run the build again with ccache disabled, but I'll mention that I've already tried it after clearing the cache and had the same failure, and also I've always used ccache on LibreOffice builds and never had a ccache-induced failure before.
Comment 5 Matt Whitlock 2018-01-21 10:34:13 UTC
Created attachment 515610 [details]
build.log.xz

(In reply to Andreas Sturmlechner from comment #3)

I have attempted to build it with ccache disabled and, as expected, it fails in exactly the same way. The complete build log is attached.
Comment 6 Matt Whitlock 2018-02-07 17:57:59 UTC
This is still a problem in app-office/libreoffice-6.0.0.3.

An easy workaround (though this may not be _correct_):
- After the build fails, move the line
    sw/source/uibase/dbui/maildispatcher \
  from sw/Library_sw.mk to sw/Library_swui.mk.
- Continue the build using "ebuild /path/to/libreoffice-6.0.0.3.ebuild merge".

Unfortunately you can't do this before starting the build, or libswlo.so fails to build, and you can't have the file referenced in both Makefiles at the same time or the build system complains (rightly so). So there's no way to package this workaround up into a patch file that could live in /etc/portage/patches/.
Comment 7 Matt Whitlock 2018-03-10 12:20:11 UTC
This problem persists in app-office/libreoffice-6.0.2.1.

Am I really the only person who is using profile 17.0 (defaulting to PIE) and app-office/libreoffice?
Comment 8 Johannes Hirte 2018-03-12 12:56:56 UTC
Same problem here with one out of three systems. At moment I don't have time looking further into this. I've worked around this issue with the libreoffice-bin package for this one system.
Comment 9 Andreas Sturmlechner gentoo-dev 2018-03-12 17:49:37 UTC
I haven't seen that problem on any of my systems, and USE flags are exactly the same as Matt's. Johannes, maybe you can check for similarities of your affected config with this bug.
Comment 10 Johannes Hirte 2018-03-12 19:04:12 UTC
(In reply to Andreas Sturmlechner from comment #9)
> I haven't seen that problem on any of my systems, and USE flags are exactly
> the same as Matt's. Johannes, maybe you can check for similarities of your
> affected config with this bug.

I have access to the affected system only on weekends. I'll check as soon as possible.
Comment 11 Matt Whitlock 2018-04-12 00:33:16 UTC
Problem persists in app-office/libreoffice-6.0.3.2:

[LNK] Library/libswuilo.so
S=/var/tmp/portage/app-office/libreoffice-6.0.3.2/work/libreoffice-6.0.3.2 && I=$S/instdir && W=$S/workdir &&  x86_64-pc-linux-gnu-g++ -shared -Wl,-z,noexecstack   -Wl,-z,origin '-Wl,-rpath,$ORIGIN' -Wl,-rpath-link,$I/program -Wl,-z,defs -fstack-protector-strong -Wl,-rpath-link,/lib:/usr/lib -Wl,-z,combreloc  -Wl,--hash-style=gnu  -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo -Wl,-Bsymbolic-functions  -L$W/LinkTarget/StaticLibrary -L$I/sdk/lib  -L$I/program  -L$I/program -Wl,-O2 -Wl,--as-needed -Wl,-fuse-ld=bfd    $W/CxxObject/sw/source/ui/chrdlg/break.o $W/CxxObject/sw/source/ui/chrdlg/chardlg.o $W/CxxObject/sw/source/ui/chrdlg/drpcps.o $W/CxxObject/sw/source/ui/chrdlg/numpara.o $W/CxxObject/sw/source/ui/chrdlg/pardlg.o $W/CxxObject/sw/source/ui/chrdlg/swuiccoll.o $W/CxxObject/sw/source/ui/chrdlg/tblnumfm.o $W/CxxObject/sw/source/ui/config/mailconfigpage.o $W/CxxObject/sw/source/ui/config/optcomp.o $W/CxxObject/sw/source/ui/config/optload.o $W/CxxObject/sw/source/ui/config/optpage.o $W/CxxObject/sw/source/ui/dialog/abstract.o $W/CxxObject/sw/source/ui/dialog/addrdlg.o $W/CxxObject/sw/source/ui/dialog/ascfldlg.o $W/CxxObject/sw/source/ui/dialog/docstdlg.o $W/CxxObject/sw/source/ui/dialog/macassgn.o $W/CxxObject/sw/source/ui/dialog/swdlgfact.o $W/CxxObject/sw/source/ui/dialog/swmessdialog.o $W/CxxObject/sw/source/ui/dialog/swuiexp.o $W/CxxObject/sw/source/ui/dialog/uiregionsw.o $W/CxxObject/sw/source/ui/dialog/wordcountdialog.o $W/CxxObject/sw/source/ui/dochdl/selglos.o $W/CxxObject/sw/source/ui/envelp/envfmt.o $W/CxxObject/sw/source/ui/envelp/envlop1.o $W/CxxObject/sw/source/ui/envelp/envprt.o $W/CxxObject/sw/source/ui/envelp/label1.o $W/CxxObject/sw/source/ui/envelp/labelexp.o $W/CxxObject/sw/source/ui/envelp/labfmt.o $W/CxxObject/sw/source/ui/envelp/labprt.o $W/CxxObject/sw/source/ui/envelp/mailmrge.o $W/CxxObject/sw/source/ui/fldui/DropDownFieldDialog.o $W/CxxObject/sw/source/ui/fldui/FldRefTreeListBox.o $W/CxxObject/sw/source/ui/fldui/changedb.o $W/CxxObject/sw/source/ui/fldui/flddb.o $W/CxxObject/sw/source/ui/fldui/flddinf.o $W/CxxObject/sw/source/ui/fldui/flddok.o $W/CxxObject/sw/source/ui/fldui/fldedt.o $W/CxxObject/sw/source/ui/fldui/fldfunc.o $W/CxxObject/sw/source/ui/fldui/fldpage.o $W/CxxObject/sw/source/ui/fldui/fldref.o $W/CxxObject/sw/source/ui/fldui/fldtdlg.o $W/CxxObject/sw/source/ui/fldui/fldvar.o $W/CxxObject/sw/source/ui/fldui/inpdlg.o $W/CxxObject/sw/source/ui/fldui/javaedit.o $W/CxxObject/sw/source/ui/fmtui/tmpdlg.o $W/CxxObject/sw/source/ui/frmdlg/column.o $W/CxxObject/sw/source/ui/frmdlg/cption.o $W/CxxObject/sw/source/ui/frmdlg/frmdlg.o $W/CxxObject/sw/source/ui/frmdlg/frmpage.o $W/CxxObject/sw/source/ui/frmdlg/pattern.o $W/CxxObject/sw/source/ui/frmdlg/uiborder.o $W/CxxObject/sw/source/ui/frmdlg/wrap.o $W/CxxObject/sw/source/ui/index/cntex.o $W/CxxObject/sw/source/ui/index/cnttab.o $W/CxxObject/sw/source/ui/index/multmrk.o $W/CxxObject/sw/source/ui/index/swuiidxmrk.o $W/CxxObject/sw/source/ui/misc/bookmark.o $W/CxxObject/sw/source/ui/misc/docfnote.o $W/CxxObject/sw/source/ui/misc/glosbib.o $W/CxxObject/sw/source/ui/misc/glossary.o $W/CxxObject/sw/source/ui/misc/insfnote.o $W/CxxObject/sw/source/ui/misc/linenum.o $W/CxxObject/sw/source/ui/misc/num.o $W/CxxObject/sw/source/ui/misc/outline.o $W/CxxObject/sw/source/ui/misc/pgfnote.o $W/CxxObject/sw/source/ui/misc/pggrid.o $W/CxxObject/sw/source/ui/misc/srtdlg.o $W/CxxObject/sw/source/ui/misc/swmodalredlineacceptdlg.o $W/CxxObject/sw/source/ui/misc/titlepage.o $W/CxxObject/sw/source/ui/table/colwd.o $W/CxxObject/sw/source/ui/table/convert.o $W/CxxObject/sw/source/ui/table/instable.o $W/CxxObject/sw/source/ui/table/mergetbl.o $W/CxxObject/sw/source/ui/table/rowht.o $W/CxxObject/sw/source/ui/table/splittbl.o $W/CxxObject/sw/source/ui/table/tabledlg.o $W/CxxObject/sw/source/ui/table/tautofmt.o $W/CxxObject/sw/source/ui/utlui/swrenamexnameddlg.o $W/CxxObject/sw/source/ui/dbui/addresslistdialog.o $W/CxxObject/sw/source/ui/dbui/createaddresslistdialog.o $W/CxxObject/sw/source/ui/dbui/customizeaddresslistdialog.o $W/CxxObject/sw/source/ui/dbui/dbinsdlg.o $W/CxxObject/sw/source/ui/dbui/dbtablepreviewdialog.o $W/CxxObject/sw/source/ui/dbui/mailmergewizard.o $W/CxxObject/sw/source/ui/dbui/mmaddressblockpage.o $W/CxxObject/sw/source/ui/dbui/mmdocselectpage.o $W/CxxObject/sw/source/ui/dbui/mmgreetingspage.o $W/CxxObject/sw/source/ui/dbui/mmlayoutpage.o $W/CxxObject/sw/source/ui/dbui/mmoutputtypepage.o $W/CxxObject/sw/source/ui/dbui/mmresultdialogs.o $W/CxxObject/sw/source/ui/dbui/selectdbtabledialog.o      -Wl,--start-group    -Wl,--end-group -Wl,--no-as-needed -lmergedlo -luno_cppu -luno_cppuhelpergcc3 -li18nlangtag -luno_sal -luno_salhelpergcc3 -lswlo  -o $I/program/libswuilo.so 
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: /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 against `_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+0x473c): 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.bfd: /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.bfd: 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
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/var/tmp/portage/app-office/libreoffice-6.0.3.2/work/libreoffice-6.0.3.2'
make: *** [Makefile:268: build] Error 2
Comment 12 Matt Whitlock 2018-04-12 01:24:28 UTC
Created attachment 527166 [details, diff]
libreoffice-fix-missing-template-instantiation.patch

The attached patch, which is suitable for /etc/portage/patches, enables LibreOffice to build successfully by supplying an instantiation of cppu::PartialWeakComponentImplHelper<com::sun::star::mail::XConnectionListener> in sw/source/ui/config/mailconfigpage.o.
Comment 13 David 2018-04-24 07:08:17 UTC
I just came accross the same issue with libreoffice 6.0.3.2, and the patch fixes it
Comment 14 Andreas Sturmlechner gentoo-dev 2018-04-24 11:13:31 UTC
(In reply to Matt Whitlock from comment #12)
> Created attachment 527166 [details, diff] [details, diff]
> libreoffice-fix-missing-template-instantiation.patch
> 
> The attached patch, which is suitable for /etc/portage/patches, enables
> LibreOffice to build successfully by supplying an instantiation of
> cppu::PartialWeakComponentImplHelper<com::sun::star::mail::
> XConnectionListener> in sw/source/ui/config/mailconfigpage.o.

Thanks Matt, is this patch taken from upstream or did you carry it upstream?
Comment 15 Matt Whitlock 2018-04-24 13:13:23 UTC
(In reply to Andreas Sturmlechner from comment #14)
> (In reply to Matt Whitlock from comment #12)
> > Created attachment 527166 [details, diff] [details, diff] [details, diff]
> > libreoffice-fix-missing-template-instantiation.patch
> > 
> > The attached patch, which is suitable for /etc/portage/patches, enables
> > LibreOffice to build successfully by supplying an instantiation of
> > cppu::PartialWeakComponentImplHelper<com::sun::star::mail::
> > XConnectionListener> in sw/source/ui/config/mailconfigpage.o.
> 
> Thanks Matt, is this patch taken from upstream or did you carry it upstream?

I am the originator of the patch. I have not transmitted it upstream since I can't imagine how anyone upstream is able to build this source successfully, and I have been assuming that they will catch their omission and correct it. Clearly this is not happening, though. I would love to know how they are able to build the code without this patch. Maybe it only works for them due to a bug in an older version of G++? I'm using 7.3.0.
Comment 16 Andreas Sturmlechner gentoo-dev 2018-04-24 13:15:19 UTC
All my systems have GCC-7.3.0 and they build LO fine as well, so...
Comment 17 Matt Whitlock 2018-04-24 13:25:01 UTC
(In reply to Andreas Sturmlechner from comment #16)
> All my systems have GCC-7.3.0 and they build LO fine as well, so...

What optimization flags do you use? I use -O1 on LibreOffice since it's such a lengthy build and I use the applications so seldom. I could surmise that the code from the missing template instantiation gets inlined at -O2, so maybe that's how the omission hasn't been caught, although I would think that the LibreOffice developers would be doing debug builds that would catch it.
Comment 18 Andreas Sturmlechner gentoo-dev 2018-04-24 23:44:25 UTC
Yeah, works with -O2, does not with -O1.
Comment 19 Erich Seifert 2018-07-14 07:35:18 UTC
I had the same linking error with app-office/libreoffice-6.0.5.2 using sys-devel/gcc-7.3.0-r3 and -O3 in CFLAGS. Changing CFLAGS to -O2 for LibreOffice resolved the issue.
Comment 20 Andreas Sturmlechner gentoo-dev 2018-12-09 16:16:08 UTC
*** Bug 672734 has been marked as a duplicate of this bug. ***
Comment 21 Matt Whitlock 2019-03-13 03:48:16 UTC
Created attachment 568938 [details, diff]
libreoffice-fix-missing-template-instantiation.patch

Updated patch for app-office/libreoffice-6.2.1.2.
Comment 22 Andreas K. Hüttel archtester gentoo-dev 2020-11-28 17:18:48 UTC
Do you still have this problem with current versions?
Comment 23 Matt Whitlock 2020-11-28 18:10:59 UTC
(In reply to Andreas K. Hüttel from comment #22)
> Do you still have this problem with current versions?

I don't know. I still have my patch in /etc/portage/patches/app-office/libreoffice, and it still applies as of 7.0.3.1. I haven't tried building without it.
Comment 24 cJ 2023-09-18 01:51:31 UTC
I still have this problem on the current version (7.5.6.2)...
Comment 25 Matt Whitlock 2023-09-18 02:05:03 UTC
(In reply to cJ from comment #24)
> I still have this problem on the current version (7.5.6.2)...

Yep, and I still have my patch sitting in /etc/portage/patches, and it still applies and still fixes this problem, which I had not thought about in years.

I can't understand how it is possible that upstream apparently still have not noticed the omission that my patch corrects.
Comment 26 cJ 2023-11-25 17:05:52 UTC
This is just to document that libreoffice-7.5.8.2 still takes -O2 or patching.
Comment 27 Matt Whitlock 2024-01-29 05:53:20 UTC
I successfully built app-office/libreoffice-7.6.4.1 with -O1 without needing the patch. (Indeed, the patch still applies but now causes a compilation error.)