Add arm6vl (rpi) build

This commit is contained in:
Brian Picciano 2023-11-15 20:39:15 +01:00
parent ada434032b
commit 0ed265db6f

View File

@ -23,6 +23,12 @@
rustTarget = "aarch64-unknown-linux-musl"; rustTarget = "aarch64-unknown-linux-musl";
}; };
# Old Raspberry Pi's
"armv6l-linux" = {
crossSystemConfig = "armv6l-unknown-linux-musleabihf";
rustTarget = "arm-unknown-linux-musleabihf";
};
"x86_64-windows" = { "x86_64-windows" = {
crossSystemConfig = "x86_64-w64-mingw32"; crossSystemConfig = "x86_64-w64-mingw32";
rustTarget = "x86_64-pc-windows-gnu"; rustTarget = "x86_64-pc-windows-gnu";
@ -127,12 +133,15 @@
# Required because ring crate is special. This also seems to have # Required because ring crate is special. This also seems to have
# fixed some issues with the x86_64-windows cross-compile :shrug: # fixed some issues with the x86_64-windows cross-compile :shrug:
TARGET_CC="${pkgsCross.stdenv.cc}/bin/${pkgsCross.stdenv.cc.targetPrefix}cc"; TARGET_CC = "${pkgsCross.stdenv.cc}/bin/${pkgsCross.stdenv.cc.targetPrefix}cc";
CARGO_BUILD_TARGET = rustTarget; CARGO_BUILD_TARGET = rustTarget;
CARGO_BUILD_RUSTFLAGS = [ CARGO_BUILD_RUSTFLAGS = [
"-C" "target-feature=+crt-static" "-C" "target-feature=+crt-static"
"-C" "link-arg=-static"
# -latomic is required to build openssl-sys for armv6l-linux, but
# it doesn't seem to hurt any other builds.
"-C" "link-args=-static -latomic"
# https://github.com/rust-lang/cargo/issues/4133 # https://github.com/rust-lang/cargo/issues/4133
"-C" "linker=${TARGET_CC}" "-C" "linker=${TARGET_CC}"