-
Notifications
You must be signed in to change notification settings - Fork 1
Cross compiling for zero from Ubuntu #2
Comments
I use Arch locally for cross compiling (I don't build anything on the Pi), but the travis build uses trusty (which sadly still seems to be the latest version they support) and when I originally wrote the instructions it worked within a Ubuntu VM (though I forget which version). I reran the build locally on latest Arch and found no issues. I reran the travis build to create a new image which does appear to suffer from the problem stated. I also ran it using an Ubuntu 18.04 VM and was able to recreate the issue so there is a problem with at least this version. I will look into it but might take some time to investigate and could be a problem with an Ubuntu package or the rust compiler. |
Thanks for getting back to me. Ubuntu 16.04.3 LTS (on AWS), Raspbian Stretch on Pi Zero. I don't know much about the issue, but I've been looking into it for a while (BurntSushi/ripgrep#676). Just ran into your blog post above and got excited, thinking you had it working on Ubuntu (without using the rpi-tools repo, which I suppose is a reasonable way to go about it, it just seems like there would be a more generic way to compile for armv6 from Ubuntu). I also run Arch locally and find that it compiles for the Zero without a problem, which makes the Ubuntu issue seem even more frustrating. My goal is also simpler Travis builds for armv6 / Pi Zero binaries. I'm happy to close the issue if you'd like, it seems like something out of your control has changed, I was just hoping to find that you'd forgotten to include a step in the instructions. |
I did a bit of research and came across this issue which seems to suggest it is the Ubuntu linker not supporting armv6. I will continue to look into it to see if there is a nice way to build on Ubuntu but given that post it seems to be, download another linker and don't use the Ubuntu one. |
Yeah, I saw that issue as well. I'll see if anyone on r/rust has any further light they can shed on the issue: https://www.reddit.com/r/rust/comments/918m2z/how_to_compile_from_ubuntu_for_armv6_without/ |
As mentioned in the reddit thread above there are not many good options from what I could find. LLD support was added for wasm But there are still issues for arm targets
Adding the following to the
Built with This leaves not using an Ubuntu image or downloading/compiling a working GNU linker, neither of which is ideal. |
Are you cross compiling these from Ubuntu as described at https://disconnected.systems/blog/rust-powered-rover/ ?
Essentially:
Then
cargo build --release --target arm-unknown-linux-gnueabihf
?Using those instructions, even
hello world
segfaults for me when compiled from Ubuntu for Pi Zero (though the same binary runs fine on armv7 like RPi3).The text was updated successfully, but these errors were encountered: