-
Notifications
You must be signed in to change notification settings - Fork 93
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
Can't install on Ubuntu 15.10 #16
Comments
Hello Matt, I want to clarify what you are trying to do: (a) You want to cross compile a Rust program for the RPI. This is, you are running these commands on e.g. your laptop. Or, Because this guide is about the case (a). And from the output you pasted above it seems to me that you are trying to do (b) but I could be wrong. If you tell which route you want to follow (a) or (b), I'd gladly help you with either 😄.
For the RPI, the "triple" you want is either |
Thanks for the quick response. Indeed, I am trying option 'a'. I started reading the non tl;dr section, and installed the raspberry pi tools, and have been struggling to figure those out, but think I may have. I've setup my path to look for the arm-* versions of the toolchain, they're all there. I install the std crate, and I'm able to compile some stuff, though it seems that it fails when it's time to link. Anyway, I wanted to let you know that I followed your tl;dr to the letter, and it didn't work ;-) You were so clear about asking for help with typos and such. If I can't get the linking to work, that's probably pilot error, and not a bug in your docs. Thanks! |
Oh, I get tons of these after a long compile:
I wonder why it's using /usr/bin/ld rather than the arm-linux-gnueabihf-ld |
You did use a different target triple though ;-). The problem is that the installation of the RPi cross compiler is more involved the installation of a ARMv7 cross compiler -- there is no (apt) packaged cross compiler for RPi in Ubuntu/Debian AFAIK.
Did you set the linker in .cargo/config? Something like this but with the RPi target and the right gcc:
You can confirm that you are using the right linker by calling |
These step work for me:
The |
You're correct -- it wasn't to the letter ;-) I didn't use that branch of the rpi tools; there is literally no documentation, so I was using the I'll see if I can duplicate your good results... |
Thank you; I was able to use rustup (needed the beta channel, not the standard) and added the toolchain, did the custom config (not .config as above) and was able to compile the hello example. I can't compile my lib; but that's not your problem at all ;-) For anyone who sees this in the future, YES, the hello example DID run on the rpi1 Thanks! |
Glad to hear it's working now! re: stable vs beta. This target is not available in Rust 1.7, but should be available in Rust 1.8, which comes out this Thursday. |
Let me know if I'm out of line, but I followed precisely the same instructions for compiling my library as the hello example you gave me (which I was able to successfully compile and run)... What results seems like a compiling problem, not a code problem, because the linker can't seem to recognize its output: [much stuff snipped off of the log]
|
Sounds like this crate contains or was linked to a C dependency and said dependency was compiled for the host instead of for the target. The cause could be that the crate is linking to the system (i.e. the ones in /usr/lib) libraries instead of to the target libraries (i.e. the ones in /usr/$target/lib or wherever your distribution installs foreign libraries). Or it could that the crate is compiling a C library, as part of build.rs, using the wrong toolchain (i.e. Does any of your app dependencies wrap a C library? Do you have the cross compiled version of that C library installed in your system? |
lmdb-rs has a bug not really supporting cross-compiling: vhbit/lmdb-rs#33 |
I'm on a rpi 1, so I am using the arm6... trying to otherwise follow along:
Following your "TL;DR Ubuntu example" in your README.md, when I get to
$ curl -sf https://raw.githubusercontent.com/brson/multirust/master/quick-install.sh | sh
$ sudo aptitude install gcc-arm-linux-gnueabi
$ multirust add-target nightly armv6-rpi-linux-gnueabi
leads to:
multirust: toolchain 'nightly' is not installed
; so I tried stable:multirust add-target stable armv6-rpi-linux-gnueabi
rustup: no channel manifest at '/home/mjf/.multirust/toolchains/stable/lib/rustlib/channel-manifest.toml'
I tried a few other variations: arm-rpi-linux-gnueabi arm-generic-linux-gnueabi, no go.
Thanks
The text was updated successfully, but these errors were encountered: