Summary
Posted by @denizsokmen #141375 (comment):
Custom target issue is actually more related to Rust bootstrap forcefully cross-compiling crtbegin, crtend and llvm-libunwind for musl for self-contained linkage reasons:
|
let libunwind_path = copy_llvm_libunwind(builder, target, &libdir_self_contained); |
and https://github.com/rust-lang/rust/blob/master/src/bootstrap/src/core/config/target_selection.rs#L96
I see no way to opt out of that, even though those binaries won't be used as they'll be fetched from the sysroot of that musl-based custom target. Is there a way to tell Rust bootstrap not to bother with preparing self-contained binaries?
Expected behaviour
A way to out-put crtbegin, crtend and llvm-libunwind build for custom musl target.
Actual behaviour
You'll need to patch code as described: #141375 (comment).
Possible solution
Probalby extend the target table in bootstrap.toml like target.self-contained = <bool>?
Bootstrap configuration (bootstrap.toml)
[target.my-custom-musl]
linker = "…"
musl-root = "…"
cc = "…"
cxx = "…"
cflags = "…"
cxxflags = "…"
rustflags= "…"
llvm-libunwind = "system"
HEAD
5b9007b
Summary
Posted by @denizsokmen #141375 (comment):
Expected behaviour
A way to out-put crtbegin, crtend and llvm-libunwind build for custom musl target.
Actual behaviour
You'll need to patch code as described: #141375 (comment).
Possible solution
Probalby extend the
targettable inbootstrap.tomlliketarget.self-contained = <bool>?Bootstrap configuration (bootstrap.toml)
HEAD
5b9007b