From c91929090db337810aa3b55f9bd26f5fd0af4fff Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Mon, 3 Apr 2023 14:17:00 -0400 Subject: [PATCH] start: disable extra start logic on various x86_64 subtargets --- lib/std/start.zig | 1 + test/cases/aarch64-macos/hello_world_with_updates.0.zig | 2 +- test/cases/x86_64-linux/hello_world_with_updates.0.zig | 5 ++++- test/cases/x86_64-macos/hello_world_with_updates.0.zig | 2 +- test/cases/x86_64-windows/hello_world_with_updates.0.zig | 4 +++- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/std/start.zig b/lib/std/start.zig index e79dd1b9a72e3ddc675c135a712d0111179c5d8e..1b686e43f5cea25335f44a4427f4f2c9c946f050 100644 --- a/lib/std/start.zig +++ b/lib/std/start.zig @@ -19,6 +19,7 @@ const start_sym_name = if (native_arch.isMIPS()) "__start" else "_start"; // self-hosted is capable enough to handle all of the real start.zig logic. pub const simplified_logic = builtin.zig_backend == .stage2_wasm or + (builtin.zig_backend == .stage2_x86_64 and (builtin.link_libc or builtin.os.tag == .plan9)) or builtin.zig_backend == .stage2_x86 or builtin.zig_backend == .stage2_aarch64 or builtin.zig_backend == .stage2_arm or diff --git a/test/cases/aarch64-macos/hello_world_with_updates.0.zig b/test/cases/aarch64-macos/hello_world_with_updates.0.zig index 9f516ff1390f02aafc6203c8625793f8e58acdaf..90aa14ab65a5217950729681a26d1c75fdabd722 100644 --- a/test/cases/aarch64-macos/hello_world_with_updates.0.zig +++ b/test/cases/aarch64-macos/hello_world_with_updates.0.zig @@ -2,4 +2,4 @@ // output_mode=Exe // target=aarch64-macos // -// :109:9: error: root struct of file 'tmp' has no member named 'main' +// :110:9: error: root struct of file 'tmp' has no member named 'main' diff --git a/test/cases/x86_64-linux/hello_world_with_updates.0.zig b/test/cases/x86_64-linux/hello_world_with_updates.0.zig index 40abdd6c1fa4217b99f077793ecbb56bfa3f89a0..e498eacf930d597202dff035dd1a902309686de4 100644 --- a/test/cases/x86_64-linux/hello_world_with_updates.0.zig +++ b/test/cases/x86_64-linux/hello_world_with_updates.0.zig @@ -2,4 +2,7 @@ // output_mode=Exe // target=x86_64-linux // -// :109:9: error: root struct of file 'tmp' has no member named 'main' +// :604:45: error: root struct of file 'tmp' has no member named 'main' +// :553:12: note: called from here +// :503:36: note: called from here +// :466:17: note: called from here diff --git a/test/cases/x86_64-macos/hello_world_with_updates.0.zig b/test/cases/x86_64-macos/hello_world_with_updates.0.zig index e0680c81d7420441fabd29498bf9258a5c16f291..d91bd9dc9191538f63a619b9771d8b576cfbbe6d 100644 --- a/test/cases/x86_64-macos/hello_world_with_updates.0.zig +++ b/test/cases/x86_64-macos/hello_world_with_updates.0.zig @@ -2,4 +2,4 @@ // output_mode=Exe // target=x86_64-macos // -// :109:9: error: root struct of file 'tmp' has no member named 'main' +// :110:9: error: root struct of file 'tmp' has no member named 'main' diff --git a/test/cases/x86_64-windows/hello_world_with_updates.0.zig b/test/cases/x86_64-windows/hello_world_with_updates.0.zig index 04e1d4cfad0ac9045fb033b9f550e2d5fb1e64c8..320057b86eaa9afac94bf38bafd37e63b02b266f 100644 --- a/test/cases/x86_64-windows/hello_world_with_updates.0.zig +++ b/test/cases/x86_64-windows/hello_world_with_updates.0.zig @@ -2,4 +2,6 @@ // output_mode=Exe // target=x86_64-windows // -// :130:9: error: root struct of file 'tmp' has no member named 'main' +// :604:45: error: root struct of file 'tmp' has no member named 'main' +// :553:12: note: called from here +// :389:65: note: called from here -- 2.54.0