On Monday 19 October 2009, Vladimir Lebedev-Schmidthof wrote:
> 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.

You should set "CMAKE_SYSTEM_NAME", not "CMAKE_SYSTEM" to "Linux". If you 
really set CMAKE_SYSTEM instead of CMAKE_SYSTEM_NAME, this will fix your 
problem (after a quick look it seems install_name is really only set in the 
Modules/Platform/Darwin*.cmake files, which should not get loaded if 
CMAKE_SYSTEM_NAME is set to Linux).

Alex
_______________________________________________
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