[lld] [lld] check the format of libary and skip the wrong one (PR #78874)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 26 18:02:32 PST 2024
W-50243 wrote:
> I think GNU ld supports some "wrong e_machine, skip" logic for `-lfoo` and we have rejected supporting this fishy behavior. We cannot think of a reasonable case this is ever desired. The solution is always to fix the build system to not provide dubious `-L` paths in the first place. For linker scripts, I think GNU ld tries skipping an incompatible script if an incompatible `OUTPUT_FORMAT` is seen. However, a question arises about what we should do if we have parsed something before `OUTPUT_FORMAT`.
I have some questions about that. What I see in the code is that the library is added and then parsed. Will the link script change the behavior of the lld?
https://github.com/llvm/llvm-project/pull/78874
More information about the llvm-commits
mailing list