Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ziglang/zig
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0206b76351a5
Choose a base ref
...
head repository: ziglang/zig
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2759c7951da0
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jul 2, 2018

  1. always link against compiler_rt.o even when linking libc

    sometimes libgcc is missing things we need, so we always link
    compiler_rt and rely on weak linkage to allow libgcc to override.
    andrewrk committed Jul 2, 2018
    Copy the full SHA
    2759c79 View commit details
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/link.cpp
11 changes: 7 additions & 4 deletions src/link.cpp
Original file line number Diff line number Diff line change
@@ -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));
}