From e54f7a0fda867f4cc7ae42bfaa6e38ad26034f7f Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 25 Sep 2017 14:41:25 +0200 Subject: adjust test.sh for ubuntu --- tools/test.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools/test.sh') diff --git a/tools/test.sh b/tools/test.sh index 384d585..6e55447 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -10,6 +10,11 @@ asm=$tmp.s exe=$tmp.exe out=$tmp.out +testcc() { + echo "int main() { }" | $1 -x C -o /dev/null - >/dev/null 2>&1 + return $? +} + init() { case "$TARGET" in arm64) @@ -31,7 +36,7 @@ init() { echo "Cannot find arm64 compiler or qemu." exit 1 fi - bin="$bin -t arm64" + bin="$bin -t arm64" ;; "") case `uname` in @@ -46,6 +51,7 @@ init() { ;; *) cc="cc -no-pie" + testcc $cc || cc="cc" ;; esac ;; -- cgit 1.4.1