From 8e4b57e33a792579ce58dbbcc7c95c2d9c7eb4aa Mon Sep 17 00:00:00 2001 From: Azalea Gui <22280294+hykilpikonna@users.noreply.github.com> Date: Sun, 22 Dec 2024 05:53:28 -0500 Subject: [PATCH] [F] Fix rust musl build segfault --- tools/rust-builder/general/build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/rust-builder/general/build.sh b/tools/rust-builder/general/build.sh index 73f30dac..a40de4ed 100755 --- a/tools/rust-builder/general/build.sh +++ b/tools/rust-builder/general/build.sh @@ -19,6 +19,10 @@ export CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_MUSL_LINKER=/musl/riscv64/bin/musl-g #export CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER=/osxcross/bin/aarch64-apple-darwin$OSX_VER-clang #export CARGO_TARGET_AARCH64_APPLE_DARWIN_AR=/osxcross/bin/aarch64-apple-darwin$OSX_VER-ar +# Add -C relocation-model=static to the build command +# See https://github.com/rust-lang/rust/issues/95926 +export RUSTFLAGS="-C relocation-model=static" + # Build for platforms cargo build --release --target x86_64-unknown-linux-musl cargo build --release --target aarch64-unknown-linux-musl