@@ -6,23 +6,23 @@ Apply this patch:
66
77``` patch
88diff --git a/build.zig b/build.zig
9- index 9926d6e5e..461a0c7af 100644
9+ index 9e6e86386..ec8b6b9bd 100644
1010--- a/build.zig
1111+++ b/build.zig
12- @@ -204 ,7 +204 ,7 @@ pub fn build(b: *std.Build) !void {
13- exe_options.addOption(bool, "llvm_has_arc ", llvm_has_arc );
12+ @@ -237 ,7 +237 ,7 @@ pub fn build(b: *std.Build) !void {
13+ exe_options.addOption(bool, "llvm_has_xtensa ", llvm_has_xtensa );
1414 exe_options.addOption(bool, "force_gpa", force_gpa);
1515 exe_options.addOption(bool, "only_c", only_c);
16- - exe_options.addOption(bool, "omit_pkg_fetching_code ", only_c);
17- + exe_options.addOption(bool, "omit_pkg_fetching_code ", true);
18-
16+ - exe_options.addOption(bool, "only_core_functionality ", only_c);
17+ + exe_options.addOption(bool, "only_core_functionality ", true);
18+
1919 if (link_libc) {
2020 exe.linkLibC();
2121diff --git a/src/link.zig b/src/link.zig
22- index 45873fec2..43f4dc7d1 100644
22+ index 703dfb873..3bc4039e7 100644
2323--- a/src/link.zig
2424+++ b/src/link.zig
25- @@ -761 ,9 +761 ,9 @@ pub const File = struct {
25+ @@ -765 ,9 +765 ,9 @@ pub const File = struct {
2626 /// Commit pending changes and write headers. Takes into account final output mode
2727 /// and `use_lld`, not only `effectiveOutputMode`.
2828 pub fn flush(base: *File, comp: *Compilation, prog_node: *std.Progress.Node) FlushError!void {
@@ -40,7 +40,7 @@ index c4fb9b829..7fdc018ab 100644
4040--- a/src/link/Wasm/Archive.zig
4141+++ b/src/link/Wasm/Archive.zig
4242@@ -208,9 +208,9 @@ pub fn parseObject(archive: Archive, allocator: Allocator, file_offset: u32) !Ob
43-
43+
4444 const object_name = try archive.parseName(header);
4545 const name = name: {
4646- var buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined;
@@ -51,30 +51,30 @@ index c4fb9b829..7fdc018ab 100644
5151+ break :name try std.fmt.allocPrint(allocator, "{s}({s})", .{ archive.name, object_name });
5252 };
5353 defer allocator.free(name);
54-
54+
5555diff --git a/src/main.zig b/src/main.zig
56- index 76c43476e..05eae6722 100644
56+ index 39a7adc42..616518d15 100644
5757--- a/src/main.zig
5858+++ b/src/main.zig
59- @@ -198 ,7 +198 ,7 @@ pub fn main() anyerror!void {
59+ @@ -200 ,7 +200 ,7 @@ pub fn main() anyerror!void {
6060 }
61-
61+
6262 // Short circuit some of the other logic for bootstrapping.
6363- if (build_options.only_c) {
6464+ if (true) {
6565 if (mem.eql(u8, args[1], "build-exe")) {
6666 return buildOutputType(gpa, arena, args, .{ .build = .Exe });
6767 } else if (mem.eql(u8, args[1], "build-obj")) {
68- @@ -1522 ,7 +1522 ,7 @@ fn buildOutputType(
68+ @@ -1544 ,7 +1544 ,7 @@ fn buildOutputType(
6969 }
7070 },
7171 .cc, .cpp => {
7272- if (build_options.only_c) unreachable;
7373+ if (true) unreachable;
74-
74+
7575 emit_h = .no;
7676 soname = .no;
77- @@ -3190 ,7 +3190 ,7 @@ fn buildOutputType(
77+ @@ -3238 ,7 +3238 ,7 @@ fn buildOutputType(
7878 switch (listen) {
7979 .none => {},
8080 .stdio => {
@@ -83,18 +83,19 @@ index 76c43476e..05eae6722 100644
8383 try serve(
8484 comp,
8585 std.io.getStdIn(),
86- @@ -3250 ,7 +3250 ,7 @@ fn buildOutputType(
86+ @@ -3286 ,7 +3286 ,7 @@ fn buildOutputType(
8787 error.SemanticAnalyzeFail => if (listen == .none) process.exit(1),
8888 else => |e| return e,
8989 };
9090- if (build_options.only_c) return cleanExit();
9191+ if (true) return cleanExit();
9292 try comp.makeBinFileExecutable();
93-
93+
9494 if (test_exec_args.items.len == 0 and object_format == .c) default_exec_args: {
9595```
9696
9797then:
98+
9899``` bash
99- ../zig-from-website/zig build -Dtarget=wasm32-wasi -Drelease=true
100+ ../zig-from-website/zig build -Dtarget=wasm32-wasi -Doptimize=ReleaseSmall -Dno-langref -Dno-autodocs -Dno-lib
100101```
0 commit comments