commit f5917c35bdfa6c297647f4ceb60b01793ad57f0a parent 7918c9411c01027b096c60c2e245c36591b0076b Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu> Date: Wed, 4 Jan 2017 21:51:06 -0500 attempt to fix cc flags in tests Diffstat:
M | tools/unit.sh | | | 11 | ++++++++++- |
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tools/unit.sh b/tools/unit.sh @@ -59,7 +59,7 @@ once() { LNK="$ASM" fi - if ! cc -no-pie -g -o $BIN $LNK + if ! cc $PIE -g -o $BIN $LNK then echo "[cc fail]" return 1 @@ -94,6 +94,15 @@ then exit 1 fi +for wtf in -nopie -no-pie +do + if echo "int main() { return 0; }" | + cc $wtf -x c -o /dev/null - >/dev/null 2>&1 + then + PIE=$wtf + fi +done + case $1 in "all") F=0