From 222b3861024fbe1d40e3c97cfa65b5ce3243ba3d Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Wed, 9 Sep 2020 16:05:56 +0200 Subject: [PATCH] rust: rebuilds std when building fuzzers so as to have MSAN working --- configure.ac | 1 + rust/Makefile.am | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index 363fba5181..e9f4f91ad7 100644 --- a/configure.ac +++ b/configure.ac @@ -475,6 +475,7 @@ AC_ARG_ENABLE(fuzztargets, AS_HELP_STRING([--enable-fuzztargets], [Enable fuzz targets]),[enable_fuzztargets=$enableval],[enable_fuzztargets=no]) AM_CONDITIONAL([BUILD_FUZZTARGETS], [test "x$enable_fuzztargets" = "xyes"]) + AM_CONDITIONAL([RUST_BUILD_STD], [test "x$enable_fuzztargets" = "xyes" && echo $rust_compiler_version | grep -q nightly]) AC_PROG_CXX AS_IF([test "x$enable_fuzztargets" = "xyes"], [ AC_DEFINE([FUZZ], [1], [Fuzz targets are enabled]) diff --git a/rust/Makefile.am b/rust/Makefile.am index 843cac5c79..446a898131 100644 --- a/rust/Makefile.am +++ b/rust/Makefile.am @@ -7,9 +7,13 @@ if HAVE_CARGO_VENDOR EXTRA_DIST += vendor endif +if RUST_BUILD_STD +RELEASE = -Z build-std +else if !DEBUG RELEASE = --release endif +endif if HAVE_LUA RUST_FEATURES += lua $(LUA_INT8) -- 2.47.2