From 06ae4bf6f936ccfcc49678e7e30a1437f43e458a Mon Sep 17 00:00:00 2001 From: Brandon Payton Date: Tue, 14 Jul 2026 01:11:28 -0400 Subject: [PATCH] build: keep optional wasm64 flags nounset-safe The program builder runs under Bash 3.2 on macOS, where expanding an empty array with nounset enabled aborts the script. Guard the optional wasm64 compiler flags with the same array-preserving expansion already used by the wasm32 path. --- scripts/build-programs.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build-programs.sh b/scripts/build-programs.sh index 68bbf342a2..b20c7cca62 100755 --- a/scripts/build-programs.sh +++ b/scripts/build-programs.sh @@ -285,7 +285,8 @@ if [ -f "$SYSROOT64/lib/libc.a" ]; then if [ "$local_name" = "posix-timer-thread" ]; then extra_flags=(-DWASM_POSIX_THREAD_SLOT_DECL=8) fi - "$CC" "${CFLAGS64[@]}" "${extra_flags[@]}" "$src" "${LINK_FLAGS64[@]}" \ + # Keep empty optional flags safe under Bash 3.2 with `set -u`. + "$CC" "${CFLAGS64[@]}" ${extra_flags[@]+"${extra_flags[@]}"} "$src" "${LINK_FLAGS64[@]}" \ -o "$OUT_DIR_64/${local_name}.wasm" done