[PATCH] D92736: [lld/mac] Use xxhash instead of MD5 for computing the UUID

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 8 06:07:28 PST 2020


thakis added a comment.

>> Is stripped builds and non-stripped builds having the same UUID something that's useful in practice? I would've expected that everyone builds a debug binary with symbols, and then strips it after building. What's the use case for links with and without debug info and wanting the same UUID?
>
> We have cases where the ELF build ID changes on us for binaries when we have stripped debug info. Debuggers really want to match a stripped binary to a non stripped binary.

This is where I don't follow. My mental model is:

1. Build with symbols, upload that binary to some symbol server
2. Run `strip`
3. Ship the stripped binary to production (users, data centers, whatever)

`strip` doesn't change the UUID, it leaves it in place unchanged (...right?). So stripped and non-stripped binary always have a matching UUID in this case. Having a strip-invariant hash algorithm matters if you do something like:

1. Build with symbols, upload that binary to some symbol server
2. Independently build the same binary at the same revision, but without symbols
3. Ship the binary from 2 to production

In that case, if you want the binaries in 1 and 2 to have the same UUID you do need a hashing algorithm like the one you describe. Is the second workflow what you're doing? Or is there something else I'm missing?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92736/new/

https://reviews.llvm.org/D92736



More information about the llvm-commits mailing list