[CMake] rpath and BSD
Pierre Chifflier
chifflier at cpe.fr
Thu Nov 9 14:44:13 EST 2006
On Thu, Nov 09, 2006 at 10:16:06AM -0500, Brad King wrote:
> Pierre Chifflier wrote:
> > One of the remaining problems is that cmake seems to ignore RPATH
> > parameters on *BSD systems: I tried various combinations of the
> > variables CMAKE_INSTALL_RPATH, CMAKE_SKIP_BUILD_RPATH,
> > CMAKE_BUILD_WITH_INSTALL_RPATH and CMAKE_INSTALL_RPATH_USE_LINK_PATH,
> > but couldn't get it to work: the resulting executable has no rpath
> > set, whatever I try.
>
> It looks like rpath support is not configured in the OpenBSD.cmake
> platform file. Look for this file under share/CMake/Modules/Platform.
> There is a FreeBSD.cmake file next to it that may have the rpath flags
> enabled. You probably need to add something like this to the
> OpenBSD.cmake file:
>
> SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
> SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
>
> The actual values should match the platform's rpath flags. If you get
> it working please send a patch.
Thanks for the quick reply.
The changes worked (patch attached):
$ objdump -x /home/pollux/DEL/sbin/wzdftpd | grep -i rpath
RPATH /home/pollux/DEL/lib
However, when running the tests I encountered another problem when
running ctest -V:
[...]
95% tests passed, 1 tests failed out of 21
The following tests FAILED:
18 - test_wzd_string (Failed)
zsh: abort (core dumped) ctest -V
I'm not very familiar with OpenBSD, but I tried running "ctest -V" in
ktrace and here is the end of the kdump output (when ctest has
finished running all tests):
19485 ctest 1163100734.292937 RET sigprocmask -65793/0xfffefeff
19485 ctest 1163100734.292942 CALL sendto(3,-809610336,86,0,0,0)
19485 ctest 1163100734.292952 GIO fd 3 wrote 86 bytes
"<10>ctest: stack overflow in function virtual int cmCTestTestHandler::ProcessHandler()"
19485 ctest 1163100734.293027 RET sendto 86/0x56
19485 ctest 1163100734.293033 CALL sigprocmask(1,-1)
19485 ctest 1163100734.293035 RET sigprocmask -65825/0xfffefedf
19485 ctest 1163100734.293037 CALL mprotect(743620608,8192,3)
[... a few lines ...]
19485 ctest 1163100734.293158 RET mprotect 0
19485 ctest 1163100734.293159 CALL sigprocmask(3,-65825)
19485 ctest 1163100734.293161 RET sigprocmask -65793/0xfffefeff
19485 ctest 1163100734.293163 CALL kill(19485,6)
19485 ctest 1163100734.293167 PSIG SIGABRT SIG_DFL code 0
19485 ctest 1163100734.293173 NAMI "ctest.core"
The complete kdump output is about 1MB, so I didn't attached it to
this mail. Hope this helps !
>
> In order for a platform to have first-class support there must be a
> nightly testing dashboard submission here:
>
> http://public.kitware.com/dashboard.php?name=cmake
>
> Currently there is no submission for OpenBSD. If you are able to
> contribute a nightly build (about 30 minutes of compute time per night
> on one machine) it would be appreciated and we would be able to make
> sure CMake keeps working on the platform. Contact me off the list if
> you are interested in setting this up.
>
I would, however this is not my machine (I only have an account on
it). I have forwarded the request to the owner, if he's interested
I'll help him set up a Nightly build.
Regards,
Pierre
-------------- next part --------------
--- OpenBSD.cmake.orig Thu Nov 9 20:21:03 2006
+++ OpenBSD.cmake Thu Nov 9 20:20:19 2006
@@ -1,2 +1,4 @@
+SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
SET(CMAKE_DL_LIBS "")
INCLUDE(Platform/UnixPaths)
More information about the CMake
mailing list