-
Notifications
You must be signed in to change notification settings - Fork 397
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
Fix tests, linkers, and specifications for various targets. #1028
Conversation
Blocking this until #1008 is merged, so we can use the new TOML format for the matrix. |
853779e
to
983edbc
Compare
bors try |
We might be able to fix the partial C++ support for |
tryBuild failed: |
983edbc
to
f577b1a
Compare
bors try --target mips64el-unknown-linux-muslabi64 |
tryBuild succeeded: |
This is technically a breaking change for Similarly, the 32-bit MIPS musl targets should also likely be hard-float. |
We should clearly document the target specifications, since we know:
So with this change, all our targets are now correct for soft or hard-float. |
f577b1a
to
0445d3d
Compare
We can probably get away with building the musl toolchain for a generic |
bors try --target mipsmusl |
This PR: - Fixes linking to libgcc for `armv5te-unknown-linux-musleabi`. - Adds C++ support for FreeBSD targets by linking to `libstdc++`. - Tests dynamic library support for Android targets in CI. - Tests C++ support for `mips64el-unknown-linux-muslabi64` in CI. - Convert mips64el-unknown-linux-muslabi64 to a hard-float toolchain to match the rust target. - Convert mips64el-unknown-linux-muslabi64 to use the mips64r2 architecture. - Convert mips-unknown-linux-musl and mipsel-unknown-linux-musl to use the mips32r2 architecture, identical to the rust targets. - Document whether MIPS musl targets are hard or soft float.
0445d3d
to
102881d
Compare
tryBuild succeeded: |
ENV CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_MUSLABI64_LINKER=mips64el-linux-muslsf-gcc \ | ||
ENV CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_MUSLABI64_LINKER=mips64el-linux-musl-gcc.sh \ | ||
CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_MUSLABI64_RUNNER="/qemu-runner mips64el" \ | ||
CC_mips64el_unknown_linux_muslabi64=mips64el-linux-muslsf-gcc \ | ||
CXX_mips64el_unknown_linux_muslabi64=mips64el-linux-muslsf-g++ \ | ||
CC_mips64el_unknown_linux_muslabi64=mips64el-linux-musl-gcc \ | ||
CXX_mips64el_unknown_linux_muslabi64=mips64el-linux-musl-g++ \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @abcfy2
does this change work for you?
You can build the image with
cargo xtask build-docker-image mips64el-unknown-linux-muslabi64
this is a hard-float target according to rustc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be hard-float, we're just using a soft float toolchain which is bound to cause problems at some point. A quick test is:
$ cargo init --bin hello
$ cross build --target mips64el-unknown-linux-muslabi64
$ file target/mips64el-unknown-linux-muslabi64/debug/hello
target/mips64el-unknown-linux-muslabi64/debug/hello: ELF 64-bit LSB executable, MIPS, MIPS64 rel2 version 1 (SYSV), statically linked, with debug_info, not stripped
$ readelf -A target/mips64el-unknown-linux-muslabi64/debug/hello | grep Tag_GNU_MIPS_ABI_FP
Tag_GNU_MIPS_ABI_FP: Hard float (double precision)
$ docker run -it --rm ghcr.io/cross-rs/mips64el-unknown-linux-muslabi64:main bash
# still using the soft-float toolchain
$ echo $CROSS_MUSL_SYSROOT/
/usr/local/mips64el-linux-muslsf/
# show 32-bit is soft-float
$ cross build --target mipsel-unknown-linux-musl
$ file target/mipsel-unknown-linux-musl/debug/hello
target/mipsel-unknown-linux-musl/debug/hello: ELF 32-bit LSB pie executable, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-mipsel-sf.so.1, with debug_info, not stripped
$ readelf -A target/mipsel-unknown-linux-musl/debug/hello | grep Tag_GNU_MIPS_ABI_FP
Tag_GNU_MIPS_ABI_FP: Soft float
So we're linking a hard-float executable with a soft-float toolchain, which isn't exactly ideal, and bound to cause problems later down the line.
bors try --target mipsmusl --target aarch64-unknown-linux-musl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
Fix comment. Co-authored-by: Emil Gardström <[email protected]>
tryBuild succeeded: |
bors r=Emilgardis |
Build succeeded: |
armv5te-unknown-linux-musleabi
.libstdc++
.mips64el-unknown-linux-muslabi64
in CI.mips64el-unknown-linux-muslabi64
to a hard-float toolchain to match the rust target.mips64el-unknown-linux-muslabi64
to use themips64r2
architecture.mips-unknown-linux-musl
andmipsel-unknown-linux-musl
to use themips32r2
architecture, identical to the rust targets.