[lld] [LLD][COFF] Add ignored linker flags (PR #150815)
    via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sat Jul 26 21:14:58 PDT 2025
    
    
  
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lld-coff
Author: None (kkent030315)
<details>
<summary>Changes</summary>
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
```
---
Full diff: https://github.com/llvm/llvm-project/pull/150815.diff
1 Files Affected:
- (modified) lld/COFF/Options.td (+12) 
``````````diff
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">;
``````````
</details>
https://github.com/llvm/llvm-project/pull/150815
    
    
More information about the llvm-commits
mailing list