diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-07-02 20:00:13 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-07-02 20:00:13 -0400 |
| commit | 6e1425e3123855422068738f0911d5cac9bb0aef (patch) | |
| tree | fe9e93e40d174bafeb20b74e7da8ed79c562ac19 /src/link.cpp | |
| parent | dd627372660209cc5a8ab294d5811b97cd1f56f5 (diff) | |
| parent | 06e8c2e5194439ce5b66f18fcf60108604449957 (diff) | |
| download | zig-6e1425e3123855422068738f0911d5cac9bb0aef.tar.gz zig-6e1425e3123855422068738f0911d5cac9bb0aef.zip | |
Merge remote-tracking branch 'origin/master' into llvm7
Diffstat (limited to 'src/link.cpp')
| -rw-r--r-- | src/link.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/link.cpp b/src/link.cpp index a4631b1daf..2d9a79585f 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -325,10 +325,13 @@ static void construct_linker_job_elf(LinkJob *lj) { lj->args.append((const char *)buf_ptr(g->link_objects.at(i))); } - if (g->libc_link_lib == nullptr && (g->out_type == OutTypeExe || g->out_type == OutTypeLib)) { - Buf *builtin_o_path = build_o(g, "builtin"); - lj->args.append(buf_ptr(builtin_o_path)); + if (g->out_type == OutTypeExe || g->out_type == OutTypeLib) { + if (g->libc_link_lib == nullptr) { + Buf *builtin_o_path = build_o(g, "builtin"); + lj->args.append(buf_ptr(builtin_o_path)); + } + // sometimes libgcc is missing stuff, so we still build compiler_rt and rely on weak linkage Buf *compiler_rt_o_path = build_compiler_rt(g); lj->args.append(buf_ptr(compiler_rt_o_path)); } @@ -554,7 +557,7 @@ static void construct_linker_job_coff(LinkJob *lj) { lj->args.append(buf_ptr(builtin_o_path)); } - // msvc compiler_rt is missing some stuff, so we still build it and rely on LinkOnce + // msvc compiler_rt is missing some stuff, so we still build it and rely on weak linkage Buf *compiler_rt_o_path = build_compiler_rt(g); lj->args.append(buf_ptr(compiler_rt_o_path)); } |
