mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
fixes for zig tests Windows
This commit is contained in:
parent
2f511779a6
commit
2e0c83ae63
4 changed files with 21 additions and 16 deletions
|
@ -17,18 +17,9 @@ const v2u64 = @Vector(2, u64);
|
||||||
|
|
||||||
// Export it as weak incase it is already linked in by something else.
|
// Export it as weak incase it is already linked in by something else.
|
||||||
comptime {
|
comptime {
|
||||||
@export(__muloti4, .{ .name = "__muloti4", .linkage = .Weak });
|
if (!want_windows_v2u64_abi) {
|
||||||
@export(__lshrti3, .{ .name = "__lshrti3", .linkage = .Weak });
|
@export(__muloti4, .{ .name = "__muloti4", .linkage = .Weak });
|
||||||
if (want_windows_v2u64_abi) {
|
@export(__lshrti3, .{ .name = "__lshrti3", .linkage = .Weak });
|
||||||
@export(__divti3_windows_x86_64, .{ .name = "__divti3", .linkage = .Weak });
|
|
||||||
@export(__modti3_windows_x86_64, .{ .name = "__modti3", .linkage = .Weak });
|
|
||||||
@export(__umodti3_windows_x86_64, .{ .name = "__umodti3", .linkage = .Weak });
|
|
||||||
@export(__udivti3_windows_x86_64, .{ .name = "__udivti3", .linkage = .Weak });
|
|
||||||
@export(__fixdfti_windows_x86_64, .{ .name = "__fixdfti", .linkage = .Weak });
|
|
||||||
@export(__fixsfti_windows_x86_64, .{ .name = "__fixsfti", .linkage = .Weak });
|
|
||||||
@export(__fixunsdfti_windows_x86_64, .{ .name = "__fixunsdfti", .linkage = .Weak });
|
|
||||||
@export(__fixunssfti_windows_x86_64, .{ .name = "__fixunssfti", .linkage = .Weak });
|
|
||||||
} else {
|
|
||||||
@export(__divti3, .{ .name = "__divti3", .linkage = .Weak });
|
@export(__divti3, .{ .name = "__divti3", .linkage = .Weak });
|
||||||
@export(__modti3, .{ .name = "__modti3", .linkage = .Weak });
|
@export(__modti3, .{ .name = "__modti3", .linkage = .Weak });
|
||||||
@export(__umodti3, .{ .name = "__umodti3", .linkage = .Weak });
|
@export(__umodti3, .{ .name = "__umodti3", .linkage = .Weak });
|
||||||
|
|
|
@ -9,7 +9,10 @@ comptime {
|
||||||
// TODO: remove this workaround.
|
// TODO: remove this workaround.
|
||||||
// Our wasm llvm pipeline always links in memcpy.
|
// Our wasm llvm pipeline always links in memcpy.
|
||||||
// As such, our impl will conflict.
|
// As such, our impl will conflict.
|
||||||
if (arch != .wasm32) {
|
if (builtin.is_test and builtin.os.tag == .windows) {
|
||||||
|
// We don't need memcpy on Windows for tests because the tests are built with -lc
|
||||||
|
// lld-link: error: duplicate symbol: memcpy
|
||||||
|
} else if (arch != .wasm32) {
|
||||||
@export(memcpy, .{ .name = "memcpy", .linkage = .Strong });
|
@export(memcpy, .{ .name = "memcpy", .linkage = .Strong });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,10 @@ comptime {
|
||||||
@export(testing_roc_mmap, .{ .name = "roc_mmap", .linkage = .Strong });
|
@export(testing_roc_mmap, .{ .name = "roc_mmap", .linkage = .Strong });
|
||||||
@export(testing_roc_shm_open, .{ .name = "roc_shm_open", .linkage = .Strong });
|
@export(testing_roc_shm_open, .{ .name = "roc_shm_open", .linkage = .Strong });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (builtin.os.tag == .windows) {
|
||||||
|
@export(roc_getppid_windows_stub, .{ .name = "roc_getppid", .linkage = .Strong });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -160,9 +160,16 @@ pub fn add_default_roc_externs(env: &Env<'_, '_, '_>) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unreachable_function(env, "roc_getppid");
|
match env.target_info.operating_system {
|
||||||
unreachable_function(env, "roc_mmap");
|
roc_target::OperatingSystem::Windows => {
|
||||||
unreachable_function(env, "roc_shm_open");
|
// We don't need these functions on Windows
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
unreachable_function(env, "roc_getppid");
|
||||||
|
unreachable_function(env, "roc_mmap");
|
||||||
|
unreachable_function(env, "roc_shm_open");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
add_sjlj_roc_panic(env)
|
add_sjlj_roc_panic(env)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue