Skip to content

Commit

Permalink
Fix apelink reproducible deterministic build bug
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jart committed Sep 6, 2024
1 parent 1e9902a commit 41fc76c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tool/build/apelink.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,8 @@ static void LoadSymbols(Elf64_Ehdr *e, Elf64_Off size, const char *path) {
struct SymbolTable *st = OpenSymbolTable(path);
if (!st)
Die(path, "could not load elf symbol table");
st->names = 0; // make this deterministic
st->name_base = 0; // ready for serialization
size_t data_size;
void *data = Deflate(st, st->size, &data_size);
uint32_t crc = crc32_z(0, st, st->size);
Expand Down

0 comments on commit 41fc76c

Please sign in to comment.