-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler and build system panic on invalid macos target #18018
Comments
I have tried to disable all macho link tests and successfully built zig stage3. The patch I use is: patch
Now I got a lot of test failures. I am not sure if I should change the default code model in zig code (or whether it has anything to do with these failures). Hope it helps in any way. trace
|
Skip macho link tests because they don't build on riscv64. `nocheck` is still required and test failures have been reported to ziglang/zig#18018
Skip macho link tests because they don't build on riscv64. `nocheck` is still required and test failures have been reported to ziglang/zig#18018
I went on and gave a try to build ncdu with the resulting stage3 zig. It seems more problems ahead:
|
The first issue seems to be #3340 and could be worked around by removing the The second issue seems to require adding ucontect_t and relevant structs to std/os/linux/riscv64.zig |
@felixonmars The cfi_label fix should come in #18803. On the otherhand, I was shared this patch which would fix this particular issue. I don't see a PR for this fix so one should probably be open. --- a/test/link/macho.zig
+++ b/test/link/macho.zig
@@ -3,9 +3,6 @@
pub fn testAll(b: *Build, build_opts: BuildOptions) *Step {
const macho_step = b.step("test-macho", "Run MachO tests");
- const default_target = b.resolveTargetQuery(.{
- .os_tag = .macos,
- });
const x86_64_target = b.resolveTargetQuery(.{
.cpu_arch = .x86_64,
.os_tag = .macos,
@@ -14,6 +11,12 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step {
.cpu_arch = .aarch64,
.os_tag = .macos,
});
+ const default_target = switch (builtin.cpu.arch) {
+ .x86_64, .aarch64 => b.resolveTargetQuery(.{
+ .os_tag = .macos,
+ }),
+ else => aarch64_target,
+ };
// Exercise linker with self-hosted backend (no LLVM)
macho_step.dependOn(testHelloZig(b, .{ .use_llvm = false, .target = x86_64_target })); |
The compiler and build system should issue a proper error for this rather than panicking. |
@Vexu yeah, though the problem comes from https://github.com/ziglang/zig/blob/master/lib/std/Target.zig#L299. How would std be updated to prevent an unreachable inside the builder like this? |
|
|
The text was updated successfully, but these errors were encountered: