Skip to content

Commit

Permalink
Merge pull request #1281 from ziyao233/outgoing/fix-static-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
rui314 authored Jun 16, 2024
2 parents cff858b + d2774b0 commit b83b195
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions test/elf/common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ test_cflags() {
echo 'int main() {}' | $CC "$@" -o /dev/null -xc - >& /dev/null
}

test_cxxflags() {
echo 'int main() {}' | $CXX "$@" -o /dev/null -xc++ - >& /dev/null
}

is_musl() {
ldd --version 2>&1 | grep -q musl
}
Expand Down
2 changes: 1 addition & 1 deletion test/elf/exception.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[ $MACHINE = sh4 ] && skip

static=
test_cflags -static && static=-static
test_cxxflags -static && static=-static

# I don't know why, but we need -pthread on m68k
static="$static -pthread"
Expand Down
2 changes: 1 addition & 1 deletion test/elf/x86_64_exception-mcmodel-large.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ EOF
$CXX -B. -o $t/exe $t/a.o -mcmodel=large
$QEMU $t/exe

if echo 'int main() {}' | $CC -o /dev/null -xc - -static >& /dev/null; then
if test_cxxflags -static; then
$CXX -B. -o $t/exe $t/a.o -static -mcmodel=large
$QEMU $t/exe
fi

0 comments on commit b83b195

Please sign in to comment.