[lld] 3e42146 - [LLD][COFF] Add ignored linker flags (#150815)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 29 02:07:17 PDT 2025
Author: kkent030315
Date: 2025-07-29T12:07:14+03:00
New Revision: 3e42146fbce5362c94f5dd854779e5bbc8630dce
URL: https://github.com/llvm/llvm-project/commit/3e42146fbce5362c94f5dd854779e5bbc8630dce
DIFF: https://github.com/llvm/llvm-project/commit/3e42146fbce5362c94f5dd854779e5bbc8630dce.diff
LOG: [LLD][COFF] Add ignored linker flags (#150815)
These flags were treated as explicit errors, which could cause
compatibility issues with MS link.exe. To address this, LLD was updated
to ignore them, aligning its behavior with MS link.exe. 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.
- Added `/emittoolversioninfo[:no]` flag in LLD/COFF options
- This flag emits a rich header between DOS stub and PE header. LLVM
does not emit the rich header at all.
- Added `/novcfeature` flag in LLD/COFF options
- Added `/nocoffgrpinfo` flag in LLD/COFF options
Added:
Modified:
lld/COFF/Options.td
Removed:
################################################################################
diff --git a/lld/COFF/Options.td b/lld/COFF/Options.td
index 2a82fb5cd8845..0d66b49a4fdb8 100644
--- a/lld/COFF/Options.td
+++ b/lld/COFF/Options.td
@@ -353,7 +353,13 @@ def fastfail : F<"fastfail">;
def kernel : F<"kernel">;
def pdbcompress : F<"pdbcompress">;
def emitpogophaseinfo : F<"emitpogophaseinfo">;
+defm emittoolversioninfo: B<
+ "emittoolversioninfo",
+ "Emit a tool version info after DOS header (so-called Rich header, default)",
+ "Do not emit a tool version info after DOS header (so-called Rich header)">;
+def nocoffgrpinfo: F<"nocoffgrpinfo">;
def noexp : F<"noexp">;
+def novcfeature: F<"novcfeature">;
def delay : P_priv<"delay">;
def errorreport : P_priv<"errorreport">;
More information about the llvm-commits
mailing list