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(...@@ -2584,6 +2584,7 @@ fn addNonIncrementalStuffToCacheManifest(
2584 man.hash.addOptional(opts.initial_memory);2584 man.hash.addOptional(opts.initial_memory);
2585 man.hash.addOptional(opts.max_memory);2585 man.hash.addOptional(opts.max_memory);
2586 man.hash.addOptional(opts.global_base);2586 man.hash.addOptional(opts.global_base);
2587 man.hash.addListOfBytes(opts.export_symbol_names);
25872588
2588 // Mach-O specific stuff2589 // Mach-O specific stuff
2589 try link.File.MachO.hashAddFrameworks(man, opts.frameworks);2590 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...@@ -3535,11 +3535,8 @@ fn linkWithZld(wasm: *Wasm, arena: Allocator, prog_node: *std.Progress.Node) lin
3535 man.hash.addOptional(wasm.initial_memory);3535 man.hash.addOptional(wasm.initial_memory);
3536 man.hash.addOptional(wasm.max_memory);3536 man.hash.addOptional(wasm.max_memory);
3537 man.hash.addOptional(wasm.global_base);3537 man.hash.addOptional(wasm.global_base);
3538 man.hash.add(wasm.export_symbol_names.len);3538 man.hash.addListOfBytes(wasm.export_symbol_names);
3539 // strip does not need to go into the linker hash because it is part of the hash namespace3539 // 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
3544 // We don't actually care whether it's a cache hit or miss; we just need the digest and the lock.3541 // We don't actually care whether it's a cache hit or miss; we just need the digest and the lock.
3545 _ = try man.hit();3542 _ = try man.hit();
...@@ -4605,11 +4602,8 @@ fn linkWithLLD(wasm: *Wasm, arena: Allocator, prog_node: *std.Progress.Node) !vo...@@ -4605,11 +4602,8 @@ fn linkWithLLD(wasm: *Wasm, arena: Allocator, prog_node: *std.Progress.Node) !vo
4605 man.hash.addOptional(wasm.max_memory);4602 man.hash.addOptional(wasm.max_memory);
4606 man.hash.add(shared_memory);4603 man.hash.add(shared_memory);
4607 man.hash.addOptional(wasm.global_base);4604 man.hash.addOptional(wasm.global_base);
4608 man.hash.add(wasm.export_symbol_names.len);4605 man.hash.addListOfBytes(wasm.export_symbol_names);
4609 // strip does not need to go into the linker hash because it is part of the hash namespace4606 // 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
4614 // We don't actually care whether it's a cache hit or miss; we just need the digest and the lock.4608 // We don't actually care whether it's a cache hit or miss; we just need the digest and the lock.
4615 _ = try man.hit();4609 _ = try man.hit();