Skip to content

Commit 41fc76c

Browse files
committed
Fix apelink reproducible deterministic build bug
Thank you @dinosaure for reporting this issue and doing all the analysis that made this simple and easy to fix. Be sure to check out his projects like: https://github.com/dinosaure/esperanto, which lets you build OCaml programs as Actually Portable Executables using cosmocc. See #1265
1 parent 1e9902a commit 41fc76c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tool/build/apelink.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,8 @@ static void LoadSymbols(Elf64_Ehdr *e, Elf64_Off size, const char *path) {
679679
struct SymbolTable *st = OpenSymbolTable(path);
680680
if (!st)
681681
Die(path, "could not load elf symbol table");
682+
st->names = 0; // make this deterministic
683+
st->name_base = 0; // ready for serialization
682684
size_t data_size;
683685
void *data = Deflate(st, st->size, &data_size);
684686
uint32_t crc = crc32_z(0, st, st->size);

0 commit comments

Comments
 (0)