From 1d29ac228c42531a5f008e480c3cb538e7769e36 Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Sun, 29 Jun 2025 10:40:48 +0700 Subject: [PATCH] Revert "just strip out the error and return the output instead of executing again without version" This reverts commit d588e6e4fd8df910a39603949191d5e7170a219e. --- src/SPC/store/scripts/zig-cc.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/SPC/store/scripts/zig-cc.sh b/src/SPC/store/scripts/zig-cc.sh index 343fec51..1459a0fc 100644 --- a/src/SPC/store/scripts/zig-cc.sh +++ b/src/SPC/store/scripts/zig-cc.sh @@ -72,13 +72,21 @@ else status=$? if [ $status -eq 0 ]; then - echo "$output" + echo "$output" | grep -v "version '.*' in target triple" exit 0 fi if echo "$output" | grep -q "version '.*' in target triple"; then - echo "$output" | grep -v "version '.*' in target triple" - exit 0 + TARGET_FALLBACK="${SPC_TARGET}-${SPC_LIBC}" + output=$(zig cc -target "$TARGET_FALLBACK" -lstdc++ ${COMPILER_EXTRA} "${PARSED_ARGS[@]}" 2>&1) + status=$? + + if [ $status -eq 0 ]; then + echo "$output" + exit 0 + else + exec zig cc -target "$TARGET_FALLBACK" ${COMPILER_EXTRA} "${PARSED_ARGS[@]}" + fi else exec zig cc -target "$TARGET" ${COMPILER_EXTRA} "${PARSED_ARGS[@]}" fi