Add GCC address sanitizer build/test.
This commit is contained in:
parent
55c60bdd39
commit
48cc68b691
|
@ -42,7 +42,19 @@ case "$config" in
|
||||||
CFLAGS="-Wall -Wextra -O2 -Wno-error=implicit-fallthrough -Wno-error=unused-parameter"
|
CFLAGS="-Wall -Wextra -O2 -Wno-error=implicit-fallthrough -Wno-error=unused-parameter"
|
||||||
CONFIGFLAGS="--with-pam --with-Werror"
|
CONFIGFLAGS="--with-pam --with-Werror"
|
||||||
;;
|
;;
|
||||||
clang-sanitize-*)
|
*-sanitize-*)
|
||||||
|
case "$config" in
|
||||||
|
gcc-*)
|
||||||
|
CC=gcc
|
||||||
|
;;
|
||||||
|
clang-*)
|
||||||
|
# Find the newest available version of clang
|
||||||
|
for i in `seq 10 99`; do
|
||||||
|
clang="`which clang-$i 2>/dev/null`"
|
||||||
|
[ -x "$clang" ] && CC="$clang"
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
esac
|
||||||
# Put Sanitizer logs in regress dir.
|
# Put Sanitizer logs in regress dir.
|
||||||
SANLOGS=`pwd`/regress
|
SANLOGS=`pwd`/regress
|
||||||
# - We replace chroot with chdir so that the sanitizer in the preauth
|
# - We replace chroot with chdir so that the sanitizer in the preauth
|
||||||
|
@ -52,11 +64,11 @@ case "$config" in
|
||||||
# - openssl and zlib trip ASAN.
|
# - openssl and zlib trip ASAN.
|
||||||
# - sp_pwdp returned by getspnam trips ASAN, hence disabling shadow.
|
# - sp_pwdp returned by getspnam trips ASAN, hence disabling shadow.
|
||||||
case "$config" in
|
case "$config" in
|
||||||
clang-sanitize-address)
|
*-sanitize-address)
|
||||||
CFLAGS="-fsanitize=address -fno-omit-frame-pointer"
|
CFLAGS="-fsanitize=address -fno-omit-frame-pointer"
|
||||||
LDFLAGS="-fsanitize=address"
|
LDFLAGS="-fsanitize=address"
|
||||||
CPPFLAGS='-Dchroot=chdir -Dexplicit_bzero=bzero -DASAN_OPTIONS=\"detect_leaks=0:log_path='$SANLOGS'/asan.log\"'
|
CPPFLAGS='-Dchroot=chdir -Dexplicit_bzero=bzero -D_FORTIFY_SOURCE=0 -DASAN_OPTIONS=\"detect_leaks=0:log_path='$SANLOGS'/asan.log\"'
|
||||||
CONFIGFLAGS="--without-openssl --without-zlib --without-shadow"
|
CONFIGFLAGS=""
|
||||||
TEST_TARGET="t-exec"
|
TEST_TARGET="t-exec"
|
||||||
;;
|
;;
|
||||||
clang-sanitize-memory)
|
clang-sanitize-memory)
|
||||||
|
@ -74,11 +86,6 @@ case "$config" in
|
||||||
echo unknown sanitize option;
|
echo unknown sanitize option;
|
||||||
exit 1;;
|
exit 1;;
|
||||||
esac
|
esac
|
||||||
# Find the newest available version of clang
|
|
||||||
for i in `seq 10 99`; do
|
|
||||||
clang=$(which clang-$i 2>/dev/null)
|
|
||||||
[ -x "$clang" ] && CC="$clang"
|
|
||||||
done
|
|
||||||
features="--disable-security-key --disable-pkcs11"
|
features="--disable-security-key --disable-pkcs11"
|
||||||
hardening="--without-sandbox --without-hardening --without-stackprotect"
|
hardening="--without-sandbox --without-hardening --without-stackprotect"
|
||||||
privsep="--with-privsep-user=root"
|
privsep="--with-privsep-user=root"
|
||||||
|
|
|
@ -40,6 +40,8 @@ for TARGET in $TARGETS; do
|
||||||
clang-sanitize*)
|
clang-sanitize*)
|
||||||
PACKAGES="$PACKAGES clang-12"
|
PACKAGES="$PACKAGES clang-12"
|
||||||
;;
|
;;
|
||||||
|
gcc-sanitize*)
|
||||||
|
;;
|
||||||
clang-*|gcc-*)
|
clang-*|gcc-*)
|
||||||
compiler=$(echo $TARGET | sed 's/-Werror//')
|
compiler=$(echo $TARGET | sed 's/-Werror//')
|
||||||
PACKAGES="$PACKAGES $compiler"
|
PACKAGES="$PACKAGES $compiler"
|
||||||
|
|
Loading…
Reference in New Issue