[PATCH] D92537: [lld-macho] Implement -object_path_lto

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 15:43:35 PST 2020


clayborg added a comment.

In D92537#2443306 <https://reviews.llvm.org/D92537#2443306>, @thakis wrote:

> FWIW we're very interested in having deterministic build outputs (in the senses of https://blog.llvm.org/2019/11/deterministic-builds-with-clang-and-lld.html), and putting file mtimes in the linker output defeats that. Could we put content hashes in the mtime instead? (We could make the compiler produce a content hash of its .o output at compile time so that we could just read the content off out the .o file instead of computing it if computing it is a perf issue.)

We can't change the value of the N_OSO symbol without a change to LLDB and GDB. The debuggers really want to have this timestamp because someone can recompile a .o file and then try to debug a program that refers to this .o file which now has completely different contents. If we use a hash, then each time you debug, the debugger must fully hash each .o file to figure out if the hash matches which we really do not want to do as that will force it to touch every page in each .o file each time you debug and that will kill performance.

If we can come up with a solution that doesn't adversely affect performance, the N_OSO currently must have the "n_desc" field of each symbol set to 1. We could set this to 2 and know that the value in the symbol would be different. But that again requires an update to the debugger and anyone else that tries to load a binary with this change into an older debugger will get no debug info with no explanation of what is going wrong.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92537



More information about the llvm-commits mailing list