authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-14 18:18:43-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-14 18:18:43-04:00
log362c79140fc0638b0f85ed9b2a49f3fead14bb9b
tree954dcc2d07212a3f9cdf35930fb5ff9dd0b1402e
parentf8f054b354088eb9e76d9207972022bc1d3dfc28
signaturelock-open Commit is signed but in an unrecognized format.

expose builtin.strip_debug_info

zig code now can be made aware that it will not have any debug information available at runtime.

2 files changed, 3 insertions(+), 0 deletions(-)

src/codegen.cpp+2
......@@ -7948,6 +7948,7 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {
79487948 buf_appendf(contents, "pub const have_error_return_tracing = %s;\n", bool_to_str(g->have_err_ret_tracing));
79497949 buf_appendf(contents, "pub const valgrind_support = %s;\n", bool_to_str(want_valgrind_support(g)));
79507950 buf_appendf(contents, "pub const position_independent_code = %s;\n", bool_to_str(g->have_pic));
7951 buf_appendf(contents, "pub const strip_debug_info = %s;\n", bool_to_str(g->strip_debug_symbols));
79517952
79527953 {
79537954 TargetSubsystem detected_subsystem = detect_subsystem(g);
......@@ -7988,6 +7989,7 @@ static Error define_builtin_compile_vars(CodeGen *g) {
79887989 // Only a few things affect builtin.zig
79897990 cache_buf(&cache_hash, compiler_id);
79907991 cache_int(&cache_hash, g->build_mode);
7992 cache_bool(&cache_hash, g->strip_debug_symbols);
79917993 cache_bool(&cache_hash, g->is_test_build);
79927994 cache_bool(&cache_hash, g->is_single_threaded);
79937995 cache_int(&cache_hash, g->zig_target->is_native);
src/main.cpp+1
......@@ -954,6 +954,7 @@ int main(int argc, char **argv) {
954954 case CmdBuiltin: {
955955 CodeGen *g = codegen_create(main_pkg_path, nullptr, &target,
956956 out_type, build_mode, override_lib_dir, override_std_dir, nullptr, nullptr);
957 codegen_set_strip(g, strip);
957958 g->subsystem = subsystem;
958959 g->valgrind_support = valgrind_support;
959960 g->want_pic = want_pic;