diff --git a/mk/platform.mk b/mk/platform.mk index 28ecb0a10e9..430a835ba86 100644 --- a/mk/platform.mk +++ b/mk/platform.mk @@ -17,8 +17,8 @@ CFG_GCCISH_LINK_FLAGS := # embedded into the executable, so use a no-op command. CFG_DSYMUTIL := true -ifneq ($(CFG_VALGRIND),) - CFG_GCCISH_CFLAGS += -DHAVE_VALGRIND +ifeq ($(CFG_VALGRIND),) + CFG_GCCISH_CFLAGS += -DNVALGRIND endif ifneq ($(findstring freebsd,$(CFG_OSTYPE)),) diff --git a/mk/rt.mk b/mk/rt.mk index e45430f7690..0d9bb5c3408 100644 --- a/mk/rt.mk +++ b/mk/rt.mk @@ -125,7 +125,7 @@ else endif RUNTIME_DEF_$(1) := rt/rustrt$$(CFG_DEF_SUFFIX) -RUNTIME_INCS_$(1) := -I $$(S)src/rt/isaac -I $$(S)src/rt/uthash \ +RUNTIME_INCS_$(1) := -I $$(S)src/rt -I $$(S)src/rt/isaac -I $$(S)src/rt/uthash \ -I $$(S)src/rt/arch/$$(HOST_$(1)) \ -I $$(S)src/libuv/include RUNTIME_OBJS_$(1) := $$(RUNTIME_CS_$(1):rt/%.cpp=rt/$(1)/%.o) \ diff --git a/src/rt/arch/i386/context.h b/src/rt/arch/i386/context.h index fc5eb900a5c..03b97fa7b51 100644 --- a/src/rt/arch/i386/context.h +++ b/src/rt/arch/i386/context.h @@ -7,7 +7,7 @@ #include #include -#include "../../memcheck.h" +#include "vg/memcheck.h" template T align_down(T sp) @@ -51,9 +51,7 @@ public: uint32_t bot = regs.esp; uint32_t top = align_down(bot - nbytes); -#ifdef HAVE_VALGRIND (void)VALGRIND_MAKE_MEM_UNDEFINED(top - 4, bot - top + 4); -#endif return reinterpret_cast(top); } diff --git a/src/rt/arch/x86_64/context.h b/src/rt/arch/x86_64/context.h index 11c85092747..59d7bfa51f3 100644 --- a/src/rt/arch/x86_64/context.h +++ b/src/rt/arch/x86_64/context.h @@ -8,9 +8,7 @@ #include #include -#ifdef HAVE_VALGRIND -#include -#endif +#include "vg/memcheck.h" template T align_down(T sp) @@ -51,9 +49,7 @@ public: uint64_t bot = regs.data[RUSTRT_RSP]; uint64_t top = align_down(bot - nbytes); -#ifdef HAVE_VALGRIND (void)VALGRIND_MAKE_MEM_UNDEFINED(top - 4, bot - top + 4); -#endif return reinterpret_cast(top); } diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index a34ec4d8661..b540225243f 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -2,8 +2,8 @@ #include "rust_internal.h" #include "rust_cc.h" -#include "valgrind.h" -#include "memcheck.h" +#include "vg/valgrind.h" +#include "vg/memcheck.h" #ifndef __WIN32__ #include diff --git a/src/rt/rust_timer.cpp b/src/rt/rust_timer.cpp index eb1f30b93ee..ffa98766763 100644 --- a/src/rt/rust_timer.cpp +++ b/src/rt/rust_timer.cpp @@ -1,5 +1,5 @@ #include "rust_internal.h" -#include "valgrind.h" +#include "vg/valgrind.h" // The mechanism in this file is very crude; every domain (thread) spawns its // own secondary timer thread, and that timer thread *never idles*. It diff --git a/src/rt/memcheck.h b/src/rt/vg/memcheck.h similarity index 100% rename from src/rt/memcheck.h rename to src/rt/vg/memcheck.h diff --git a/src/rt/valgrind.h b/src/rt/vg/valgrind.h similarity index 100% rename from src/rt/valgrind.h rename to src/rt/vg/valgrind.h