Add CFGuard options to build scripts (disabled by default)

This commit is contained in:
Alvin Wong authored and Martin Storsjö committed 2022-10-01 13:25:52 +03:00
1 parent 0af177bf4f
commit e9401c8bfe
10 files changed
+122 -34

No files matched your search

+19 -2
View File
@@ -16,9 +16,24 @@
set -e
PREFIX="$1"
CFGUARD_CFLAGS=
while [ $# -gt 0 ]; do
case "$1" in
--enable-cfguard)
CFGUARD_CFLAGS="-mguard=cf"
;;
--disable-cfguard)
CFGUARD_CFLAGS=
;;
*)
PREFIX="$1"
;;
esac
shift
done
if [ -z "$PREFIX" ]; then
echo $0 dest
echo "$0 [--enable-cfguard|--disable-cfguard] dest"
exit 1
fi
@@ -84,6 +99,8 @@ for arch in $ARCHS; do
-DCMAKE_AR="$PREFIX/bin/llvm-ar" \
-DCMAKE_RANLIB="$PREFIX/bin/llvm-ranlib" \
-DLIBOMP_ENABLE_SHARED=TRUE \
-DCMAKE_C_FLAGS_INIT="$CFGUARD_CFLAGS" \
-DCMAKE_CXX_FLAGS_INIT="$CFGUARD_CFLAGS" \
$CMAKEFLAGS \
..
$BUILDCMD ${CORES+-j$CORES}