Skip to content

Commit b16638d

Browse files
committed
place -lstdc++ in compiler_extra
1 parent a056462 commit b16638d

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/SPC/builder/Extension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ public function buildUnixShared(): void
405405
'LDFLAGS' => $config['ldflags'],
406406
'LIBS' => $preStatic . $staticLibString . $postStatic . $sharedLibString,
407407
'LD_LIBRARY_PATH' => BUILD_LIB_PATH,
408+
'COMPILER_EXTRA' => '-lstdc++'
408409
];
409410

410411
if ($this->patchBeforeSharedPhpize()) {

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,10 @@ fi
4242
output=$(zig cc $TARGET $COMPILER_EXTRA "${PARSED_ARGS[@]}" 2>&1)
4343
status=$?
4444

45-
if [ $status -eq 0 ]; then
46-
echo "$output"
47-
exit 0
45+
if [ $status -ne 0 ] && echo "$output" | grep -q "version '.*' in target triple"; then
46+
output=$(echo "$output" | grep -v "version '.*' in target triple")
47+
status=0
4848
fi
4949

50-
if echo "$output" | grep -q "version '.*' in target triple"; then
51-
echo "$output" | grep -v "version '.*' in target triple"
52-
exit 0
53-
else
54-
echo "$output"
55-
exit $status
56-
fi
50+
echo "$output"
51+
exit $status

0 commit comments

Comments
 (0)