From 0bd5a06a201af418fe31c6196a20db227fa249da Mon Sep 17 00:00:00 2001 From: lovasoa Date: Sun, 5 Oct 2025 10:45:31 +0200 Subject: [PATCH] scripts: enhance cross-compilation setup by adding apt-get update and removing redundant installations --- scripts/setup-cross-compilation.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/scripts/setup-cross-compilation.sh b/scripts/setup-cross-compilation.sh index 5f877cbe..1c01db4a 100755 --- a/scripts/setup-cross-compilation.sh +++ b/scripts/setup-cross-compilation.sh @@ -1,9 +1,11 @@ #!/bin/bash -set -euo pipefail +set -euox pipefail TARGETARCH="$1" BUILDARCH="$2" +apt-get update + if [ "$TARGETARCH" = "$BUILDARCH" ]; then # Native build rustup target list --installed > /tmp/TARGET @@ -16,24 +18,15 @@ elif [ "$TARGETARCH" = "arm64" ]; then echo "aarch64-unknown-linux-gnu" > /tmp/TARGET echo "aarch64-linux-gnu-gcc" > /tmp/LINKER - apt-get update apt-get install -y gcc-aarch64-linux-gnu libgcc-s1-arm64-cross pkg-config LIBDIR="/usr/aarch64-linux-gnu/lib" - - # Also install gcc for aarch64 to get libgcc - apt-get install -y gcc-aarch64-linux-gnu - elif [ "$TARGETARCH" = "arm" ]; then echo "armv7-unknown-linux-gnueabihf" > /tmp/TARGET echo "arm-linux-gnueabihf-gcc" > /tmp/LINKER - apt-get update apt-get install -y gcc-arm-linux-gnueabihf libgcc-s1-armhf-cross cmake libclang1 clang pkg-config - # Ensure gcc-arm-linux-gnueabihf is available - apt-get install -y gcc-arm-linux-gnueabihf - cargo install --force --locked bindgen-cli SYSROOT=$(arm-linux-gnueabihf-gcc -print-sysroot)