authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-03-07 12:21:27-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-03-07 12:21:27-05:00
logffaa4f0a87af60718062c3a9eeab9fb354731241
treefe5034c95f92ff00e9d72d74a3d60751b0e1389d
parentce76de35f1671bf7b75e98d6d61378edef382d60
signature Commit is signed but in an unrecognized format.

dynamic_linker_path can be null on some targets


1 files changed, 5 insertions(+), 3 deletions(-)

src/codegen.cpp+5-3
......@@ -7906,6 +7906,9 @@ static void init(CodeGen *g) {
79067906static void detect_dynamic_linker(CodeGen *g) {
79077907 if (g->dynamic_linker_path != nullptr)
79087908 return;
7909 const char *standard_ld_path = target_dynamic_linker(g->zig_target);
7910 if (standard_ld_path == nullptr)
7911 return;
79097912
79107913 if (g->zig_target->is_native) {
79117914 // target_dynamic_linker is usually correct. However on some systems, such as NixOS
......@@ -7944,8 +7947,7 @@ static void detect_dynamic_linker(CodeGen *g) {
79447947#endif
79457948 }
79467949
7947 // Otherwise go with the standard linker path.
7948 g->dynamic_linker_path = buf_create_from_str(target_dynamic_linker(g->zig_target));
7950 g->dynamic_linker_path = buf_create_from_str(standard_ld_path);
79497951}
79507952
79517953static void detect_libc(CodeGen *g) {
......@@ -9091,7 +9093,7 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest, bool *c_obj
90919093 cache_buf(ch, &g->libc->msvc_lib_dir);
90929094 cache_buf(ch, &g->libc->kernel32_lib_dir);
90939095 }
9094 cache_buf(ch, g->dynamic_linker_path);
9096 cache_buf_opt(ch, g->dynamic_linker_path);
90959097
90969098 *c_objects_generated = gen_c_objects(g);
90979099