[clang] [LinkerWrapper] Add an overriding option for debugging (PR #91984)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Tue May 14 10:48:12 PDT 2024
jhuber6 wrote:
> would it be more useful to allow swapping the output by environment variable and MD5 hash, e.g.
>
> CLANG_LINK_WRAPPER_SWAP_OUTPUT=hash1:file1,hash2:file2
>
> it calculates the MD5 hash of the output file, if matching, swap it with the specified file. This way, we can set an env var to swap any linker wrapper output in a normal build.
I don't think we need an environment variable since the output will always come from the link phase, which you can pass arguments to. While I can see it being more convenient, I don't really see this being used as a legitimate tool for anything but debugging small applications.
Manipulating the hash is an interesting idea, since we can have multiple files it might be nice to only replace one of them. However, this is a pretty big hammer so I'm unsure if we'll need this kind of fine-grained control for what I only intend to use for triaging bugs.
https://github.com/llvm/llvm-project/pull/91984
More information about the cfe-commits
mailing list