Issue 126414 - missing -fPIC flag
Summary: missing -fPIC flag
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: 4.2.0-dev
Hardware: PC Linux, all
: P5 (lowest) Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2015-07-20 10:58 UTC by hramrach
Modified: 2015-07-20 16:37 UTC (History)
0 users

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


Note You need to log in before you can comment on or make changes to this issue.
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/
/scratch/build/aoo/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: /scratch/build/aoo/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
/scratch/build/aoo/main/solenv/gbuild/ recipe for target '/scratch/build/aoo/main/solver/420/' failed
make: *** [/scratch/build/aoo/main/solver/420/] 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