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) {...@@ -7948,6 +7948,7 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {
7948 buf_appendf(contents, "pub const have_error_return_tracing = %s;\n", bool_to_str(g->have_err_ret_tracing));7948 buf_appendf(contents, "pub const have_error_return_tracing = %s;\n", bool_to_str(g->have_err_ret_tracing));
7949 buf_appendf(contents, "pub const valgrind_support = %s;\n", bool_to_str(want_valgrind_support(g)));7949 buf_appendf(contents, "pub const valgrind_support = %s;\n", bool_to_str(want_valgrind_support(g)));
7950 buf_appendf(contents, "pub const position_independent_code = %s;\n", bool_to_str(g->have_pic));7950 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
7952 {7953 {
7953 TargetSubsystem detected_subsystem = detect_subsystem(g);7954 TargetSubsystem detected_subsystem = detect_subsystem(g);
...@@ -7988,6 +7989,7 @@ static Error define_builtin_compile_vars(CodeGen *g) {...@@ -7988,6 +7989,7 @@ static Error define_builtin_compile_vars(CodeGen *g) {
7988 // Only a few things affect builtin.zig7989 // Only a few things affect builtin.zig
7989 cache_buf(&cache_hash, compiler_id);7990 cache_buf(&cache_hash, compiler_id);
7990 cache_int(&cache_hash, g->build_mode);7991 cache_int(&cache_hash, g->build_mode);
7992 cache_bool(&cache_hash, g->strip_debug_symbols);
7991 cache_bool(&cache_hash, g->is_test_build);7993 cache_bool(&cache_hash, g->is_test_build);
7992 cache_bool(&cache_hash, g->is_single_threaded);7994 cache_bool(&cache_hash, g->is_single_threaded);
7993 cache_int(&cache_hash, g->zig_target->is_native);7995 cache_int(&cache_hash, g->zig_target->is_native);
src/main.cpp+1
...@@ -954,6 +954,7 @@ int main(int argc, char **argv) {...@@ -954,6 +954,7 @@ int main(int argc, char **argv) {
954 case CmdBuiltin: {954 case CmdBuiltin: {
955 CodeGen *g = codegen_create(main_pkg_path, nullptr, &target,955 CodeGen *g = codegen_create(main_pkg_path, nullptr, &target,
956 out_type, build_mode, override_lib_dir, override_std_dir, nullptr, nullptr);956 out_type, build_mode, override_lib_dir, override_std_dir, nullptr, nullptr);
957 codegen_set_strip(g, strip);
957 g->subsystem = subsystem;958 g->subsystem = subsystem;
958 g->valgrind_support = valgrind_support;959 g->valgrind_support = valgrind_support;
959 g->want_pic = want_pic;960 g->want_pic = want_pic;