From db74832e40f98960e5dc3e46c8196c59033ee0f9 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 19 Feb 2019 12:07:56 -0500 Subject: valgrind client requests for undefined values with this change, when you assign undefined, zig emits a few assembly instructions to tell valgrind that the memory is undefined it's on by default for debug builds, and disabled otherwise. only support for linux, darwin, solaris, mingw on x86_64 is currently implemented. --disable-valgrind turns it off even in debug mode. --enable-valgrind turns it on even in release modes. It's always disabled for compiler_rt.a and builtin.a. Adds `@import("builtin").valgrind_support` which lets code know at comptime whether valgrind client requests are enabled. See #1989 --- src/link.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/link.cpp') diff --git a/src/link.cpp b/src/link.cpp index a3a68e24d4..2878a00358 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -55,6 +55,7 @@ static Buf *build_a_raw(CodeGen *parent_gen, const char *aname, Buf *full_path) codegen_set_strip(child_gen, parent_gen->strip_debug_symbols); codegen_set_is_static(child_gen, true); child_gen->disable_pic = parent_gen->disable_pic; + child_gen->valgrind_support = ValgrindSupportDisabled; codegen_set_out_name(child_gen, buf_create_from_str(aname)); -- cgit v1.2.3