<div dir="ltr"><div>So it looks like -XR is not the solution for cross-compiling, at least in my case.<br><div><div><br>The compiler option I used:<br><br><div style="margin-left:40px">-XR/usr/local/opt/chroot/raspbian/rootfs<br>
</div><br></div>seems to break when the linker encounters a linker script that specifies a new path for the actual library object required; these generated paths are not prepended when using -XR.<br><br></div><div>Instead one needs to use --sysroot so I've replaced this one line with:<br>
<br><div style="margin-left:40px">-Xd <br>-k--sysroot=/usr/local/opt/chroot/raspbian/rootfs<br>-Fl/usr/local/opt/chroot/raspbian/rootfs/lib/arm-linux-gnueabihf<br>-Fl/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf<br>
</div><br></div>disabling the default paths and making explicit the paths one actually requires. I still don't understand how FPC generates the search paths per my previous email but at least this alternative, verbose though it is, seems to work. <br>
<br>Is this the correct (i.e. "best practice") solution?<br><br></div>Thanks, Bruce.<br><div><div><div><div><br><br></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 23, 2013 at 3:38 PM, Bruce Tulloch <span dir="ltr"><<a href="mailto:pascal@causal.com" target="_blank">pascal@causal.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Using FPC 2.7.1 I'm cross-compiling from x86_64 to ARM/RPi and have specified:<br>
<br><div style="margin-left:40px">-XR/usr/local/opt/chroot/raspbian/rootfs<br></div><br></div>This produces a link.res file that includes the following:<br>
<br><div style="margin-left:40px">SEARCH_DIR("/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf/")<br>SEARCH_DIR("/usr/local/opt/chroot/raspbian/rootfs/lib/")<br>SEARCH_DIR("/usr/local/opt/chroot/raspbian/rootfs/usr/lib/")<br>

</div><br></div>but it DOES NOT include this line:<br><br><div style="margin-left:40px">SEARCH_DIR("/usr/local/opt/chroot/raspbian/rootfs/lib/arm-linux-gnueabihf/")<br></div>
<br></div>despite the fact the ld.so configuration file:<br><br><div style="margin-left:40px">/usr/local/opt/chroot/raspbian/rootfs/etc/ld.so.conf.d/arm-linux-gnueabihf.conf<br></div><br></div><div>specifies both paths as:<br>

<br><div style="margin-left:40px"># Multiarch support<br>/lib/arm-linux-gnueabihf<br>/usr/lib/arm-linux-gnueabihf<br></div><br></div><div>What am I doing wrong?<br><br></div><div>Thanks, Bruce<br></div></div>
</blockquote></div><br></div>