forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#133801 - Gelbpunkt:powerpc64le-unknown-linu…
…x-musl-tier-2, r=jieyouxu,Urgau,Kobzol Promote powerpc64le-unknown-linux-musl to tier 2 with host tools MCP: rust-lang/compiler-team#803 I'm using crosstool-ng for building a toolchain because GCC 9 from `musl-toolchain.sh` has float ABI issues (?) and can't compile LLVM, and writing a crosstool-ng config for a target feels less hacky than yet another target specific shell script. I also defined a kernel version, since there wasn't one specified before. If a lower version is desired, just let me know. I also tried to match the rust configure args with the loongarch64 musl tier 2 target. The resulting compiler works fine, built with `DEPLOY=1 ./src/ci/docker/run.sh dist-powerpc64le-linux` and tested on Alpine Linux in a VM and on a bare metal POWER8 machine: ``` qemu-ppc64le:/tmp/rust-nightly-powerpc64le-unknown-linux-musl$ ash install.sh install: creating uninstall script at /usr/local/lib/rustlib/uninstall.sh install: installing component 'rustc' install: installing component 'rust-std-powerpc64le-unknown-linux-musl' install: installing component 'cargo' install: installing component 'rustfmt-preview' install: installing component 'rls-preview' install: installing component 'rust-analyzer-preview' install: installing component 'llvm-tools-preview' install: installing component 'clippy-preview' install: installing component 'miri-preview' install: installing component 'rust-analysis-powerpc64le-unknown-linux-musl' install: installing component 'llvm-bitcode-linker-preview' install: WARNING: failed to run ldconfig. this may happen when not installing as root. run with --verbose to see the error rust installed. qemu-ppc64le:~$ echo 'fn main() { println!("hello world"); }' > test.rs qemu-ppc64le:~$ rustc test.rs qemu-ppc64le:~$ ./test hello world qemu-ppc64le:~$ file test test: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, OpenPOWER ELF V2 ABI, version 1 (SYSV), statically linked, BuildID[sha1]=596ee6abf9add487ebc54fb71c2076fb6faea013, with debug_info, not stripped ``` try-job: dist-powerpc64le-linux
- Loading branch information
Showing
10 changed files
with
104 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/ci/docker/host-x86_64/dist-powerpc64le-linux/powerpc64le-unknown-linux-musl.defconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
CT_CONFIG_VERSION="4" | ||
CT_EXPERIMENTAL=y | ||
CT_PREFIX_DIR="/x-tools/${CT_TARGET}" | ||
CT_USE_MIRROR=y | ||
CT_MIRROR_BASE_URL="https://ci-mirrors.rust-lang.org/rustc" | ||
CT_ARCH_POWERPC=y | ||
CT_ARCH_LE=y | ||
CT_ARCH_64=y | ||
# CT_DEMULTILIB is not set | ||
CT_ARCH_ARCH="powerpc64le" | ||
CT_KERNEL_LINUX=y | ||
CT_LINUX_V_4_19=y | ||
CT_LIBC_MUSL=y | ||
CT_MUSL_V_1_2_3=y | ||
CT_CC_LANG_CXX=y | ||
CT_GETTEXT_NEEDED=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/doc/rustc/src/platform-support/powerpc64le-unknown-linux-musl.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# powerpc64le-unknown-linux-musl | ||
|
||
**Tier: 2** | ||
|
||
Target for 64-bit little endian PowerPC Linux programs using musl libc. | ||
|
||
## Target maintainers | ||
|
||
- [@Gelbpunkt](https://github.com/Gelbpunkt) | ||
- [@famfo](https://github.com/famfo) | ||
- [@neuschaefer](https://github.com/neuschaefer) | ||
|
||
## Requirements | ||
|
||
Building the target itself requires a 64-bit little endian PowerPC compiler that is supported by `cc-rs`. | ||
|
||
## Building the target | ||
|
||
The target can be built by enabling it for a `rustc` build. | ||
|
||
```toml | ||
[build] | ||
target = ["powerpc64le-unknown-linux-musl"] | ||
``` | ||
|
||
Make sure your C compiler is included in `$PATH`, then add it to the `config.toml`: | ||
|
||
```toml | ||
[target.powerpc64le-unknown-linux-musl] | ||
cc = "powerpc64le-linux-musl-gcc" | ||
cxx = "powerpc64le-linux-musl-g++" | ||
ar = "powerpc64le-linux-musl-ar" | ||
linker = "powerpc64le-linux-musl-gcc" | ||
``` | ||
|
||
## Building Rust programs | ||
|
||
This target are distributed through `rustup`, and otherwise require no | ||
special configuration. | ||
|
||
## Cross-compilation | ||
|
||
This target can be cross-compiled from any host. | ||
|
||
## Testing | ||
|
||
This target can be tested as normal with `x.py` on a 64-bit little endian | ||
PowerPC host or via QEMU emulation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters