Issue 126414

Summary: missing -fPIC flag
Product: General Reporter: hramrach
Component: codeAssignee: AOO issues mailing list <issues>
Status: UNCONFIRMED --- QA Contact:
Severity: Normal    
Priority: P5 (lowest)    
Version: 4.2.0-dev   
Target Milestone: ---   
Hardware: PC   
OS: Linux, all   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description hramrach 2015-07-20 10:58:11 UTC
When building openoffice the build fails due to something missing -fPIC flag. I am building on Linux AMD64.


I added -fPIC to ARCH_FLAGS and the build seems to proceed much further.

This needs further investigation as to where the flag is missing. The object where the build fails probably links to something that should have been built with -fPIC but is not.
Comment 1 hramrach 2015-07-20 14:54:37 UTC
ok, I have the exact error now:

[ build LNK ] Library/libsvxcore.so
/scratch/build/aoo/main/solver/420/unxlngx6.pro/workdir/CxxObject/svx/source/fmcomp/fmgridif.o: 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: /scratch/build/aoo/main/solver/420/unxlngx6.pro/workdir/CxxObject/svx/source/fmcomp/fmgridif.o: 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
/scratch/build/aoo/main/solenv/gbuild/LinkTarget.mk:259: recipe for target '/scratch/build/aoo/main/solver/420/unxlngx6.pro/workdir/LinkTarget/Library/libsvxcore.so' failed
make: *** [/scratch/build/aoo/main/solver/420/unxlngx6.pro/workdir/LinkTarget/Library/libsvxcore.so] Error 1
dmake:  Error code 2, while making 'all'


So adding -fPIC to flags at random does not help.
Comment 2 hramrach 2015-07-20 16:37:14 UTC
hmm, to the best of my knowledge both fmgridif.c and the directory containing WindowListenerMultiplexer are built with -fPIC so the error is misleading at best.

g++ (Debian 4.9.2-10) 4.9.2