authorgravatar for luuk@degram.devLuuk de Gram <luuk@degram.dev> 2023-11-02 19:06:19+01:00
committergravatar for luuk@degram.devLuuk de Gram <luuk@degram.dev> 2023-11-03 12:48:53+01:00
logc893f837151d4764fd34911376836a01192b4d75
tree5b27b35ef9c77e343a39ab1bdc1f24270e56bec2
parent5b2ee5eacc177873ce674a307a1bebdfffeeae10
signaturelock-open Commit is signed but in an unrecognized format.

cli: consolidate entry point flags


21 files changed, 86 insertions(+), 70 deletions(-)

lib/std/Build/Step/Compile.zig+21-11
...@@ -64,8 +64,6 @@ initial_memory: ?u64 = null,...@@ -64,8 +64,6 @@ initial_memory: ?u64 = null,
64max_memory: ?u64 = null,64max_memory: ?u64 = null,
65shared_memory: bool = false,65shared_memory: bool = false,
66global_base: ?u64 = null,66global_base: ?u64 = null,
67/// For WebAssembly only. Tells the linker to not output an entry point.
68no_entry: ?bool = null,
69c_std: std.Build.CStd,67c_std: std.Build.CStd,
70/// Set via options; intended to be read-only after that.68/// Set via options; intended to be read-only after that.
71zig_lib_dir: ?LazyPath,69zig_lib_dir: ?LazyPath,
...@@ -191,7 +189,8 @@ dll_export_fns: ?bool = null,...@@ -191,7 +189,8 @@ dll_export_fns: ?bool = null,
191189
192subsystem: ?std.Target.SubSystem = null,190subsystem: ?std.Target.SubSystem = null,
193191
194entry_symbol_name: ?[]const u8 = null,192/// How the linker must handle the entry point of the executable.
193entry: Entry = .default,
195194
196/// List of symbols forced as undefined in the symbol table195/// List of symbols forced as undefined in the symbol table
197/// thus forcing their resolution by the linker.196/// thus forcing their resolution by the linker.
...@@ -306,6 +305,18 @@ const FrameworkLinkInfo = struct {...@@ -306,6 +305,18 @@ const FrameworkLinkInfo = struct {
306 weak: bool = false,305 weak: bool = false,
307};306};
308307
308const Entry = union(enum) {
309 /// Let the compiler decide whether to make an entry point and what to name
310 /// it.
311 default,
312 /// The executable will have no entry point.
313 disabled,
314 /// The executable will have an entry point with the default symbol name.
315 enabled,
316 /// The executable will have an entry point with the specified symbol name.
317 symbol_name: []const u8,
318};
319
309pub const IncludeDir = union(enum) {320pub const IncludeDir = union(enum) {
310 path: LazyPath,321 path: LazyPath,
311 path_system: LazyPath,322 path_system: LazyPath,
...@@ -1420,9 +1431,13 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {...@@ -1420,9 +1431,13 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
1420 try zig_args.append(try std.fmt.allocPrint(b.allocator, "-ofmt={s}", .{@tagName(ofmt)}));1431 try zig_args.append(try std.fmt.allocPrint(b.allocator, "-ofmt={s}", .{@tagName(ofmt)}));
1421 }1432 }
14221433
1423 if (self.entry_symbol_name) |entry| {1434 switch (self.entry) {
1424 try zig_args.append("--entry");1435 .default => {},
1425 try zig_args.append(entry);1436 .disabled => try zig_args.append("-fno-entry"),
1437 .enabled => try zig_args.append("-fentry"),
1438 .symbol_name => |entry_name| {
1439 try zig_args.append(try std.fmt.allocPrint(b.allocator, "-fentry={s}", .{entry_name}));
1440 },
1426 }1441 }
14271442
1428 {1443 {
...@@ -1853,11 +1868,6 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {...@@ -1853,11 +1868,6 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
1853 if (self.global_base) |global_base| {1868 if (self.global_base) |global_base| {
1854 try zig_args.append(b.fmt("--global-base={d}", .{global_base}));1869 try zig_args.append(b.fmt("--global-base={d}", .{global_base}));
1855 }1870 }
1856 // invert the value due to naming so when `no_entry` is set to 'true'
1857 // we actually emit the flag `-fno_entry`.
1858 if (self.no_entry) |no_entry| {
1859 try addFlag(&zig_args, "entry", !no_entry);
1860 }
18611871
1862 if (self.code_model != .default) {1872 if (self.code_model != .default) {
1863 try zig_args.append("-mcmodel");1873 try zig_args.append("-mcmodel");
src/Compilation.zig-3
...@@ -643,7 +643,6 @@ pub const InitOptions = struct {...@@ -643,7 +643,6 @@ pub const InitOptions = struct {
643 linker_import_symbols: bool = false,643 linker_import_symbols: bool = false,
644 linker_import_table: bool = false,644 linker_import_table: bool = false,
645 linker_export_table: bool = false,645 linker_export_table: bool = false,
646 linker_no_entry: bool = false,
647 linker_initial_memory: ?u64 = null,646 linker_initial_memory: ?u64 = null,
648 linker_max_memory: ?u64 = null,647 linker_max_memory: ?u64 = null,
649 linker_shared_memory: bool = false,648 linker_shared_memory: bool = false,
...@@ -1615,7 +1614,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {...@@ -1615,7 +1614,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
1615 .import_symbols = options.linker_import_symbols,1614 .import_symbols = options.linker_import_symbols,
1616 .import_table = options.linker_import_table,1615 .import_table = options.linker_import_table,
1617 .export_table = options.linker_export_table,1616 .export_table = options.linker_export_table,
1618 .no_entry = options.linker_no_entry,
1619 .initial_memory = options.linker_initial_memory,1617 .initial_memory = options.linker_initial_memory,
1620 .max_memory = options.linker_max_memory,1618 .max_memory = options.linker_max_memory,
1621 .shared_memory = options.linker_shared_memory,1619 .shared_memory = options.linker_shared_memory,
...@@ -2579,7 +2577,6 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes...@@ -2579,7 +2577,6 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes
2579 man.hash.addOptional(comp.bin_file.options.max_memory);2577 man.hash.addOptional(comp.bin_file.options.max_memory);
2580 man.hash.add(comp.bin_file.options.shared_memory);2578 man.hash.add(comp.bin_file.options.shared_memory);
2581 man.hash.addOptional(comp.bin_file.options.global_base);2579 man.hash.addOptional(comp.bin_file.options.global_base);
2582 man.hash.add(comp.bin_file.options.no_entry);
25832580
2584 // Mach-O specific stuff2581 // Mach-O specific stuff
2585 man.hash.addListOfBytes(comp.bin_file.options.framework_dirs);2582 man.hash.addListOfBytes(comp.bin_file.options.framework_dirs);
src/link.zig-1
...@@ -166,7 +166,6 @@ pub const Options = struct {...@@ -166,7 +166,6 @@ pub const Options = struct {
166 export_table: bool,166 export_table: bool,
167 initial_memory: ?u64,167 initial_memory: ?u64,
168 max_memory: ?u64,168 max_memory: ?u64,
169 no_entry: bool,
170 shared_memory: bool,169 shared_memory: bool,
171 export_symbol_names: []const []const u8,170 export_symbol_names: []const []const u8,
172 global_base: ?u64,171 global_base: ?u64,
src/link/Wasm.zig+5-7
...@@ -2817,11 +2817,11 @@ fn setupExports(wasm: *Wasm) !void {...@@ -2817,11 +2817,11 @@ fn setupExports(wasm: *Wasm) !void {
2817}2817}
28182818
2819fn setupStart(wasm: *Wasm) !void {2819fn setupStart(wasm: *Wasm) !void {
2820 if (wasm.base.options.no_entry) return;2820 // do not export entry point if user set none or no default was set.
2821 const entry_name = wasm.base.options.entry orelse "_start";2821 const entry_name = wasm.base.options.entry orelse return;
28222822
2823 const symbol_loc = wasm.findGlobalSymbol(entry_name) orelse {2823 const symbol_loc = wasm.findGlobalSymbol(entry_name) orelse {
2824 log.err("Entry symbol '{s}' missing", .{entry_name});2824 log.err("Entry symbol '{s}' missing, use '-fno-entry' to suppress", .{entry_name});
2825 return error.MissingSymbol;2825 return error.MissingSymbol;
2826 };2826 };
28272827
...@@ -4531,6 +4531,8 @@ fn linkWithLLD(wasm: *Wasm, comp: *Compilation, prog_node: *std.Progress.Node) !...@@ -4531,6 +4531,8 @@ fn linkWithLLD(wasm: *Wasm, comp: *Compilation, prog_node: *std.Progress.Node) !
4531 if (wasm.base.options.entry) |entry| {4531 if (wasm.base.options.entry) |entry| {
4532 try argv.append("--entry");4532 try argv.append("--entry");
4533 try argv.append(entry);4533 try argv.append(entry);
4534 } else {
4535 try argv.append("--no-entry");
4534 }4536 }
45354537
4536 // Increase the default stack size to a more reasonable value of 1MB instead of4538 // Increase the default stack size to a more reasonable value of 1MB instead of
...@@ -4544,10 +4546,6 @@ fn linkWithLLD(wasm: *Wasm, comp: *Compilation, prog_node: *std.Progress.Node) !...@@ -4544,10 +4546,6 @@ fn linkWithLLD(wasm: *Wasm, comp: *Compilation, prog_node: *std.Progress.Node) !
4544 try argv.append("--allow-undefined");4546 try argv.append("--allow-undefined");
4545 }4547 }
45464548
4547 if (wasm.base.options.no_entry) {
4548 try argv.append("--no-entry");
4549 }
4550
4551 if (wasm.base.options.output_mode == .Lib and wasm.base.options.link_mode == .Dynamic) {4549 if (wasm.base.options.output_mode == .Lib and wasm.base.options.link_mode == .Dynamic) {
4552 try argv.append("--shared");4550 try argv.append("--shared");
4553 }4551 }
src/main.zig+38-26
...@@ -509,7 +509,9 @@ const usage_build_generic =...@@ -509,7 +509,9 @@ const usage_build_generic =
509 \\ --dynamic-linker [path] Set the dynamic interpreter path (usually ld.so)509 \\ --dynamic-linker [path] Set the dynamic interpreter path (usually ld.so)
510 \\ --sysroot [path] Set the system root directory (usually /)510 \\ --sysroot [path] Set the system root directory (usually /)
511 \\ --version [ver] Dynamic library semver511 \\ --version [ver] Dynamic library semver
512 \\ --entry [name] Set the entrypoint symbol name512 \\ -fentry Enable entry point with default symbol name
513 \\ -fentry=[name] Override the entry point symbol name
514 \\ -fno-entry Do not output any entry point
513 \\ --force_undefined [name] Specify the symbol must be defined for the link to succeed515 \\ --force_undefined [name] Specify the symbol must be defined for the link to succeed
514 \\ -fsoname[=name] Override the default SONAME value516 \\ -fsoname[=name] Override the default SONAME value
515 \\ -fno-soname Disable emitting a SONAME517 \\ -fno-soname Disable emitting a SONAME
...@@ -577,8 +579,6 @@ const usage_build_generic =...@@ -577,8 +579,6 @@ const usage_build_generic =
577 \\ --shared-memory (WebAssembly) use shared linear memory579 \\ --shared-memory (WebAssembly) use shared linear memory
578 \\ --global-base=[addr] (WebAssembly) where to start to place global data580 \\ --global-base=[addr] (WebAssembly) where to start to place global data
579 \\ --export=[value] (WebAssembly) Force a symbol to be exported581 \\ --export=[value] (WebAssembly) Force a symbol to be exported
580 \\ -fentry (WebAssembly) Force output an entry point
581 \\ -fno-entry (WebAssembly) Do not output any entry point
582 \\582 \\
583 \\Test Options:583 \\Test Options:
584 \\ --test-filter [text] Skip tests that do not match filter584 \\ --test-filter [text] Skip tests that do not match filter
...@@ -837,7 +837,7 @@ fn buildOutputType(...@@ -837,7 +837,7 @@ fn buildOutputType(
837 var linker_import_symbols: bool = false;837 var linker_import_symbols: bool = false;
838 var linker_import_table: bool = false;838 var linker_import_table: bool = false;
839 var linker_export_table: bool = false;839 var linker_export_table: bool = false;
840 var linker_no_entry: ?bool = null;840 var linker_force_entry: ?bool = null;
841 var linker_initial_memory: ?u64 = null;841 var linker_initial_memory: ?u64 = null;
842 var linker_max_memory: ?u64 = null;842 var linker_max_memory: ?u64 = null;
843 var linker_shared_memory: bool = false;843 var linker_shared_memory: bool = false;
...@@ -1074,8 +1074,8 @@ fn buildOutputType(...@@ -1074,8 +1074,8 @@ fn buildOutputType(
1074 subsystem = try parseSubSystem(args_iter.nextOrFatal());1074 subsystem = try parseSubSystem(args_iter.nextOrFatal());
1075 } else if (mem.eql(u8, arg, "-O")) {1075 } else if (mem.eql(u8, arg, "-O")) {
1076 optimize_mode_string = args_iter.nextOrFatal();1076 optimize_mode_string = args_iter.nextOrFatal();
1077 } else if (mem.eql(u8, arg, "--entry")) {1077 } else if (mem.startsWith(u8, arg, "-fentry=")) {
1078 entry = args_iter.nextOrFatal();1078 entry = arg["-fentry=".len..];
1079 } else if (mem.eql(u8, arg, "--force_undefined")) {1079 } else if (mem.eql(u8, arg, "--force_undefined")) {
1080 try force_undefined_symbols.put(gpa, args_iter.nextOrFatal(), {});1080 try force_undefined_symbols.put(gpa, args_iter.nextOrFatal(), {});
1081 } else if (mem.eql(u8, arg, "--stack")) {1081 } else if (mem.eql(u8, arg, "--stack")) {
...@@ -1507,9 +1507,9 @@ fn buildOutputType(...@@ -1507,9 +1507,9 @@ fn buildOutputType(
1507 } else if (mem.eql(u8, arg, "--import-memory")) {1507 } else if (mem.eql(u8, arg, "--import-memory")) {
1508 linker_import_memory = true;1508 linker_import_memory = true;
1509 } else if (mem.eql(u8, arg, "-fentry")) {1509 } else if (mem.eql(u8, arg, "-fentry")) {
1510 linker_no_entry = false;1510 linker_force_entry = true;
1511 } else if (mem.eql(u8, arg, "-fno-entry")) {1511 } else if (mem.eql(u8, arg, "-fno-entry")) {
1512 linker_no_entry = true;1512 linker_force_entry = false;
1513 } else if (mem.eql(u8, arg, "--export-memory")) {1513 } else if (mem.eql(u8, arg, "--export-memory")) {
1514 linker_export_memory = true;1514 linker_export_memory = true;
1515 } else if (mem.eql(u8, arg, "--import-symbols")) {1515 } else if (mem.eql(u8, arg, "--import-symbols")) {
...@@ -2142,7 +2142,7 @@ fn buildOutputType(...@@ -2142,7 +2142,7 @@ fn buildOutputType(
2142 } else if (mem.eql(u8, arg, "--export-table")) {2142 } else if (mem.eql(u8, arg, "--export-table")) {
2143 linker_export_table = true;2143 linker_export_table = true;
2144 } else if (mem.eql(u8, arg, "--no-entry")) {2144 } else if (mem.eql(u8, arg, "--no-entry")) {
2145 linker_no_entry = true;2145 linker_force_entry = false;
2146 } else if (mem.eql(u8, arg, "--initial-memory")) {2146 } else if (mem.eql(u8, arg, "--initial-memory")) {
2147 const next_arg = linker_args_it.nextOrFatal();2147 const next_arg = linker_args_it.nextOrFatal();
2148 linker_initial_memory = std.fmt.parseUnsigned(u32, eatIntPrefix(next_arg, 16), 16) catch |err| {2148 linker_initial_memory = std.fmt.parseUnsigned(u32, eatIntPrefix(next_arg, 16), 16) catch |err| {
...@@ -2605,6 +2605,23 @@ fn buildOutputType(...@@ -2605,6 +2605,23 @@ fn buildOutputType(
2605 link_libcpp = true;2605 link_libcpp = true;
2606 }2606 }
26072607
2608 if (linker_force_entry) |force| {
2609 if (!force) {
2610 entry = null;
2611 } else if (entry == null and output_mode == .Exe) {
2612 entry = switch (target_info.target.ofmt) {
2613 .coff => "wWinMainCRTStartup",
2614 .macho => "_main",
2615 .elf, .plan9 => "_start",
2616 .wasm => defaultWasmEntryName(wasi_exec_model),
2617 else => |tag| fatal("No default entry point available for output format {s}", .{@tagName(tag)}),
2618 };
2619 }
2620 } else if (entry == null and target_info.target.isWasm() and output_mode == .Exe) {
2621 // For WebAssembly the compiler defaults to setting the entry name when no flags are set.
2622 entry = defaultWasmEntryName(wasi_exec_model);
2623 }
2624
2608 if (target_info.target.ofmt == .coff) {2625 if (target_info.target.ofmt == .coff) {
2609 // Now that we know the target supports resources,2626 // Now that we know the target supports resources,
2610 // we can add the res files as link objects.2627 // we can add the res files as link objects.
...@@ -2637,25 +2654,13 @@ fn buildOutputType(...@@ -2637,25 +2654,13 @@ fn buildOutputType(
2637 linker_export_memory = false;2654 linker_export_memory = false;
2638 }2655 }
2639 }2656 }
2640 if (wasi_exec_model) |model| {2657 if (wasi_exec_model != null and wasi_exec_model.? == .reactor) {
2641 if (model == .reactor) {2658 if (entry) |entry_name| {
2642 if (linker_no_entry != null and !linker_no_entry.?) {2659 if (!mem.eql(u8, "_initialize", entry_name)) {
2643 fatal("WASI exucution model 'reactor' incompatible with flag '-fentry'. Reactor execution model has no entry point", .{});2660 fatal("the entry symbol of the reactor model must be '_initialize', but found '{s}'", .{entry_name});
2644 }
2645 if (entry) |entry_name| {
2646 if (!mem.eql(u8, "_initialize", entry_name)) {
2647 fatal("the entry symbol of the reactor model must be '_initialize', but found '{s}'", .{entry_name});
2648 }
2649 } else {
2650 entry = "_initialize";
2651 }2661 }
2652 }2662 }
2653 }2663 }
2654 if (linker_no_entry) |no_entry| {
2655 if (no_entry and entry != null) {
2656 fatal("combination of '--entry' and `-fno-entry` are incompatible", .{});
2657 }
2658 }
2659 if (linker_shared_memory) {2664 if (linker_shared_memory) {
2660 if (output_mode == .Obj) {2665 if (output_mode == .Obj) {
2661 fatal("shared memory is not allowed in object files", .{});2666 fatal("shared memory is not allowed in object files", .{});
...@@ -3503,7 +3508,6 @@ fn buildOutputType(...@@ -3503,7 +3508,6 @@ fn buildOutputType(
3503 .linker_import_symbols = linker_import_symbols,3508 .linker_import_symbols = linker_import_symbols,
3504 .linker_import_table = linker_import_table,3509 .linker_import_table = linker_import_table,
3505 .linker_export_table = linker_export_table,3510 .linker_export_table = linker_export_table,
3506 .linker_no_entry = linker_no_entry orelse false,
3507 .linker_initial_memory = linker_initial_memory,3511 .linker_initial_memory = linker_initial_memory,
3508 .linker_max_memory = linker_max_memory,3512 .linker_max_memory = linker_max_memory,
3509 .linker_shared_memory = linker_shared_memory,3513 .linker_shared_memory = linker_shared_memory,
...@@ -7253,3 +7257,11 @@ fn createDependenciesModule(...@@ -7253,3 +7257,11 @@ fn createDependenciesModule(
7253 try main_mod.deps.put(arena, "@dependencies", deps_mod);7257 try main_mod.deps.put(arena, "@dependencies", deps_mod);
7254 return deps_mod;7258 return deps_mod;
7255}7259}
7260
7261fn defaultWasmEntryName(exec_model: ?std.builtin.WasiExecModel) []const u8 {
7262 const model = exec_model orelse .command;
7263 if (model == .reactor) {
7264 return "_initialize";
7265 }
7266 return "_start";
7267}
test/link/elf.zig+2-2
...@@ -651,7 +651,7 @@ fn testEntryPoint(b: *Build, opts: Options) *Step {...@@ -651,7 +651,7 @@ fn testEntryPoint(b: *Build, opts: Options) *Step {
651 const exe = addExecutable(b, "main", opts);651 const exe = addExecutable(b, "main", opts);
652 exe.addObject(a_o);652 exe.addObject(a_o);
653 exe.addObject(b_o);653 exe.addObject(b_o);
654 exe.entry_symbol_name = "foo";654 exe.entry = .{ .symbol_name = "foo" };
655655
656 const check = exe.checkObject();656 const check = exe.checkObject();
657 check.checkStart();657 check.checkStart();
...@@ -667,7 +667,7 @@ fn testEntryPoint(b: *Build, opts: Options) *Step {...@@ -667,7 +667,7 @@ fn testEntryPoint(b: *Build, opts: Options) *Step {
667 const exe = addExecutable(b, "other", opts);667 const exe = addExecutable(b, "other", opts);
668 exe.addObject(a_o);668 exe.addObject(a_o);
669 exe.addObject(b_o);669 exe.addObject(b_o);
670 exe.entry_symbol_name = "bar";670 exe.entry = .{ .symbol_name = "bar" };
671671
672 const check = exe.checkObject();672 const check = exe.checkObject();
673 check.checkStart();673 check.checkStart();
test/link/macho/entry/build.zig+1-1
...@@ -20,7 +20,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize...@@ -20,7 +20,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
20 });20 });
21 exe.addCSourceFile(.{ .file = .{ .path = "main.c" }, .flags = &.{} });21 exe.addCSourceFile(.{ .file = .{ .path = "main.c" }, .flags = &.{} });
22 exe.linkLibC();22 exe.linkLibC();
23 exe.entry_symbol_name = "_non_main";23 exe.entry = .{ .symbol_name = "_non_main" };
2424
25 const check_exe = exe.checkObject();25 const check_exe = exe.checkObject();
2626
test/link/macho/entry_in_dylib/build.zig+1-1
...@@ -30,7 +30,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize...@@ -30,7 +30,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
30 exe.addCSourceFile(.{ .file = .{ .path = "main.c" }, .flags = &.{} });30 exe.addCSourceFile(.{ .file = .{ .path = "main.c" }, .flags = &.{} });
31 exe.linkLibrary(lib);31 exe.linkLibrary(lib);
32 exe.linkLibC();32 exe.linkLibC();
33 exe.entry_symbol_name = "_bootstrap";33 exe.entry = .{ .symbol_name = "_bootstrap" };
34 exe.forceUndefinedSymbol("_my_main");34 exe.forceUndefinedSymbol("_my_main");
3535
36 const check_exe = exe.checkObject();36 const check_exe = exe.checkObject();
test/link/wasm/archive/build.zig+1-1
...@@ -21,7 +21,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize...@@ -21,7 +21,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
21 .optimize = optimize,21 .optimize = optimize,
22 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },22 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
23 });23 });
24 lib.no_entry = true;24 lib.entry = .disabled;
25 lib.use_llvm = false;25 lib.use_llvm = false;
26 lib.use_lld = false;26 lib.use_lld = false;
27 lib.strip = false;27 lib.strip = false;
test/link/wasm/basic-features/build.zig+1-1
...@@ -15,7 +15,7 @@ pub fn build(b: *std.Build) void {...@@ -15,7 +15,7 @@ pub fn build(b: *std.Build) void {
15 .os_tag = .freestanding,15 .os_tag = .freestanding,
16 },16 },
17 });17 });
18 lib.no_entry = true;18 lib.entry = .disabled;
19 lib.use_llvm = false;19 lib.use_llvm = false;
20 lib.use_lld = false;20 lib.use_lld = false;
2121
test/link/wasm/bss/build.zig+2-2
...@@ -20,7 +20,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize_mode: std.builtin.Opt...@@ -20,7 +20,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize_mode: std.builtin.Opt
20 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },20 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
21 .optimize = optimize_mode,21 .optimize = optimize_mode,
22 });22 });
23 lib.no_entry = true;23 lib.entry = .disabled;
24 lib.use_llvm = false;24 lib.use_llvm = false;
25 lib.use_lld = false;25 lib.use_lld = false;
26 lib.strip = false;26 lib.strip = false;
...@@ -67,7 +67,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize_mode: std.builtin.Opt...@@ -67,7 +67,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize_mode: std.builtin.Opt
67 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },67 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
68 .optimize = optimize_mode,68 .optimize = optimize_mode,
69 });69 });
70 lib.no_entry = true;70 lib.entry = .disabled;
71 lib.use_llvm = false;71 lib.use_llvm = false;
72 lib.use_lld = false;72 lib.use_lld = false;
73 lib.strip = false;73 lib.strip = false;
test/link/wasm/export-data/build.zig+1-1
...@@ -15,7 +15,7 @@ pub fn build(b: *std.Build) void {...@@ -15,7 +15,7 @@ pub fn build(b: *std.Build) void {
15 .optimize = .ReleaseSafe, // to make the output deterministic in address positions15 .optimize = .ReleaseSafe, // to make the output deterministic in address positions
16 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },16 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
17 });17 });
18 lib.no_entry = true;18 lib.entry = .disabled;
19 lib.use_lld = false;19 lib.use_lld = false;
20 lib.export_symbol_names = &.{ "foo", "bar" };20 lib.export_symbol_names = &.{ "foo", "bar" };
21 lib.global_base = 0; // put data section at address 0 to make data symbols easier to parse21 lib.global_base = 0; // put data section at address 0 to make data symbols easier to parse
test/link/wasm/export/build.zig+3-3
...@@ -19,7 +19,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize...@@ -19,7 +19,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
19 .optimize = optimize,19 .optimize = optimize,
20 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },20 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
21 });21 });
22 no_export.no_entry = true;22 no_export.entry = .disabled;
23 no_export.use_llvm = false;23 no_export.use_llvm = false;
24 no_export.use_lld = false;24 no_export.use_lld = false;
2525
...@@ -29,7 +29,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize...@@ -29,7 +29,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
29 .optimize = optimize,29 .optimize = optimize,
30 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },30 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
31 });31 });
32 dynamic_export.no_entry = true;32 dynamic_export.entry = .disabled;
33 dynamic_export.rdynamic = true;33 dynamic_export.rdynamic = true;
34 dynamic_export.use_llvm = false;34 dynamic_export.use_llvm = false;
35 dynamic_export.use_lld = false;35 dynamic_export.use_lld = false;
...@@ -40,7 +40,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize...@@ -40,7 +40,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
40 .optimize = optimize,40 .optimize = optimize,
41 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },41 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
42 });42 });
43 force_export.no_entry = true;43 force_export.entry = .disabled;
44 force_export.export_symbol_names = &.{"foo"};44 force_export.export_symbol_names = &.{"foo"};
45 force_export.use_llvm = false;45 force_export.use_llvm = false;
46 force_export.use_lld = false;46 force_export.use_lld = false;
test/link/wasm/extern-mangle/build.zig+1-1
...@@ -17,7 +17,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize...@@ -17,7 +17,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
17 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },17 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
18 .optimize = optimize,18 .optimize = optimize,
19 });19 });
20 lib.no_entry = true;20 lib.entry = .disabled;
21 lib.import_symbols = true; // import `a` and `b`21 lib.import_symbols = true; // import `a` and `b`
22 lib.rdynamic = true; // export `foo`22 lib.rdynamic = true; // export `foo`
2323
test/link/wasm/function-table/build.zig+3-3
...@@ -19,7 +19,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize...@@ -19,7 +19,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
19 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },19 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
20 .optimize = optimize,20 .optimize = optimize,
21 });21 });
22 import_table.no_entry = true;22 import_table.entry = .disabled;
23 import_table.use_llvm = false;23 import_table.use_llvm = false;
24 import_table.use_lld = false;24 import_table.use_lld = false;
25 import_table.import_table = true;25 import_table.import_table = true;
...@@ -30,7 +30,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize...@@ -30,7 +30,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
30 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },30 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
31 .optimize = optimize,31 .optimize = optimize,
32 });32 });
33 export_table.no_entry = true;33 export_table.entry = .disabled;
34 export_table.use_llvm = false;34 export_table.use_llvm = false;
35 export_table.use_lld = false;35 export_table.use_lld = false;
36 export_table.export_table = true;36 export_table.export_table = true;
...@@ -41,7 +41,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize...@@ -41,7 +41,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
41 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },41 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
42 .optimize = optimize,42 .optimize = optimize,
43 });43 });
44 regular_table.no_entry = true;44 regular_table.entry = .disabled;
45 regular_table.use_llvm = false;45 regular_table.use_llvm = false;
46 regular_table.use_lld = false;46 regular_table.use_lld = false;
4747
test/link/wasm/infer-features/build.zig+1-1
...@@ -27,7 +27,7 @@ pub fn build(b: *std.Build) void {...@@ -27,7 +27,7 @@ pub fn build(b: *std.Build) void {
27 .os_tag = .freestanding,27 .os_tag = .freestanding,
28 },28 },
29 });29 });
30 lib.no_entry = true;30 lib.entry = .disabled;
31 lib.use_llvm = false;31 lib.use_llvm = false;
32 lib.use_lld = false;32 lib.use_lld = false;
33 lib.addObject(c_obj);33 lib.addObject(c_obj);
test/link/wasm/producers/build.zig+1-1
...@@ -20,7 +20,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize...@@ -20,7 +20,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
20 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },20 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
21 .optimize = optimize,21 .optimize = optimize,
22 });22 });
23 lib.no_entry = true;23 lib.entry = .disabled;
24 lib.use_llvm = false;24 lib.use_llvm = false;
25 lib.use_lld = false;25 lib.use_lld = false;
26 lib.strip = false;26 lib.strip = false;
test/link/wasm/segments/build.zig+1-1
...@@ -19,7 +19,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize...@@ -19,7 +19,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
19 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },19 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
20 .optimize = optimize,20 .optimize = optimize,
21 });21 });
22 lib.no_entry = true;22 lib.entry = .disabled;
23 lib.use_llvm = false;23 lib.use_llvm = false;
24 lib.use_lld = false;24 lib.use_lld = false;
25 lib.strip = false;25 lib.strip = false;
test/link/wasm/shared-memory/build.zig+1-1
...@@ -22,7 +22,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize_mode: std.builtin.Opt...@@ -22,7 +22,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize_mode: std.builtin.Opt
22 },22 },
23 .optimize = optimize_mode,23 .optimize = optimize_mode,
24 });24 });
25 lib.no_entry = true;25 lib.entry = .disabled;
26 lib.use_lld = false;26 lib.use_lld = false;
27 lib.strip = false;27 lib.strip = false;
28 lib.import_memory = true;28 lib.import_memory = true;
test/link/wasm/stack_pointer/build.zig+1-1
...@@ -19,7 +19,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize...@@ -19,7 +19,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
19 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },19 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
20 .optimize = optimize,20 .optimize = optimize,
21 });21 });
22 lib.no_entry = true;22 lib.entry = .disabled;
23 lib.use_llvm = false;23 lib.use_llvm = false;
24 lib.use_lld = false;24 lib.use_lld = false;
25 lib.strip = false;25 lib.strip = false;
test/link/wasm/type/build.zig+1-1
...@@ -19,7 +19,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize...@@ -19,7 +19,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
19 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },19 .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
20 .optimize = optimize,20 .optimize = optimize,
21 });21 });
22 lib.no_entry = true;22 lib.entry = .disabled;
23 lib.use_llvm = false;23 lib.use_llvm = false;
24 lib.use_lld = false;24 lib.use_lld = false;
25 lib.strip = false;25 lib.strip = false;