In the midst of installing rustup 1.25.2-3 (Sat 31 Aug 2024 16:41:52) via makedeb, which is locally built, I’m seeing the following error.
The following warnings were emitted during compilation:
warning: cc: error: ‘-march=x86-64’: ISA string must begin with rv32 or rv64
error: failed to run custom build command for `sys-info v0.9.1`
Caused by:
process didn't exit successfully: `/home/debian/rustup/src/rustup-1.25.2/target/release/build/sys-info-1a75f39fa2e70555/build-script-build` (exit status: 1)
--- stdout
TARGET = Some("riscv64gc-unknown-linux-gnu")
OPT_LEVEL = Some("3")
HOST = Some("riscv64gc-unknown-linux-gnu")
CC_riscv64gc-unknown-linux-gnu = None
CC_riscv64gc_unknown_linux_gnu = None
HOST_CC = None
CC = None
CFLAGS_riscv64gc-unknown-linux-gnu = None
CFLAGS_riscv64gc_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = Some("-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection")
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = None
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-march=rv64gc" "-mabi=lp64d" "-mcmodel=medany" "-march=x86-64" "-mtune=generic" "-O2" "-pipe" "-fno-plt" "-fexceptions" "-Wp,-D_FORTIFY_SOURCE=2" "-Wformat" "-Werror=format-security" "-fstack-clash-protection" "-fcf-protection" "-o" "/home/debian/rustup/src/rustup-1.25.2/target/release/build/sys-info-73bd6f2e2f8646f5/out/c/linux.o" "-c" "c/linux.c"
cargo:warning=cc: error: ‘-march=x86-64’: ISA string must begin with rv32 or rv64
exit status: 1
--- stderr
error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-march=rv64gc" "-mabi=lp64d" "-mcmodel=medany" "-march=x86-64" "-mtune=generic" "-O2" "-pipe" "-fno-plt" "-fexceptions" "-Wp,-D_FORTIFY_SOURCE=2" "-Wformat" "-Werror=format-security" "-fstack-clash-protection" "-fcf-protection" "-o" "/home/debian/rustup/src/rustup-1.25.2/target/release/build/sys-info-73bd6f2e2f8646f5/out/c/linux.o" "-c" "c/linux.c" with args "cc" did not execute successfully (status code exit status: 1).
So it looks like x86-64 is hard coded for some reason?
Unfortunately I’m not familiar with the build system for rust, so I’m pretty clueless to what is actually causing this, which library and where. I’ve spent about an hour on and off looking at sys-info and rustup, but I don’t see where extra march and mtune are coming from.