Uh oh!
There was an error while loading. Please reload this page.
Add ARM MUSL targets - #33189
Conversation
rust-highfive
commented
Apr 25, 2016
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
There was a problem hiding this comment.
Hm perhaps this condition could be reversed to say if target.contains("musl") && !target.contains("mips") ?
alexcrichton
commented
Apr 25, 2016
Thanks for the PR @timonvo, and nice! Also cc @rust-lang/tools, curious on thoughts of the idea on using I don't quite know what the best way to expose this would be. We could perhaps add a |
timonvo
commented
Apr 27, 2016
Hi Alex, I think I've addressed all your comments. Is there anything else you'd like to see before this can land? I was thinking I'd squash the last two commits into the Regarding the |
alexcrichton
commented
Apr 27, 2016
Hm yeah I was thinking on waiting for a resolution of musleabi vs just musl, but I think you're right that it's probably best to duke out elsewhere. If you wanna do some squashes I'll r+. Thanks @timonvo! |
This is to pull in changes to support ARM MUSL targets. This change also commits a couple of other cargo-generated changes to other dependencies in the various Cargo.toml files.
The targets are: - `arm-unknown-linux-musleabi` - `arm-unknown-linux-musleabihf` - `armv7-unknown-linux-musleabihf` These mirror the existing `gnueabi` targets. All of these targets produce fully static binaries, similar to the x86 MUSL targets. For now these targets can only be used with `--rustbuild` builds, as rust-lang/compiler-rt#22 only made the necessary compiler-rt changes in the CMake configs, not the plain GNU Make configs. I've tested these targets GCC 5.3.0 compiled again musl-1.1.12 (downloaded from http://musl.codu.org/). An example `./configure` invocation is: ``` ./configure \ --enable-rustbuild --target=arm-unknown-linux-musleabi \ --musl-root="$MUSL_ROOT" ``` where `MUSL_ROOT` points to the `arm-linux-musleabi` prefix. Usually that path will be of the form `/foobar/arm-linux-musleabi/arm-linux-musleabi`. Usually the cross-compile toolchain will live under `/foobar/arm-linux-musleabi/bin`. That path should either by added to your `PATH` variable, or you should add a section to your `config.toml` as follows: ``` [target.arm-unknown-linux-musleabi] cc = "/foobar/arm-linux-musleabi/bin/arm-linux-musleabi-gcc" cxx = "/foobar/arm-linux-musleabi/bin/arm-linux-musleabi-g++" ``` As a prerequisite you'll also have to put a cross-compiled static `libunwind.a` library in `$MUSL_ROOT/lib`. This is similar to [how the x86_64 MUSL targets are built] (https://doc.rust-lang.org/book/advanced-linking.html).
timonvo
commented
Apr 28, 2016
Just did the squash of the last two commits. |
| // It's important we use "gnueabi" and not "musleabi" here. LLVM uses it | ||
| // to determine the calling convention and float ABI, and it doesn't | ||
| // support the "musleabi" value. | ||
| llvm_target: "arm-unknown-linux-gnueabi".to_string(), |
There was a problem hiding this comment.
Is it intentional to pass "gneuabi" to LLVM instead of "musleabi"?
There was a problem hiding this comment.
Yes it is. I believe the comment above explains why :)
alexcrichton
commented
Apr 28, 2016
Just one minor nit but otherwise r=me |
alexcrichton
commented
Apr 28, 2016
bors
commented
Apr 28, 2016
⌛ Testing commit 483d805 with merge 9147703... |
bors
commented
Apr 28, 2016
💔 Test failed - auto-win-msvc-64-opt-rustbuild |
alexcrichton
commented
May 4, 2016
timonvo
commented
May 5, 2016
Sure, I'll try to make that change. I'm not sure when I'll have time in next week or two, so this may be on hold for a while. |
rustc_back: use a common musl base extracted from #33327. cc #33189. r? @alexcrichton
rustc_back: use a common musl base extracted from #33327. cc #33189. r? @alexcrichton
bors
commented
May 7, 2016
☔ The latest upstream changes (presumably #33359) made this pull request unmergeable. Please resolve the merge conflicts. |
alexcrichton
commented
Jun 28, 2016
Closing due to inactivity, but feel free to resubmit with a rebase! |
japaric
commented
Jul 26, 2016
@timonvo If you don't mind, I'm going to try to rebase this. |
Add ARM MUSL targets Rebase of rust-lang#33189. I tested this by producing a std for `arm-unknown-linux-musleabi` then I cross compiled Hello world to said target. Checked that the produced binary was statically linked and verified that the binary worked under QEMU. This depends on rust-lang/libc#341. I'll have to update this PR after that libc PR is merged. I'm also working on generating ARM musl cross toolchain via crosstool-ng. Once I verified those work, I'll send a PR to rust-buildbot. r? @alexcrichton cc @timonvo
Add ARM MUSL targets Rebase of #33189. I tested this by producing a std for `arm-unknown-linux-musleabi` then I cross compiled Hello world to said target. Checked that the produced binary was statically linked and verified that the binary worked under QEMU. This depends on rust-lang/libc#341. I'll have to update this PR after that libc PR is merged. I'm also working on generating ARM musl cross toolchain via crosstool-ng. Once I verified those work, I'll send a PR to rust-buildbot. r? @alexcrichton cc @timonvo
The targets are:
arm-unknown-linux-musleabiarm-unknown-linux-musleabihfarmv7-unknown-linux-musleabihfThese mirror the existing
gnueabitargets.All of these targets produce fully static binaries, similar to the
x86 MUSL targets.
For now these targets can only be used with
--rustbuildbuilds, asrust-lang/compiler-rt#22 only made the
necessary compiler-rt changes in the CMake configs, not the plain
GNU Make configs.
I've tested these targets GCC 5.3.0 compiled again musl-1.1.12
(downloaded from http://musl.codu.org/). An example
./configureinvocation is:
where
MUSL_ROOTpoints to thearm-linux-musleabiprefix.Usually that path will be of the form
/foobar/arm-linux-musleabi/arm-linux-musleabi.Usually the cross-compile toolchain will live under
/foobar/arm-linux-musleabi/bin. That path should either by addedto your
PATHvariable, or you should add a section to yourconfig.tomlas follows:As a prerequisite you'll also have to put a cross-compiled static
libunwind.alibrary in$MUSL_ROOT/lib. This is similar to howthe x86_64 MUSL targets are built.
r? @alexcrichton