authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-29 02:09:17-08:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-02-29 02:09:17-08:00
log5c0766b6c8f1aea18815206e0698953a35384a21
treec263a5a94e3b4a06f16a291b3fa3ac9a30b15cf1
parent3e292e5fc12304148b35d6d60762e9b383d02133
parentf7d095d37267658ba0dc3a7e9c1506a9bbab0b49
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #19127 from ziglang/export-symbol-names-cache-hash

add missing export symbol names to whole mode wasm cache hash

2 files changed, 3 insertions(+), 8 deletions(-)

src/Compilation.zig+1
......@@ -2584,6 +2584,7 @@ fn addNonIncrementalStuffToCacheManifest(
25842584 man.hash.addOptional(opts.initial_memory);
25852585 man.hash.addOptional(opts.max_memory);
25862586 man.hash.addOptional(opts.global_base);
2587 man.hash.addListOfBytes(opts.export_symbol_names);
25872588
25882589 // Mach-O specific stuff
25892590 try link.File.MachO.hashAddFrameworks(man, opts.frameworks);
src/link/Wasm.zig+2-8
......@@ -3535,11 +3535,8 @@ fn linkWithZld(wasm: *Wasm, arena: Allocator, prog_node: *std.Progress.Node) lin
35353535 man.hash.addOptional(wasm.initial_memory);
35363536 man.hash.addOptional(wasm.max_memory);
35373537 man.hash.addOptional(wasm.global_base);
3538 man.hash.add(wasm.export_symbol_names.len);
3538 man.hash.addListOfBytes(wasm.export_symbol_names);
35393539 // strip does not need to go into the linker hash because it is part of the hash namespace
3540 for (wasm.export_symbol_names) |symbol_name| {
3541 man.hash.addBytes(symbol_name);
3542 }
35433540
35443541 // We don't actually care whether it's a cache hit or miss; we just need the digest and the lock.
35453542 _ = try man.hit();
......@@ -4605,11 +4602,8 @@ fn linkWithLLD(wasm: *Wasm, arena: Allocator, prog_node: *std.Progress.Node) !vo
46054602 man.hash.addOptional(wasm.max_memory);
46064603 man.hash.add(shared_memory);
46074604 man.hash.addOptional(wasm.global_base);
4608 man.hash.add(wasm.export_symbol_names.len);
4605 man.hash.addListOfBytes(wasm.export_symbol_names);
46094606 // strip does not need to go into the linker hash because it is part of the hash namespace
4610 for (wasm.export_symbol_names) |symbol_name| {
4611 man.hash.addBytes(symbol_name);
4612 }
46134607
46144608 // We don't actually care whether it's a cache hit or miss; we just need the digest and the lock.
46154609 _ = try man.hit();