[lld] [LLD][COFF] Add ignored linker flags (PR #150815)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 26 21:14:28 PDT 2025


https://github.com/kkent030315 created https://github.com/llvm/llvm-project/pull/150815

Added LLD flags to be ignored to align with MS link.exe.

- Added `/emittoolversioninfo[:no]` flag in LLD/COFF options
- Added `/novcfeature` flag in LLD/COFF options
- Added `/nocoffgrpinfo` flag in LLD/COFF options

Since LLVM does not implement POGO (Profile-guided Optimization, also known as "PGO"), this is completely ignorable without being problematic. Some of the flags are well described in [this blog](https://winternl.com/why-is-there-a-debug-directory-in-my-release-build/).

### Example of the error

LLD(lld-link.exe): 19.1.5

```
1>lld-link : error : could not open '/EMITTOOLVERSIONINFO:NO': no such file or directory
1>lld-link : error : could not open '/NOVCFEATURE': no such file or directory
1>lld-link : error : could not open '/NOCOFFGRPINFO': no such file or directory
```

>From e2b8233cd5ea9d0710f549a6e7e912ade347b072 Mon Sep 17 00:00:00 2001
From: kkent030315 <hrn832 at protonmail.com>
Date: Sun, 27 Jul 2025 13:02:01 +0900
Subject: [PATCH] [LLD][COFF] Add ignored linker flags

---
 lld/COFF/Options.td | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lld/COFF/Options.td b/lld/COFF/Options.td
index 2a82fb5cd8845..bde1f5f950b4b 100644
--- a/lld/COFF/Options.td
+++ b/lld/COFF/Options.td
@@ -353,6 +353,18 @@ def fastfail : F<"fastfail">;
 def kernel : F<"kernel">;
 def pdbcompress : F<"pdbcompress">;
 def emitpogophaseinfo : F<"emitpogophaseinfo">;
+def 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-scalled Ricb header)">;
+def novcfeature: B<
+    "novcfeature",
+    "Embeds tool version info in debug directory (default)",
+    "Do not embed tool version info in debug directory">;
+def nocoffgrpinfo: B<
+    "nocoffgrpinfo",
+    "Embeds COFFGRP info in debug directory (default)",
+    "Do not dmbeds COFFGRP info in debug directory">;
 def noexp : F<"noexp">;
 
 def delay : P_priv<"delay">;



More information about the llvm-commits mailing list