Hello everyone,

Two compiling platforms - Linux and OS X.
Same project, same cmake (2.6.4), same target (Linux/ARM).

Sources compiles well (GNU C/C++) but linking is different.

Everything is fine on Linux.

comparing make VERBOSE=1 outputs:

OS X: [path-to]/gcc -march=armv5te -mtune=xscale -msoft-float -fpic - mthumb-interwork -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -dynamiclib -nostdlib -Wl,-shared,-Bsymbolic -Wl,- rpath-link=[path-to]/usr/lib -Wl,--whole-archive -Wl,--no-undefined - Wl,-rpath-link=[path-to]/usr/lib -o libmylib.so -install_name /Users/ dair/Project/native/libmylib.so [source-files]

Linux: [path-to]/gcc -fPIC -march=armv5te -mtune=xscale -msoft-float - fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack- protector -fno-short-enums -nostdlib -Wl,-shared,-Bsymbolic -Wl,-rpath- link=[path-to]/usr/lib -Wl,--whole-archive -Wl,--no-undefined -Wl,- rpath-link=[path-to]/usr/lib -shared -Wl,-soname,libmylib.so -o libmylib.so [source-files]

The problem is "-install_name" option. Cmake generates that in OS X but GCC cross-compiler does not accept that. I can successfully link the library (manually) by removing this option.

I set CMAKE_SYSTEM to Linux, even added "SET(APPLE 0)" but install_name option is still generating.

Also, on OS X Cmake generates CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS as "- dynamiclib -headerpad_max_install_names" which I don't need (- headerpad_max_install_names is not recognized by my compiler) but I can obviously set that property to what I need.

Please advise.

--
Thanks in advance,
Vladimir
_______________________________________________
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

Reply via email to