Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upEnable bootstrapping non-build-machine targets #31884
Conversation
This comment has been minimized.
This comment has been minimized.
|
r? @brson |
alexcrichton
assigned
brson
Feb 25, 2016
alexcrichton
force-pushed the
alexcrichton:no-bootstrap-from-existing
branch
from
cef37ef
to
0d7be2e
Feb 25, 2016
japaric
reviewed
Feb 27, 2016
| @@ -115,6 +115,11 @@ pub fn compiler_rt(build: &Build, target: &str) { | |||
| let mode = if build.config.rust_optimize {"Release"} else {"Debug"}; | |||
| let (dir, build_target, libname) = if target.contains("linux") { | |||
| let os = if target.contains("android") {"-android"} else {""}; | |||
| let arch = if arch == "arm" && target.contains("eabihf") { | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I've tested this PR by cross compiling a compiler to arm-unknown-linux-gnueabihf. And, then testing that cross compiled rustc/std on an ARMv7 board by running some smoke tests. The smoke tests consisted of: building cargo, cargo testing hyper and cargo testing clap and all of them succeeded. (NOTE: I needed cargo on the ARM target, so I used an unofficial cargo binary from RustBuild. The host was an x86_64 machine running Ubuntu 15.10. The target was an ARMv7 machine running hard-float Ubuntu 15.10) I found two (minor) issues. @alexcrichton is already aware of them, but to reiterate:
|
alexcrichton
added some commits
Feb 24, 2016
alexcrichton
force-pushed the
alexcrichton:no-bootstrap-from-existing
branch
from
86d83be
to
15b4a8c
Feb 28, 2016
This comment has been minimized.
This comment has been minimized.
|
Thanks for testing this out @japaric! I've amended the relevant commits and those issues should all be fixed. |
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
How do you exactly use this feature? Can you give an example on howto build for the ARM target you mentioned? |
This comment has been minimized.
This comment has been minimized.
Pass
|
alexcrichton commentedFeb 25, 2016
These commits add support to the rustbuild build system to compile non-build-system compilers. For example this will allow creating an ARM compiler on a x86 system. The high level way this works is:
This will break the assumption that a compiler never links to anything it didn't itself produce, but it retains the assumption that a compiler only ever links to anything built in the same stage. I believe this means that the stage1 cross-compiled compilers will still be usable.
I tested this by creating an
arm-unknown-linux-gnueabihfcompiler. So far the linking ended up all working OK (including LLVM being cross compiled), but I haven't been able to run it yet (in QEMU for a raspberry pi). I think that's because my system linker is messed up or something like that (some newer option is assumed when it's not actually there).Overall, though, this means that rustbuild can compile an arm-unknown-linux-gnueabihf compiler. Ideally we could even start shipping nightlies based on this at some point!