Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] -fPIC option for Shared Libraries (64-bit Linux)

On Mon, 08 Dec 2008 20:12:08 +0300, Vladimir Prus <vladimir@xxxxxxxxxxxxxxxx> wrote:

On Monday 08 December 2008 19:42:19 Andrey Tretyakov wrote:

Can somebody test the building shared libraries from Eclipse without -fPIC
parameter on any Linux x86_64?
On my machine (openSUSE 11.0 x86_64) gcc 4.3 can't build shared libraries:

make all
Building file: ../testlib.c
Invoking: GCC C Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"testlib.d"
-o"testlib.o" "../testlib.c"
Finished building: ../testlib.c

Building target:
Invoking: GCC C Linker
gcc -shared -o""  ./testlib.o
./testlib.o: relocation R_X86_64_32 against `a local symbol' can not be
when making a shared object; recompile with -fPIC

This is not CDT issue -- that's how gcc behaves on 64-bit flatforms -- you need
to compile everything that goes into a shared library with -fPIC.

- Volodya

Yes, therefore I suggest to add '-fPIC' option to GCC Toolchain (please, see the attachment to that bug).

cdt-dev mailing list

Back to the top