On 30. Sep, 2010, at 11:15 , David Aldrich wrote: > 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
For one, you are missing -ldl. Add ${CMAKE_DL_LIBS} to your target_link_libraries call. The -whole-archive flag is pretty useless with executables (unless, you plan to use it as a library too, but that is outlandish). --export-dynamic may be also necessary, if your dlopen'ed libraries use symbols in your executable. Michael -- There is always a well-known solution to every human problem -- neat, plausible, and wrong. H. L. Mencken
PGP.sig
Description: This is a digitally signed message part
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake