Skip to content

rustc fails to build for target riscv64gc-unknown-linux-musl #111700

Open
@r-value

Description

@r-value

I'm trying to build rustc version 1.68.0 natively on RISC-V machine with target riscv64gc-unknown-linux-musl enabled. It fails when building libunwind.a for musl target in stage2.

Similar error also occurs in version 1.69.0.

Configuration:

[target.riscv64gc-unknown-linux-musl]
sanitizers = false
musl-root = "/usr/lib/musl"
cc = "/usr/bin/musl-gcc"
cxx = "/usr/bin/musl-gcc"

Error log:

Building libunwind.a for riscv64gc-unknown-linux-musl
CXX_riscv64gc-unknown-linux-musl = None
CXX_riscv64gc_unknown_linux_musl = None
TARGET_CXX = None
CXX = None
CROSS_COMPILE = None
CXXFLAGS_riscv64gc-unknown-linux-musl = None
CXXFLAGS_riscv64gc_unknown_linux_musl = None
TARGET_CXXFLAGS = None
CXXFLAGS = Some("-march=rv64gc -mabi=lp64d -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -Wp,-D_GLIBCXX_ASSERTIONS")
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = None
running: "/usr/bin/musl-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-march=rv64gc" "-mabi=lp64d" "-mcmodel=medany" "-march=rv64gc" "-mabi=lp64d" "-O2" "-pipe" "-fno-plt" "-fexceptions" "-Wp,-D_FORTIFY_SOURCE=2" "-Wformat" "-Werror=format-security" "-fstack-clash-protection" "-I" "/build/rust/src/rustc-1.68.0-src/src/llvm-project/libunwind/include" "-nostdinc++" "-fno-exceptions" "-fno-rtti" "-fstrict-aliasing" "-funwind-tables" "-fvisibility=hidden" "-std=c++11" "-fvisibility-global-new-delete-hidden" "-D_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS" "-o" "/build/rust/src/rustc-1.68.0-src/build/riscv64gc-unknown-linux-musl/native/libunwind/Unwind-EHABI.o" "-c" "/build/rust/src/rustc-1.68.0-src/src/llvm-project/libunwind/src/Unwind-EHABI.cpp"
cargo:warning=cc1plus: error: unrecognized command-line option ‘-fvisibility-global-new-delete-hidden’
exit status: 1


error occurred: Command "/usr/bin/musl-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-march=rv64gc" "-mabi=lp64d" "-mcmodel=medany" "-march=rv64gc" "-mabi=lp64d" "-O2" "-pipe" "-fno-plt" "-fexceptions" "-Wp,-D_FORTIFY_SOURCE=2" "-Wformat" "-Werror=format-security" "-fstack-clash-protection" "-I" "/build/rust/src/rustc-1.68.0-src/src/llvm-project/libunwind/include" "-nostdinc++" "-fno-exceptions" "-fno-rtti" "-fstrict-aliasing" "-funwind-tables" "-fvisibility=hidden" "-std=c++11" "-fvisibility-global-new-delete-hidden" "-D_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS" "-o" "/build/rust/src/rustc-1.68.0-src/build/riscv64gc-unknown-linux-musl/native/libunwind/Unwind-EHABI.o" "-c" "/build/rust/src/rustc-1.68.0-src/src/llvm-project/libunwind/src/Unwind-EHABI.cpp" with args "musl-gcc" did not execute successfully (status code exit status: 1).

It probably relates to rust-lang/cc-rs#675 since cc is specified manually for musl.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)requires-custom-configThis issue requires custom config/build for rustc in some way

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions