Issue 125475 - Build error while compiling the component svx
Summary: Build error while compiling the component svx
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: 4.1.0
Hardware: PC Linux 64-bit
: P3 Blocker (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
: 126257 (view as issue list)
Depends on:
Reported: 2014-08-21 01:57 UTC by samalipraveena
Modified: 2015-09-05 05:57 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

Hack to work around (4.51 KB, patch)
2014-12-24 00:59 UTC, Ariel Constenla-Haile
no flags Details | Diff
another workaround that works by disabling optimization of the two affected files (2.25 KB, patch)
2015-08-31 08:53 UTC, truckman
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description samalipraveena 2014-08-21 01:57:01 UTC
while compiling svx, i got an error like this
/media/amali/source/aoo-trunk/main/solver/420/ In function `FmXGridControl::createPeer(com::sun::star::uno::Reference<com::sun::star::awt::XToolkit> const&, com::sun::star::uno::Reference<com::sun::star::awt::XWindowPeer> const&)':
fmgridif.cxx:(.text+0x68b2): undefined reference to `non-virtual thunk to WindowListenerMultiplexer::acquire()'
/usr/bin/ld: /media/amali/source/aoo-trunk/main/solver/420/ relocation R_X86_64_PC32 against undefined symbol `_ZThn48_N25WindowListenerMultiplexer7acquireEv' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

Though g++ compiles with -fPIC, i'm getting this error. I searched the web and found out this is a problem for LibreOffice product, too.
I couldn't find where this WindowListenerMultiplexer class is implemented and so i can find the definition of this function. I think it is some kind of old code??
Comment 1 samalipraveena 2014-08-22 03:46:55 UTC
I get this error because of buggy g++4.9. I built using g++4.8 and didn't get any error again.
Comment 2 samalipraveena 2014-08-22 05:44:49 UTC
Built the source using g++4.8 and didn't get this error after that; so for now, I'm going to use g++4.8 to make the build in Ubuntu Linux14.04.
Comment 3 2014-12-04 10:48:18 UTC
Yes, this seems to be caused by the GCC4.9 bug "devirtualization too trigger happy" (, so this not an AOO problem. Setting the status to NOT_AN_AOO_ISSUE:
Comment 4 2014-12-04 10:48:52 UTC
Closing the resolved issue.
Comment 5 Ariel Constenla-Haile 2014-12-24 00:59:57 UTC
Created attachment 84310 [details]
Hack to work around

The attached patch allows to build on latest Fedora 21 with g++ (GCC) 4.9.2 20141101 (Red Hat 4.9.2-1)
Comment 6 Andrea Pescetti 2014-12-28 00:03:31 UTC
Ariel, do you believe it makes sense to include this patch/workaround in 4.1.2? In general we want that it is possible to build OpenOffice both on our (old) baseline and on the most recent versions of major distributions.
Comment 7 Ariel Constenla-Haile 2015-04-23 14:31:54 UTC
*** Issue 126257 has been marked as a duplicate of this issue. ***
Comment 8 truckman 2015-08-31 08:53:42 UTC
Created attachment 84898 [details]
another workaround that works by disabling optimization of the two affected files

I ran into this problem when working on the FreeBSD port.  I did some searching for a solution and saw that the LibreOffice folks were proposing a solution similar to the patch in attachment 84310 [details].  I tried it, but didn't have good luck.  I think it fixed the problem on x86_64, but not intel.  There are two files that trigger the bug when compiled with gcc 4.9 and -Os optimization.  On FreeBSD (and I believe Linux as well), only one of them is compiled with -Os on x86_64, and both are compiled with -Os on intel.

Trying to force the compiler to export these symbols also seems to be the wrong approach since these symbols are for inline class methods, so they should be private to the object file.

My initial fix in the FreeBSD port was to patch solenv/inc/ and solenv/gbuild/platform/ on the fly when gcc 4.9 was detected, replacing "-Os" with "-O0".  I also filed this gcc bug report: <>.

More recently, I modified the FreeBSD port to re-enable most optimization by replacing "-Os" with "-Os -fno-devirtualize -fno-devirtualize-speculatively".

Another possibility is to disable optimization only on the two files that are affected by this gcc bug, which I implemented in the attached patch.  With it I was able to get clean builds with gcc 4.9 on both intel and x86_64.

The last time I tried, the bug was still present in the latest gcc 4.9, but a comment in gcc bug report says that it is fixed in the trunk version of gcc (5?).
Comment 9 truckman 2015-09-05 05:57:19 UTC
This problem is not caused by the GCC4.9 bug "devirtualization too trigger happy" (  A fix for that bug was committed to the gcc 4.9 branch on September 11, 2014.

I submitted a copy of the OpenOffice code that triggers the gcc bug as an attachment to <>. A gcc developer confirmed that it still failed on the gcc 4.9 on February 11, 2015 (before the release of gcc 4.9.3).

I am able to still reproduce this build failure with this recent snapshot of gcc 4.9.4:
% gcc49 --version
gcc49 (FreeBSD Ports Collection) 4.9.4 20150819 (prerelease)