aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorLibravatar Reiner Herrmann <reiner@reiner-h.de>2021-10-13 21:27:59 +0000
committerLibravatar GitHub <noreply@github.com>2021-10-13 23:27:59 +0200
commit2164412bb54087b1c540893acf5384ef9bf03f1d (patch)
treee56e687b9e9f782e9f2e1bb69bb77494c9e79d9a /configure
parentcleanup: move overlayfs code in separate module (diff)
downloadfirejail-2164412bb54087b1c540893acf5384ef9bf03f1d.tar.gz
firejail-2164412bb54087b1c540893acf5384ef9bf03f1d.tar.zst
firejail-2164412bb54087b1c540893acf5384ef9bf03f1d.zip
build: allow building with sanitizer (#4594)
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure54
1 files changed, 54 insertions, 0 deletions
diff --git a/configure b/configure
index 33a4ca9fb..557f5beb2 100755
--- a/configure
+++ b/configure
@@ -711,6 +711,7 @@ ac_subst_files=''
711ac_user_opts=' 711ac_user_opts='
712enable_option_checking 712enable_option_checking
713enable_analyzer 713enable_analyzer
714enable_sanitizer
714enable_apparmor 715enable_apparmor
715enable_selinux 716enable_selinux
716enable_dbusproxy 717enable_dbusproxy
@@ -1368,6 +1369,8 @@ Optional Features:
1368 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) 1369 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
1369 --enable-FEATURE[=ARG] include FEATURE [ARG=yes] 1370 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1370 --enable-analyzer enable GCC static analyzer 1371 --enable-analyzer enable GCC static analyzer
1372 --enable-sanitizer=[address | memory | undefined]
1373 enable a compiler-based sanitizer (debug)
1371 --enable-apparmor enable apparmor 1374 --enable-apparmor enable apparmor
1372 --enable-selinux SELinux labeling support 1375 --enable-selinux SELinux labeling support
1373 --disable-dbusproxy disable dbus proxy 1376 --disable-dbusproxy disable dbus proxy
@@ -3294,6 +3297,57 @@ if test "x$enable_analyzer" = "xyes"; then :
3294 3297
3295fi 3298fi
3296 3299
3300# Check whether --enable-sanitizer was given.
3301if test "${enable_sanitizer+set}" = set; then :
3302 enableval=$enable_sanitizer;
3303else
3304 enable_sanitizer=no
3305fi
3306
3307if test "x$enable_sanitizer" != "xno" ; then :
3308 as_CACHEVAR=`$as_echo "ax_cv_check_cflags__-fsanitize=$enable_sanitizer" | $as_tr_sh`
3309{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fsanitize=$enable_sanitizer" >&5
3310$as_echo_n "checking whether C compiler accepts -fsanitize=$enable_sanitizer... " >&6; }
3311if eval \${$as_CACHEVAR+:} false; then :
3312 $as_echo_n "(cached) " >&6
3313else
3314
3315 ax_check_save_flags=$CFLAGS
3316 CFLAGS="$CFLAGS -fsanitize=$enable_sanitizer"
3317 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3318/* end confdefs.h. */
3319
3320int
3321main ()
3322{
3323
3324 ;
3325 return 0;
3326}
3327_ACEOF
3328if ac_fn_c_try_compile "$LINENO"; then :
3329 eval "$as_CACHEVAR=yes"
3330else
3331 eval "$as_CACHEVAR=no"
3332fi
3333rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3334 CFLAGS=$ax_check_save_flags
3335fi
3336eval ac_res=\$$as_CACHEVAR
3337 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3338$as_echo "$ac_res" >&6; }
3339if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
3340
3341 EXTRA_CFLAGS="$EXTRA_CFLAGS -fsanitize=$enable_sanitizer -fno-omit-frame-pointer"
3342 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -fsanitize=$enable_sanitizer"
3343
3344else
3345 as_fn_error $? "sanitizer not supported: $enable_sanitizer" "$LINENO" 5
3346
3347fi
3348
3349fi
3350
3297HAVE_APPARMOR="" 3351HAVE_APPARMOR=""
3298# Check whether --enable-apparmor was given. 3352# Check whether --enable-apparmor was given.
3299if test "${enable_apparmor+set}" = set; then : 3353if test "${enable_apparmor+set}" = set; then :