[CMake] How to specify -fpic ?

David Aldrich David.Aldrich at EU.NEC.COM
Thu Sep 30 05:15:24 EDT 2010


Hi Michael

Thanks for your reply.

> The only difference between -fpic and -fPIC is that the latter has no limit
> on the size of the global offsets table and this is only relevant for the
> m68k, PowerPC and SPARC architectures (according to the GCC manual page). 

Yes, we aren't using those architectures.

> Are you using -fvisibility=hidden somewhere?

No.

> Is this option the only difference of the link commands?

Actually, the shared library linker commands are similar but the executable linker commands are quite different.

CMake:

/usr/bin/c++ -O3 -DNDEBUG -Wall -m64 -o myProj -rdynamic Kernel/libKernel.a -lpython2.4

Manual make:

g++ -o myProj -ldl -Wl,-whole-archive,-export-dynamic ../Kernel/libKernel.a  -lboost_python-mt -lpython2.4 -Wl,--no-whole-archive

I will have to analyse these flags. Any thoughts on the use of -whole-archive/--no-whole-archive here please?

BR

David




More information about the CMake mailing list