[cmake-developers] Building with Qt for the Raspberry Pi with CMake
Stephen Kelly
steveire at gmail.com
Fri Apr 12 12:08:12 EDT 2013
Stephen Kelly wrote:
> This doesn't affect only Qt, but could affect any CMake user trying to use
> a library which depends on zlib on the Raspberry Pi.
Actually I notice that I have a similar situation on my ubuntu system:
/lib/x86_64-linux-gnu/libz.so.1
/lib/x86_64-linux-gnu/libz.so.1.2.7
/usr/lib/x86_64-linux-gnu/libz.so
When building bar, no -rpath-link is added at all, but it still works:
Linking CXX executable bar
/home/stephen/dev/prefix/qtbase/kde/bin/cmake -E cmake_link_script
CMakeFiles/bar.dir/link.txt --verbose=1
/usr/lib/icecc/bin/c++ CMakeFiles/bar.dir/hw.cpp.o -o bar -rdynamic
libfoo.so -Wl,-rpath,/home/stephen/dev/src/playground/cmake/build
make[2]: Leaving directory `/home/stephen/safe/dev/playground/cmake/build'
/home/stephen/dev/prefix/qtbase/kde/bin/cmake -E cmake_progress_report
/home/stephen/dev/src/playground/cmake/build/CMakeFiles 1
[100%] Built target bar
make[1]: Leaving directory `/home/stephen/safe/dev/playground/cmake/build'
/home/stephen/dev/prefix/qtbase/kde/bin/cmake -E cmake_progress_start
/home/stephen/dev/src/playground/cmake/build/CMakeFiles 0
makeobj[0]: Leaving directory
`/home/stephen/dev/src/playground/cmake/build'
$ ldd libfoo.so
linux-vdso.so.1 => (0x00007fff9f7fe000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f6229f1f000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007f6229c1c000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f6229a05000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f622963d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6229338000)
/lib64/ld-linux-x86-64.so.2 (0x00007f622a362000)
I guess it works because libz.so and libz.so.1 are both in system paths? But
then why doesn't the same work on the Raspberry Pi cross compile? The
CMAKE_LIBRARY_ARCHITECTURE is already determined to be arm-linux-gnueabihf
there.
Thanks,
Steve.
More information about the cmake-developers
mailing list