Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop toolchain path #56

Open
lucasdemarchi opened this issue Nov 22, 2019 · 0 comments
Open

Drop toolchain path #56

lucasdemarchi opened this issue Nov 22, 2019 · 0 comments

Comments

@lucasdemarchi
Copy link

lucasdemarchi commented Nov 22, 2019

I'm evaluating using exodus as an installation method for ArduPilot in the boards that run Linux.

After cross-compiling the plane binary I have this output:

$ readelf -d build/disco/bin/arduplane  | grep NEEDED
 0x00000001 (NEEDED)                     Shared library: [libdl.so.2]
 0x00000001 (NEEDED)                     Shared library: [libiio.so.0]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]

I'm using a buildroot rootfs + toolchain to cross-compile. By passing the -c option to exodus, it picks ld correctly and works. However the resulting tarball contains the local paths used in the machine creating it, both the tarball's full path and the binary's full path. So I have something like this:

tar -tf exodus-arduplane-bundle.tgz
exodus/bundles/9d9d2e5fe02b776c0e5f278239b087099adf73b729f31d681e979c4f573cd18c/home/ldmartin/p/buildroot/output/target/lib/ld-linux-armhf.so.3
exodus/bundles/9d9d2e5fe02b776c0e5f278239b087099adf73b729f31d681e979c4f573cd18c/home/ldmartin/p/buildroot/output/target/lib/libc.so.6
...
exodus/bundles/9d9d2e5fe02b776c0e5f278239b087099adf73b729f31d681e979c4f573cd18c/home/ldmartin/p/drone/ardupilot/build/disco/bin/arduplane

The option passed to -c was /home/ldmartin/p/buildroot/output/target/. Would it be possible for exodus not to use the full path and make it operate a) relative to the binary and b) to the rootfs? In other words, I was expecting the following output and wonder if it would be feasible:

exodus/bundles/9d9d2e5fe02b776c0e5f278239b087099adf73b729f31d681e979c4f573cd18c/lib/ld-linux-armhf.so.3
exodus/bundles/9d9d2e5fe02b776c0e5f278239b087099adf73b729f31d681e979c4f573cd18c/lib/libc.so.6
...
exodus/bundles/9d9d2e5fe02b776c0e5f278239b087099adf73b729f31d681e979c4f573cd18c/bin/arduplane

A workaround is by binding mounting to, say, /mnt:

$ sudo mount --bind /home/ldmartin/p/buildroot/output/target/ /mnt
$ sudo touch /mnt/bin/arduplane
$ sudo mount --bind /home/ldmartin/p/drone/ardupilot/build/disco/bin/arduplane /mnt/bin/arduplane

then there's only /mnt extra in the path, but I guess it would be nice if this could be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant