| author | |
| committer | |
| log | c893f837151d4764fd34911376836a01192b4d75 |
| tree | 5b27b35ef9c77e343a39ab1bdc1f24270e56bec2 |
| parent | 5b2ee5eacc177873ce674a307a1bebdfffeeae10 |
| signature |
21 files changed, 86 insertions(+), 70 deletions(-)
lib/std/Build/Step/Compile.zig+21-11| ... | ... | @@ -64,8 +64,6 @@ initial_memory: ?u64 = null, |
| 64 | 64 | max_memory: ?u64 = null, |
| 65 | 65 | shared_memory: bool = false, |
| 66 | 66 | global_base: ?u64 = null, |
| 67 | /// For WebAssembly only. Tells the linker to not output an entry point. | |
| 68 | no_entry: ?bool = null, | |
| 69 | 67 | c_std: std.Build.CStd, |
| 70 | 68 | /// Set via options; intended to be read-only after that. |
| 71 | 69 | zig_lib_dir: ?LazyPath, |
| ... | ... | @@ -191,7 +189,8 @@ dll_export_fns: ?bool = null, |
| 191 | 189 | |
| 192 | 190 | subsystem: ?std.Target.SubSystem = null, |
| 193 | 191 | |
| 194 | entry_symbol_name: ?[]const u8 = null, | |
| 192 | /// How the linker must handle the entry point of the executable. | |
| 193 | entry: Entry = .default, | |
| 195 | 194 | |
| 196 | 195 | /// List of symbols forced as undefined in the symbol table |
| 197 | 196 | /// thus forcing their resolution by the linker. |
| ... | ... | @@ -306,6 +305,18 @@ const FrameworkLinkInfo = struct { |
| 306 | 305 | weak: bool = false, |
| 307 | 306 | }; |
| 308 | 307 | |
| 308 | const 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 | ||
| 309 | 320 | pub const IncludeDir = union(enum) { |
| 310 | 321 | path: LazyPath, |
| 311 | 322 | path_system: LazyPath, |
| ... | ... | @@ -1420,9 +1431,13 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 1420 | 1431 | try zig_args.append(try std.fmt.allocPrint(b.allocator, "-ofmt={s}", .{@tagName(ofmt)})); |
| 1421 | 1432 | } |
| 1422 | 1433 | |
| 1423 | if (self.entry_symbol_name) |entry| { | |
| 1424 | try zig_args.append("--entry"); | |
| 1425 | try zig_args.append(entry); | |
| 1434 | switch (self.entry) { | |
| 1435 | .default => {}, | |
| 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 | } |
| 1427 | 1442 | |
| 1428 | 1443 | { |
| ... | ... | @@ -1853,11 +1868,6 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 1853 | 1868 | if (self.global_base) |global_base| { |
| 1854 | 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 | } | |
| 1861 | 1871 | |
| 1862 | 1872 | if (self.code_model != .default) { |
| 1863 | 1873 | try zig_args.append("-mcmodel"); |
src/Compilation.zig-3| ... | ... | @@ -643,7 +643,6 @@ pub const InitOptions = struct { |
| 643 | 643 | linker_import_symbols: bool = false, |
| 644 | 644 | linker_import_table: bool = false, |
| 645 | 645 | linker_export_table: bool = false, |
| 646 | linker_no_entry: bool = false, | |
| 647 | 646 | linker_initial_memory: ?u64 = null, |
| 648 | 647 | linker_max_memory: ?u64 = null, |
| 649 | 648 | linker_shared_memory: bool = false, |
| ... | ... | @@ -1615,7 +1614,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1615 | 1614 | .import_symbols = options.linker_import_symbols, |
| 1616 | 1615 | .import_table = options.linker_import_table, |
| 1617 | 1616 | .export_table = options.linker_export_table, |
| 1618 | .no_entry = options.linker_no_entry, | |
| 1619 | 1617 | .initial_memory = options.linker_initial_memory, |
| 1620 | 1618 | .max_memory = options.linker_max_memory, |
| 1621 | 1619 | .shared_memory = options.linker_shared_memory, |
| ... | ... | @@ -2579,7 +2577,6 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes |
| 2579 | 2577 | man.hash.addOptional(comp.bin_file.options.max_memory); |
| 2580 | 2578 | man.hash.add(comp.bin_file.options.shared_memory); |
| 2581 | 2579 | man.hash.addOptional(comp.bin_file.options.global_base); |
| 2582 | man.hash.add(comp.bin_file.options.no_entry); | |
| 2583 | 2580 | |
| 2584 | 2581 | // Mach-O specific stuff |
| 2585 | 2582 | man.hash.addListOfBytes(comp.bin_file.options.framework_dirs); |
src/link.zig-1| ... | ... | @@ -166,7 +166,6 @@ pub const Options = struct { |
| 166 | 166 | export_table: bool, |
| 167 | 167 | initial_memory: ?u64, |
| 168 | 168 | max_memory: ?u64, |
| 169 | no_entry: bool, | |
| 170 | 169 | shared_memory: bool, |
| 171 | 170 | export_symbol_names: []const []const u8, |
| 172 | 171 | global_base: ?u64, |
src/link/Wasm.zig+5-7| ... | ... | @@ -2817,11 +2817,11 @@ fn setupExports(wasm: *Wasm) !void { |
| 2817 | 2817 | } |
| 2818 | 2818 | |
| 2819 | 2819 | fn setupStart(wasm: *Wasm) !void { |
| 2820 | if (wasm.base.options.no_entry) return; | |
| 2821 | const entry_name = wasm.base.options.entry orelse "_start"; | |
| 2820 | // do not export entry point if user set none or no default was set. | |
| 2821 | const entry_name = wasm.base.options.entry orelse return; | |
| 2822 | 2822 | |
| 2823 | 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 | 2825 | return error.MissingSymbol; |
| 2826 | 2826 | }; |
| 2827 | 2827 | |
| ... | ... | @@ -4531,6 +4531,8 @@ fn linkWithLLD(wasm: *Wasm, comp: *Compilation, prog_node: *std.Progress.Node) ! |
| 4531 | 4531 | if (wasm.base.options.entry) |entry| { |
| 4532 | 4532 | try argv.append("--entry"); |
| 4533 | 4533 | try argv.append(entry); |
| 4534 | } else { | |
| 4535 | try argv.append("--no-entry"); | |
| 4534 | 4536 | } |
| 4535 | 4537 | |
| 4536 | 4538 | // 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 | 4546 | try argv.append("--allow-undefined"); |
| 4545 | 4547 | } |
| 4546 | 4548 | |
| 4547 | if (wasm.base.options.no_entry) { | |
| 4548 | try argv.append("--no-entry"); | |
| 4549 | } | |
| 4550 | ||
| 4551 | 4549 | if (wasm.base.options.output_mode == .Lib and wasm.base.options.link_mode == .Dynamic) { |
| 4552 | 4550 | try argv.append("--shared"); |
| 4553 | 4551 | } |
src/main.zig+38-26| ... | ... | @@ -509,7 +509,9 @@ const usage_build_generic = |
| 509 | 509 | \\ --dynamic-linker [path] Set the dynamic interpreter path (usually ld.so) |
| 510 | 510 | \\ --sysroot [path] Set the system root directory (usually /) |
| 511 | 511 | \\ --version [ver] Dynamic library semver |
| 512 | \\ --entry [name] Set the entrypoint symbol name | |
| 512 | \\ -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 | 515 | \\ --force_undefined [name] Specify the symbol must be defined for the link to succeed |
| 514 | 516 | \\ -fsoname[=name] Override the default SONAME value |
| 515 | 517 | \\ -fno-soname Disable emitting a SONAME |
| ... | ... | @@ -577,8 +579,6 @@ const usage_build_generic = |
| 577 | 579 | \\ --shared-memory (WebAssembly) use shared linear memory |
| 578 | 580 | \\ --global-base=[addr] (WebAssembly) where to start to place global data |
| 579 | 581 | \\ --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 | 583 | \\Test Options: |
| 584 | 584 | \\ --test-filter [text] Skip tests that do not match filter |
| ... | ... | @@ -837,7 +837,7 @@ fn buildOutputType( |
| 837 | 837 | var linker_import_symbols: bool = false; |
| 838 | 838 | var linker_import_table: bool = false; |
| 839 | 839 | var linker_export_table: bool = false; |
| 840 | var linker_no_entry: ?bool = null; | |
| 840 | var linker_force_entry: ?bool = null; | |
| 841 | 841 | var linker_initial_memory: ?u64 = null; |
| 842 | 842 | var linker_max_memory: ?u64 = null; |
| 843 | 843 | var linker_shared_memory: bool = false; |
| ... | ... | @@ -1074,8 +1074,8 @@ fn buildOutputType( |
| 1074 | 1074 | subsystem = try parseSubSystem(args_iter.nextOrFatal()); |
| 1075 | 1075 | } else if (mem.eql(u8, arg, "-O")) { |
| 1076 | 1076 | optimize_mode_string = args_iter.nextOrFatal(); |
| 1077 | } else if (mem.eql(u8, arg, "--entry")) { | |
| 1078 | entry = args_iter.nextOrFatal(); | |
| 1077 | } else if (mem.startsWith(u8, arg, "-fentry=")) { | |
| 1078 | entry = arg["-fentry=".len..]; | |
| 1079 | 1079 | } else if (mem.eql(u8, arg, "--force_undefined")) { |
| 1080 | 1080 | try force_undefined_symbols.put(gpa, args_iter.nextOrFatal(), {}); |
| 1081 | 1081 | } else if (mem.eql(u8, arg, "--stack")) { |
| ... | ... | @@ -1507,9 +1507,9 @@ fn buildOutputType( |
| 1507 | 1507 | } else if (mem.eql(u8, arg, "--import-memory")) { |
| 1508 | 1508 | linker_import_memory = true; |
| 1509 | 1509 | } else if (mem.eql(u8, arg, "-fentry")) { |
| 1510 | linker_no_entry = false; | |
| 1510 | linker_force_entry = true; | |
| 1511 | 1511 | } else if (mem.eql(u8, arg, "-fno-entry")) { |
| 1512 | linker_no_entry = true; | |
| 1512 | linker_force_entry = false; | |
| 1513 | 1513 | } else if (mem.eql(u8, arg, "--export-memory")) { |
| 1514 | 1514 | linker_export_memory = true; |
| 1515 | 1515 | } else if (mem.eql(u8, arg, "--import-symbols")) { |
| ... | ... | @@ -2142,7 +2142,7 @@ fn buildOutputType( |
| 2142 | 2142 | } else if (mem.eql(u8, arg, "--export-table")) { |
| 2143 | 2143 | linker_export_table = true; |
| 2144 | 2144 | } else if (mem.eql(u8, arg, "--no-entry")) { |
| 2145 | linker_no_entry = true; | |
| 2145 | linker_force_entry = false; | |
| 2146 | 2146 | } else if (mem.eql(u8, arg, "--initial-memory")) { |
| 2147 | 2147 | const next_arg = linker_args_it.nextOrFatal(); |
| 2148 | 2148 | linker_initial_memory = std.fmt.parseUnsigned(u32, eatIntPrefix(next_arg, 16), 16) catch |err| { |
| ... | ... | @@ -2605,6 +2605,23 @@ fn buildOutputType( |
| 2605 | 2605 | link_libcpp = true; |
| 2606 | 2606 | } |
| 2607 | 2607 | |
| 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 | 2625 | if (target_info.target.ofmt == .coff) { |
| 2609 | 2626 | // Now that we know the target supports resources, |
| 2610 | 2627 | // we can add the res files as link objects. |
| ... | ... | @@ -2637,25 +2654,13 @@ fn buildOutputType( |
| 2637 | 2654 | linker_export_memory = false; |
| 2638 | 2655 | } |
| 2639 | 2656 | } |
| 2640 | if (wasi_exec_model) |model| { | |
| 2641 | if (model == .reactor) { | |
| 2642 | if (linker_no_entry != null and !linker_no_entry.?) { | |
| 2643 | fatal("WASI exucution model 'reactor' incompatible with flag '-fentry'. Reactor execution model has no entry point", .{}); | |
| 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"; | |
| 2657 | if (wasi_exec_model != null and wasi_exec_model.? == .reactor) { | |
| 2658 | if (entry) |entry_name| { | |
| 2659 | if (!mem.eql(u8, "_initialize", entry_name)) { | |
| 2660 | fatal("the entry symbol of the reactor model must be '_initialize', but found '{s}'", .{entry_name}); | |
| 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 | 2664 | if (linker_shared_memory) { |
| 2660 | 2665 | if (output_mode == .Obj) { |
| 2661 | 2666 | fatal("shared memory is not allowed in object files", .{}); |
| ... | ... | @@ -3503,7 +3508,6 @@ fn buildOutputType( |
| 3503 | 3508 | .linker_import_symbols = linker_import_symbols, |
| 3504 | 3509 | .linker_import_table = linker_import_table, |
| 3505 | 3510 | .linker_export_table = linker_export_table, |
| 3506 | .linker_no_entry = linker_no_entry orelse false, | |
| 3507 | 3511 | .linker_initial_memory = linker_initial_memory, |
| 3508 | 3512 | .linker_max_memory = linker_max_memory, |
| 3509 | 3513 | .linker_shared_memory = linker_shared_memory, |
| ... | ... | @@ -7253,3 +7257,11 @@ fn createDependenciesModule( |
| 7253 | 7257 | try main_mod.deps.put(arena, "@dependencies", deps_mod); |
| 7254 | 7258 | return deps_mod; |
| 7255 | 7259 | } |
| 7260 | ||
| 7261 | fn 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 | 651 | const exe = addExecutable(b, "main", opts); |
| 652 | 652 | exe.addObject(a_o); |
| 653 | 653 | exe.addObject(b_o); |
| 654 | exe.entry_symbol_name = "foo"; | |
| 654 | exe.entry = .{ .symbol_name = "foo" }; | |
| 655 | 655 | |
| 656 | 656 | const check = exe.checkObject(); |
| 657 | 657 | check.checkStart(); |
| ... | ... | @@ -667,7 +667,7 @@ fn testEntryPoint(b: *Build, opts: Options) *Step { |
| 667 | 667 | const exe = addExecutable(b, "other", opts); |
| 668 | 668 | exe.addObject(a_o); |
| 669 | 669 | exe.addObject(b_o); |
| 670 | exe.entry_symbol_name = "bar"; | |
| 670 | exe.entry = .{ .symbol_name = "bar" }; | |
| 671 | 671 | |
| 672 | 672 | const check = exe.checkObject(); |
| 673 | 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 | 20 | }); |
| 21 | 21 | exe.addCSourceFile(.{ .file = .{ .path = "main.c" }, .flags = &.{} }); |
| 22 | 22 | exe.linkLibC(); |
| 23 | exe.entry_symbol_name = "_non_main"; | |
| 23 | exe.entry = .{ .symbol_name = "_non_main" }; | |
| 24 | 24 | |
| 25 | 25 | const check_exe = exe.checkObject(); |
| 26 | 26 |
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 | 30 | exe.addCSourceFile(.{ .file = .{ .path = "main.c" }, .flags = &.{} }); |
| 31 | 31 | exe.linkLibrary(lib); |
| 32 | 32 | exe.linkLibC(); |
| 33 | exe.entry_symbol_name = "_bootstrap"; | |
| 33 | exe.entry = .{ .symbol_name = "_bootstrap" }; | |
| 34 | 34 | exe.forceUndefinedSymbol("_my_main"); |
| 35 | 35 | |
| 36 | 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 | 21 | .optimize = optimize, |
| 22 | 22 | .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, |
| 23 | 23 | }); |
| 24 | lib.no_entry = true; | |
| 24 | lib.entry = .disabled; | |
| 25 | 25 | lib.use_llvm = false; |
| 26 | 26 | lib.use_lld = false; |
| 27 | 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 | 15 | .os_tag = .freestanding, |
| 16 | 16 | }, |
| 17 | 17 | }); |
| 18 | lib.no_entry = true; | |
| 18 | lib.entry = .disabled; | |
| 19 | 19 | lib.use_llvm = false; |
| 20 | 20 | lib.use_lld = false; |
| 21 | 21 |
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 | 20 | .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, |
| 21 | 21 | .optimize = optimize_mode, |
| 22 | 22 | }); |
| 23 | lib.no_entry = true; | |
| 23 | lib.entry = .disabled; | |
| 24 | 24 | lib.use_llvm = false; |
| 25 | 25 | lib.use_lld = false; |
| 26 | 26 | lib.strip = false; |
| ... | ... | @@ -67,7 +67,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize_mode: std.builtin.Opt |
| 67 | 67 | .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, |
| 68 | 68 | .optimize = optimize_mode, |
| 69 | 69 | }); |
| 70 | lib.no_entry = true; | |
| 70 | lib.entry = .disabled; | |
| 71 | 71 | lib.use_llvm = false; |
| 72 | 72 | lib.use_lld = false; |
| 73 | 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 | 15 | .optimize = .ReleaseSafe, // to make the output deterministic in address positions |
| 16 | 16 | .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, |
| 17 | 17 | }); |
| 18 | lib.no_entry = true; | |
| 18 | lib.entry = .disabled; | |
| 19 | 19 | lib.use_lld = false; |
| 20 | 20 | lib.export_symbol_names = &.{ "foo", "bar" }; |
| 21 | 21 | 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 | 19 | .optimize = optimize, |
| 20 | 20 | .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, |
| 21 | 21 | }); |
| 22 | no_export.no_entry = true; | |
| 22 | no_export.entry = .disabled; | |
| 23 | 23 | no_export.use_llvm = false; |
| 24 | 24 | no_export.use_lld = false; |
| 25 | 25 | |
| ... | ... | @@ -29,7 +29,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize |
| 29 | 29 | .optimize = optimize, |
| 30 | 30 | .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, |
| 31 | 31 | }); |
| 32 | dynamic_export.no_entry = true; | |
| 32 | dynamic_export.entry = .disabled; | |
| 33 | 33 | dynamic_export.rdynamic = true; |
| 34 | 34 | dynamic_export.use_llvm = false; |
| 35 | 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 | 40 | .optimize = optimize, |
| 41 | 41 | .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, |
| 42 | 42 | }); |
| 43 | force_export.no_entry = true; | |
| 43 | force_export.entry = .disabled; | |
| 44 | 44 | force_export.export_symbol_names = &.{"foo"}; |
| 45 | 45 | force_export.use_llvm = false; |
| 46 | 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 | 17 | .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, |
| 18 | 18 | .optimize = optimize, |
| 19 | 19 | }); |
| 20 | lib.no_entry = true; | |
| 20 | lib.entry = .disabled; | |
| 21 | 21 | lib.import_symbols = true; // import `a` and `b` |
| 22 | 22 | lib.rdynamic = true; // export `foo` |
| 23 | 23 |
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 | 19 | .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, |
| 20 | 20 | .optimize = optimize, |
| 21 | 21 | }); |
| 22 | import_table.no_entry = true; | |
| 22 | import_table.entry = .disabled; | |
| 23 | 23 | import_table.use_llvm = false; |
| 24 | 24 | import_table.use_lld = false; |
| 25 | 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 | 30 | .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, |
| 31 | 31 | .optimize = optimize, |
| 32 | 32 | }); |
| 33 | export_table.no_entry = true; | |
| 33 | export_table.entry = .disabled; | |
| 34 | 34 | export_table.use_llvm = false; |
| 35 | 35 | export_table.use_lld = false; |
| 36 | 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 | 41 | .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, |
| 42 | 42 | .optimize = optimize, |
| 43 | 43 | }); |
| 44 | regular_table.no_entry = true; | |
| 44 | regular_table.entry = .disabled; | |
| 45 | 45 | regular_table.use_llvm = false; |
| 46 | 46 | regular_table.use_lld = false; |
| 47 | 47 |
test/link/wasm/infer-features/build.zig+1-1| ... | ... | @@ -27,7 +27,7 @@ pub fn build(b: *std.Build) void { |
| 27 | 27 | .os_tag = .freestanding, |
| 28 | 28 | }, |
| 29 | 29 | }); |
| 30 | lib.no_entry = true; | |
| 30 | lib.entry = .disabled; | |
| 31 | 31 | lib.use_llvm = false; |
| 32 | 32 | lib.use_lld = false; |
| 33 | 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 | 20 | .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, |
| 21 | 21 | .optimize = optimize, |
| 22 | 22 | }); |
| 23 | lib.no_entry = true; | |
| 23 | lib.entry = .disabled; | |
| 24 | 24 | lib.use_llvm = false; |
| 25 | 25 | lib.use_lld = false; |
| 26 | 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 | 19 | .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, |
| 20 | 20 | .optimize = optimize, |
| 21 | 21 | }); |
| 22 | lib.no_entry = true; | |
| 22 | lib.entry = .disabled; | |
| 23 | 23 | lib.use_llvm = false; |
| 24 | 24 | lib.use_lld = false; |
| 25 | 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 | 22 | }, |
| 23 | 23 | .optimize = optimize_mode, |
| 24 | 24 | }); |
| 25 | lib.no_entry = true; | |
| 25 | lib.entry = .disabled; | |
| 26 | 26 | lib.use_lld = false; |
| 27 | 27 | lib.strip = false; |
| 28 | 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 | 19 | .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, |
| 20 | 20 | .optimize = optimize, |
| 21 | 21 | }); |
| 22 | lib.no_entry = true; | |
| 22 | lib.entry = .disabled; | |
| 23 | 23 | lib.use_llvm = false; |
| 24 | 24 | lib.use_lld = false; |
| 25 | 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 | 19 | .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, |
| 20 | 20 | .optimize = optimize, |
| 21 | 21 | }); |
| 22 | lib.no_entry = true; | |
| 22 | lib.entry = .disabled; | |
| 23 | 23 | lib.use_llvm = false; |
| 24 | 24 | lib.use_lld = false; |
| 25 | 25 | lib.strip = false; |