<div class="gmail_quote">2009/3/30 Alexander Neundorf <span dir="ltr"><<a href="mailto:a.neundorf-work@gmx.net">a.neundorf-work@gmx.net</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Monday 30 March 2009, Adolfo Rodríguez wrote:<br>
> Hi,<br>
><br>
> I have set up a toolchain file [1] to enable cross-compiling a project. In<br>
> my current setup, both the host and target environments are<br>
> binary-compatible (both are x86 and are using gcc's with compatible ABIs).<br>
> When I generate a cross-compiled executable and run ldd, the paths to<br>
> libraries such as libc, libc++, and m show up rooted at /lib. I was<br>
> expecting something more in the line of ${CMAKE_FIND_ROOT_PATH}/lib.<br>
> Conversely, the external dependencies I explicitly added using<br>
> find_libraries appear rooted at ${CMAKE_FIND_ROOT_PATH}, which is what I<br>
> expected.<br>
><br>
> Is this behavior correct, or did I misunderstood something along the way?<br>
><br>
> In case it helps, my toolchain file looks something like this:<br>
<br>
</div>Looks ok.<br>
Did you check the executable in the build tree or installed ? This matters<br>
because this changes the RPATH. If you build without RPATH, you will get what<br>
ld finds, which is probably libc in /lib.<br>
</blockquote><div><br>I checked both my build and my installation trees. In both cases ldd says that libc is taken from /lib, instead of ${CMAKE_FIND_ROOT_PATH}/lib<br>I use rpath settings in my project [1], and I can verify the -rpath flag value when I do 'make VERBOSE=1'. Its value points to the folders where my external deps are located, but not to the location of libc. Does rpath only affect the libraries I explicitly link against?<br>
<br>[1] In case you think it helps, these are my rpath settings:<br><br># Use, i.e. don't skip the full RPATH for the build tree<br>set(CMAKE_SKIP_BUILD_RPATH FALSE)<br><br># When building, don't use the install RPATH already<br>
# (but later on when installing)<br>set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)<br><br># The RPATH to be used when installing<br>set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")<br><br># Add the automatically determined parts of the RPATH<br>
# which point to directories outside the build tree to the install RPATH<br>set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)<br><br></div></div><br>Thanks,<br><br clear="all"><br>-- <br>Adolfo Rodríguez Tsouroukdissian<br><br>
Robotics engineer<br>PAL ROBOTICS S.L<br><a href="http://www.pal-robotics.com">http://www.pal-robotics.com</a><br>Tel. +34.93.414.53.47<br>Fax.+34.93.209.11.09<br>