[lld] [LLD][COFF] Add ignored linker flags (PR #150815)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 29 02:06:54 PDT 2025
mstorsjo wrote:
> > We'd have this:
> > > The latter two options affect how MS link.exe generates metadata for its PGO. LLD doesn't generate any such metadata right now (and doesn't work with the MSVC PGO feature), so those options are kept as no-ops.
>
> Updated. Thanks for the better one!
>
> > Then also on another hand; the latter two options are undocumented, right? So there's quite little risk of them being used much in the wild at all (contrary to the first one which is totally understandable to handle).
>
> Well, there are many projects uses those flags (e.g., UEFI binaries) and I experienced the odd. For example, if I had this cmake setup, it is no way compatible with MSVC toolchain (`link.exe`) and Clang toolchain (`lld-link.exe`). This is solvable by putting `if` statement to those options but that makes the cmake config redundant. It'd be better we just ignore those :)
>
> ```cmake
> target_link_options(foo PRIVATE
> # Decrease the binary size
> /EMITTOOLVERSIONINFO:NO
> /EMITPOGOPHASEINFO
> /NOVCFEATURE
> /NOCOFFGRPINFO
> )
> ```
Ok, fair enough. Thanks! Then I think this one looks good.
https://github.com/llvm/llvm-project/pull/150815
More information about the llvm-commits
mailing list