summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Sindholt <opensource@zhasha.com>2015-08-27 16:16:04 +0200
committerJoakim Sindholt <opensource@zhasha.com>2015-08-27 16:16:04 +0200
commitc4cd276e77a409f1776417fb1b126bb79596aa8d (patch)
tree7bd216773cfe7d4d87469c147c48e2e94a5ef174
parent8effa5a8c84d7d3646de046c914ccac44f840471 (diff)
various cleanups in compiler script
-rw-r--r--bin/p9c.sh29
1 files changed, 9 insertions, 20 deletions
diff --git a/bin/p9c.sh b/bin/p9c.sh
index ecec012..794329f 100644
--- a/bin/p9c.sh
+++ b/bin/p9c.sh
@@ -29,16 +29,12 @@ do
exit 1
fi
- OPTS+=("-o")
- OPTS+=("$OPTARG")
+ OPTS+=("-o" "$OPTARG")
USE_RENAME=false
;;
w)
# Print warning messages about unused variables, etc.
- OPTS+=("-Wall")
- OPTS+=("-Wextra")
- OPTS+=("-Wconversion")
- OPTS+=("-Wformat-security")
+ OPTS+=("-Wall" "-Wextra" "-Wconversion" "-Wformat-security")
;;
B)
# Allow functions without prototypes
@@ -107,8 +103,7 @@ else
case "$objtype" in
amd64 | 386)
# intel asm syntax for intel processors
- OPTS+=("-mllvm")
- OPTS+=("--x86-asm-syntax=intel")
+ OPTS+=("-mllvm" "--x86-asm-syntax=intel")
;;
esac
fi
@@ -144,21 +139,16 @@ then
#fi
# turn on fortify
- OPTS+=("-isystem")
- OPTS+=("${DIR}/../src/fortify-headers/include")
+ OPTS+=("-isystem" "${DIR}/../src/fortify-headers/include")
OPTS+=("-D_FORTIFY_SOURCE=1")
# turn on stack protector
- OPTS+=("-fstack-protector")
- OPTS+=("--param")
- OPTS+=("ssp-buffer-size=4")
+ OPTS+=("-fstack-protector-all")
# use custom libc
OPTS+=("-nostdinc")
- OPTS+=("-isystem")
- OPTS+=("${DIR}/../${objtype}/include")
- OPTS+=("-idirafter")
- OPTS+=("/usr/include")
+ OPTS+=("-isystem" "${DIR}/../${objtype}/include")
+ OPTS+=("-idirafter" "/usr/include")
fi
for f in ${FILES[@]}
@@ -177,15 +167,14 @@ do
if [ $USE_ASM == true ]; then obj="-"; fi
# add output option
- RNOPTS+=("-o")
- RNOPTS+=("${obj}")
+ RNOPTS+=("-o" "${obj}")
fi
clang \
"$TARG" -pipe -std=c11 -g -fPIE -ftls-model=local-exec \
-fdata-sections -ffunction-sections \
-D_POSIX_SOURCE=1 -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE \
- -D_XOPEN_SOURCE -Wdeclaration-after-statement \
+ -D_XOPEN_SOURCE -Werror=declaration-after-statement \
-I"${DIR}/../include" -I. -include "${DIR}/../src/visibility.h" \
"${RNOPTS[@]}" "${OPTS[@]}" "${f}"
if [ $? -ne 0 ]; then exit 1; fi