-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.O-MIPSTarget: MIPS processorsTarget: MIPS processorsO-muslTarget: The musl libcTarget: The musl libcT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I'm trying rebuild stdlib for the OpenWRT malta SDK (available here: https://downloads.openwrt.org/releases/18.06.2/targets/malta/be/openwrt-sdk-18.06.2-malta-be_gcc-7.3.0_musl.Linux-x86_64.tar.xz).
The SDK ships with libgcc_s.so
, but without libunwind.a
, leading to a linker error when building unwind
. I'd like to run with panic=abort
, so I don't need unwinding.
error: could not find native static library unwind, perhaps an -L flag is missing?
mips
is special-cased in libunwind here: https://github.com/rust-lang/rust/blob/master/src/libunwind/lib.rs#L28-L31
I tried passing target-feature=-crt-static
and using a custom target target:
"crt-static-default": false,
"crt-static-respected": true,
"dynamic-linking": true,
Both don't work.
Steps to reproduce:
- Unzip the SDK
- Make sure
openwrt-sdk-18.06.2-malta-be_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/
is inPATH
- Set the linker:
[target.mips-openwrt-linux-musl]
linker = "mips-openwrt-linux-gcc"
- Use Xargo to rebuild stdlib
Building and running a binary works when modifying the code above to just link gcc_s
:
#[cfg(target_env = "musl")]
#[link(name = "gcc_s")]
extern {}
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.O-MIPSTarget: MIPS processorsTarget: MIPS processorsO-muslTarget: The musl libcTarget: The musl libcT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.