Skip to content

Commit 1d29ac2

Browse files
committed
Revert "just strip out the error and return the output instead of executing again without version"
This reverts commit d588e6e.
1 parent a44d906 commit 1d29ac2

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/SPC/store/scripts/zig-cc.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,21 @@ else
7272
status=$?
7373

7474
if [ $status -eq 0 ]; then
75-
echo "$output"
75+
echo "$output" | grep -v "version '.*' in target triple"
7676
exit 0
7777
fi
7878

7979
if echo "$output" | grep -q "version '.*' in target triple"; then
80-
echo "$output" | grep -v "version '.*' in target triple"
81-
exit 0
80+
TARGET_FALLBACK="${SPC_TARGET}-${SPC_LIBC}"
81+
output=$(zig cc -target "$TARGET_FALLBACK" -lstdc++ ${COMPILER_EXTRA} "${PARSED_ARGS[@]}" 2>&1)
82+
status=$?
83+
84+
if [ $status -eq 0 ]; then
85+
echo "$output"
86+
exit 0
87+
else
88+
exec zig cc -target "$TARGET_FALLBACK" ${COMPILER_EXTRA} "${PARSED_ARGS[@]}"
89+
fi
8290
else
8391
exec zig cc -target "$TARGET" ${COMPILER_EXTRA} "${PARSED_ARGS[@]}"
8492
fi

0 commit comments

Comments
 (0)