[clang] [llvm] Introduce -funique-source-file-names flag. (PR #135728)
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 15 10:54:11 PDT 2025
pcc wrote:
> Could that be addressed by only allowing this flag under LTO?
`-fsanitize=address -flto=thin` would have the same issue (if there is indeed an issue, which I think there probably isn't).
> Probably at least add a note to the new documentation for the option that it will result in linker errors if used inappropriately.
Added.
> I was mostly thinking that detecting and erroring at LTO time would result in a clearer error (like at the start of LTO::addModule, where it is looking for partially split LTO units, which we do by adding the module flag to the index flags).
I don't think it would be detected at that point. The duplicate symbol error would be detected by the linker when it adds the bitcode file to its symbol table and likely cause it to error out before calling LTO::addModule which is only called once the resolutions are known. So if we wanted a better error message it would need to be added to each linker.
https://github.com/llvm/llvm-project/pull/135728
More information about the llvm-commits
mailing list