if using an existing clang, test if cfguard is available

This commit is contained in:
Norbert Lange authored and Martin Storsjö committed 2024-02-26 00:22:14 +02:00
1 parent 47355937ad
commit a1e0579bad
1 file changed
+4
+4
View File
@@ -95,6 +95,10 @@ for dep in git cmake ${HOST_CLANG}; do
fi
done
if [ -n "${HOST_CLANG}" ] && [ "${CFGUARD_ARGS}" = "--enable-cfguard" ]; then
"${HOST_CLANG}" -c -x c -o - - -Werror -mguard=cf </dev/null >/dev/null 2>/dev/null || CFGUARD_ARGS="--disable-cfguard"
fi
if [ -z "$NO_TOOLS" ]; then
if [ -z "${HOST_CLANG}" ]; then
./build-llvm.sh $PREFIX $LLVM_ARGS $HOST_ARGS