aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-10-01 21:19:06 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-10-01 21:19:58 -0400
commite3ea0b652c7bec25d7303d98e08cdfe1d288a9ec (patch)
tree93706a404bd91e54685af663bf32170f90807766
parent756d5c545d4f05ce770511a024e9fefe258591f4 (diff)
downloadzig-e3ea0b652c7bec25d7303d98e08cdfe1d288a9ec.tar.gz
zig-e3ea0b652c7bec25d7303d98e08cdfe1d288a9ec.zip
still build compiler-rt when linking msvc CRT
because it's missing some things
-rw-r--r--src/link.cpp9
-rw-r--r--std/special/compiler_rt/comparetf2.zig1
2 files changed, 7 insertions, 3 deletions
diff --git a/src/link.cpp b/src/link.cpp
index 7cba3287cb..f69b2fb698 100644
--- a/src/link.cpp
+++ b/src/link.cpp
@@ -435,10 +435,13 @@ static void construct_linker_job_coff(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));
+ }
+ // msvc compiler_rt is missing some stuff, so we still build it and rely on LinkOnce
Buf *compiler_rt_o_path = build_compiler_rt(g);
lj->args.append(buf_ptr(compiler_rt_o_path));
}
diff --git a/std/special/compiler_rt/comparetf2.zig b/std/special/compiler_rt/comparetf2.zig
index d7c33c6b9f..b64403158c 100644
--- a/std/special/compiler_rt/comparetf2.zig
+++ b/std/special/compiler_rt/comparetf2.zig
@@ -117,6 +117,7 @@ export fn __unordtf2(a: f128, b: f128) -> c_int {
}
// The following are alternative names for the preceding routines.
+// TODO use aliases https://github.com/zig-lang/zig/issues/462
export fn __eqtf2(a: f128, b: f128) -> c_int {
@setGlobalLinkage(__eqtf2, builtin.GlobalLinkage.LinkOnce);