Skip to content

Commit f6bdc69

Browse files
committed
Disable Rust when sanitizers are active for now
In a follow up, we should enable sanitizers using nightly and the unstable sanitizers support, which works with all CPython sanitizers except undefined-behavior sanitizer. Unstable sanitizers support: https://doc.rust-lang.org/beta/unstable-book/compiler-flags/sanitizer.html
1 parent 2f79dde commit f6bdc69

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

configure

Lines changed: 19 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3316,10 +3316,14 @@ AC_ARG_WITH([address_sanitizer],
33163316
AC_MSG_RESULT([$withval])
33173317
BASECFLAGS="-fsanitize=address -fno-omit-frame-pointer $BASECFLAGS"
33183318
LDFLAGS="-fsanitize=address $LDFLAGS"
3319+
with_asan="yes"
33193320
# ASan works by controlling memory allocation, our own malloc interferes.
33203321
with_pymalloc="no"
33213322
],
3322-
[AC_MSG_RESULT([no])])
3323+
[
3324+
AC_MSG_RESULT([no])
3325+
with_asan="no"
3326+
])
33233327

33243328
AC_MSG_CHECKING([for --with-memory-sanitizer])
33253329
AC_ARG_WITH(
@@ -3333,11 +3337,16 @@ AC_MSG_RESULT([$withval])
33333337
AX_CHECK_COMPILE_FLAG([-fsanitize=memory],[
33343338
BASECFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer $BASECFLAGS"
33353339
LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 $LDFLAGS"
3340+
with_msan="yes"
33363341
],[AC_MSG_ERROR([The selected compiler doesn't support memory sanitizer])])
33373342
# MSan works by controlling memory allocation, our own malloc interferes.
33383343
with_pymalloc="no"
3344+
with_msan="no"
33393345
],
3340-
[AC_MSG_RESULT([no])])
3346+
[
3347+
AC_MSG_RESULT([no])
3348+
with_msan="no"
3349+
])
33413350

33423351
AC_MSG_CHECKING([for --with-undefined-behavior-sanitizer])
33433352
AC_ARG_WITH(
@@ -4355,6 +4364,13 @@ AC_SUBST([CARGO_TARGET_DIR])
43554364
AC_SUBST([CARGO_PROFILE])
43564365
AC_SUBST([CARGO_TARGET])
43574366

4367+
dnl do not enable Rust code if sanitizers are enabled
4368+
dnl this should be fixed in the future to use unstable sanitizer support
4369+
if test "$with_asan" == "yes" || "$with_msan" == "yes" || "$with_ubsan" == "yes" || "$with_tsan" == "yes";
4370+
then
4371+
HAVE_CARGO="no"
4372+
fi
4373+
43584374

43594375
dnl detect sqlite3 from Emscripten emport
43604376
PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3])

0 commit comments

Comments
 (0)