From f87d05736ac3a088e54f52e494de5a295cf54308 Mon Sep 17 00:00:00 2001 From: webbeef Date: Wed, 11 Mar 2026 07:48:17 -0700 Subject: [PATCH] build: fix arm64 builds Signed-off-by: webbeef --- build-arm64.sh | 2 +- crates/beaver_p2p/Cargo.toml | 2 +- support/arm64/fake-clang-ld.sh | 53 ++++++++++++++++++++++------------ 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/build-arm64.sh b/build-arm64.sh index 7afb154..6168b8d 100755 --- a/build-arm64.sh +++ b/build-arm64.sh @@ -30,7 +30,7 @@ export LDFLAGS="-L${SYSROOT}/lib/aarch64-linux-gnu -fuse-ld=lld" # Build without tray icon or global key support cargo build --target aarch64-unknown-linux-gnu --profile ${PROFILE} -p beaver-shell \ --no-default-features \ - --features="libservo/clipboard,js_jit,max_log_level,webgpu" + --features="servo/clipboard,js_jit,max_log_level,webgpu" llvm-strip target/aarch64-unknown-linux-gnu/${PROFILE}/beavershell diff --git a/crates/beaver_p2p/Cargo.toml b/crates/beaver_p2p/Cargo.toml index e4f511c..e6b77e7 100644 --- a/crates/beaver_p2p/Cargo.toml +++ b/crates/beaver_p2p/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" [dependencies] env_logger = "0.11" -iroh = { version = "0.96", features = ["address-lookup-mdns"] } +iroh = { version = "0.96", default-features = false, features = ["address-lookup-mdns"] } iroh-persist = { git = "https://github.com/webbeef/iroh-persist.git", branch = "iroh-0.96" } log = "0.4" n0-error = "0.1" diff --git a/support/arm64/fake-clang-ld.sh b/support/arm64/fake-clang-ld.sh index c686831..e8321ef 100755 --- a/support/arm64/fake-clang-ld.sh +++ b/support/arm64/fake-clang-ld.sh @@ -4,23 +4,40 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. -SYSROOT=`pwd`/scripts/servo-arm64-sysroot - -PARAMS="" - -FORBIDDEN=("--strip-debug", "--strip-all", "--as-needed", "--eh-frame-hdr", "--gc-sections", "-znoexecstack", "-zrelro", "-znow") - -for param in $*; do - -case "${FORBIDDEN[@]}" in - *"$param"*) - echo "Variable is in the forbidden set: $param" - ;; - *) - PARAMS+="$param " - ;; -esac - +SYSROOT="$(pwd)/scripts/servo-arm64-sysroot" + +PARAMS=() + +FORBIDDEN=( + "--no-undefined-version" + "--strip-debug" + "--strip-all" + "--as-needed" + "--eh-frame-hdr" + "--gc-sections" + "-znoexecstack" + "-zrelro" + "-znow" +) + +for param in "$@"; do + # Filter version-script arguments + if [[ "$param" == --version-script=* || "$param" == -Wl,--version-script=* ]]; then + echo "Filtered version script: $param" + continue + fi + + # Filter forbidden exact matches + if [[ " ${FORBIDDEN[*]} " == *" $param "* ]]; then + echo "Variable is in the forbidden set: $param" + continue + fi + + PARAMS+=("$param") done -clang --target=aarch64-linux-gnu --sysroot=${SYSROOT} -fuse-ld=lld $PARAMS +exec clang \ + --target=aarch64-linux-gnu \ + --sysroot="$SYSROOT" \ + -fuse-ld=lld \ + "${PARAMS[@]}" -- 2.51.2