Skip to content

Target mips-unknown-linux-musl and mipsel-unknown-linux-musl is not statically linked. #504

Closed
@abcfy2

Description

@abcfy2

Here is very simple way to reproduce:

# create a new project via cargo new
$ cargo new cargo-hello
$ cd cargo-hello

# cross build using x86_64-unknown-linux-musl, it's statically linked
$ cross build --target x86_64-unknown-linux-musl
$ file target/x86_64-unknown-linux-musl/debug/cargo-hello
target/x86_64-unknown-linux-musl/debug/cargo-hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, with debug_info, not stripped

# cross build using arm-unknown-linux-musleabi, it's statically linked
$ cross build --target arm-unknown-linux-musleabi
$ file target/arm-unknown-linux-musleabi/debug/cargo-hello
target/arm-unknown-linux-musleabi/debug/cargo-hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped

# cross build using mips-unknown-linux-musl, it's dynamically linked
$ cross build --target mips-unknown-linux-musl
$ file target/mips-unknown-linux-musl/debug/cargo-hello
target/mips-unknown-linux-musl/debug/cargo-hello: ELF 32-bit MSB pie executable, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-mips-sf.so.1, with debug_info, not stripped

# cross build using mipsel-unknown-linux-musl, also dynamically linked
$ cross build --target mipsel-unknown-linux-musl
$ file target/mipsel-unknown-linux-musl/debug/cargo-hello
target/mipsel-unknown-linux-musl/debug/cargo-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

But according official docs, toolchain with musl should be staticlly linked: https://doc.rust-lang.org/edition-guide/rust-2018/platform-and-target-support/musl-support-for-fully-static-binaries.html

Is there something wrong with mips-unknown-linux-musl and mipsel-unknown-linux-musl ?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions