diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-03-20 14:39:05 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-03-20 14:39:05 -0400 |
| commit | 7438d0fc31f70b3a6d19e1da9a4e3f7918fc9d66 (patch) | |
| tree | 45c97bea61dd454347202e7371fa1d42d4b60938 /src/link.cpp | |
| parent | ef69e4efa07af12172e6dfd7aa62961f1a5491f9 (diff) | |
| download | zig-7438d0fc31f70b3a6d19e1da9a4e3f7918fc9d66.tar.gz zig-7438d0fc31f70b3a6d19e1da9a4e3f7918fc9d66.zip | |
glibc: include ld symbols and proper soname for ld
Diffstat (limited to 'src/link.cpp')
| -rw-r--r-- | src/link.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/link.cpp b/src/link.cpp index 3f7772bb08..0ae47c8432 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -1651,7 +1651,6 @@ static void construct_linker_job_elf(LinkJob *lj) { bool is_lib = g->out_type == OutTypeLib; bool is_dyn_lib = g->is_dynamic && is_lib; - Buf *soname = nullptr; if (!g->have_dynamic_link) { if (g->zig_target->arch == ZigLLVM_arm || g->zig_target->arch == ZigLLVM_armeb || g->zig_target->arch == ZigLLVM_thumb || g->zig_target->arch == ZigLLVM_thumbeb) @@ -1662,15 +1661,13 @@ static void construct_linker_job_elf(LinkJob *lj) { } } else if (is_dyn_lib) { lj->args.append("-shared"); - - assert(buf_len(&g->bin_file_output_path) != 0); - soname = buf_sprintf("lib%s.so.%" ZIG_PRI_usize, buf_ptr(g->root_out_name), g->version_major); } if (target_requires_pie(g->zig_target) && g->out_type == OutTypeExe) { lj->args.append("-pie"); } + assert(buf_len(&g->bin_file_output_path) != 0); lj->args.append("-o"); lj->args.append(buf_ptr(&g->bin_file_output_path)); @@ -1740,6 +1737,9 @@ static void construct_linker_job_elf(LinkJob *lj) { } if (is_dyn_lib) { + Buf *soname = (g->override_soname == nullptr) ? + buf_sprintf("lib%s.so.%" ZIG_PRI_usize, buf_ptr(g->root_out_name), g->version_major) : + g->override_soname; lj->args.append("-soname"); lj->args.append(buf_ptr(soname)); |
