Skip to main content

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


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" -MT"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 used
when making a shared object; recompile with -fPIC
./testlib.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [] Error 1

Interesting, that on 32-bit openSUSE 11.0 x86 gcc 4.3 compiles shared libraries without problems...

Please, see also

Best regards,

Back to the top