[lld] [LLD] [MinGW] Sync --thinlto-cache-dir option details with ELF (PR #77010)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 13:40:50 PST 2024


https://github.com/mstorsjo created https://github.com/llvm/llvm-project/pull/77010

Disallow using the form with a separate argument,
"--thinlto-cache-dir dir", allow only the one with equals, "--thintlo-cache-dir=dir". This is the only form that actually was tested when this was added in
f794808bb9ec06966a67fe33d41a13b9601768f8, and matches the ELF side, where only the form with an equals is supported (and this was also the case at the time when this option was added to the MinGW linker).

>From 19785c8a84b2f3d6d6ca16dc9fdcd4b1d8c31e17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
Date: Thu, 4 Jan 2024 15:45:32 +0200
Subject: [PATCH] [LLD] [MinGW] Sync --thinlto-cache-dir option details with
 ELF

Disallow using the form with a separate argument,
"--thinlto-cache-dir dir", allow only the one with equals,
"--thintlo-cache-dir=dir". This is the only form that actually
was tested when this was added in
f794808bb9ec06966a67fe33d41a13b9601768f8, and matches the ELF
side, where only the form with an equals is supported (and this
was also the case at the time when this option was added to the
MinGW linker).
---
 lld/MinGW/Options.td | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td
index d4a49cdbd53593..d8471d5a7bc9ed 100644
--- a/lld/MinGW/Options.td
+++ b/lld/MinGW/Options.td
@@ -186,8 +186,8 @@ def appcontainer: F<"appcontainer">, HelpText<"Set the appcontainer flag in the
 defm delayload: Eq<"delayload", "DLL to load only on demand">;
 defm mllvm: EqNoHelp<"mllvm">;
 defm pdb: Eq<"pdb", "Output PDB debug info file, chosen implicitly if the argument is empty">;
-defm thinlto_cache_dir: EqLong<"thinlto-cache-dir",
-  "Path to ThinLTO cached object file directory">;
+def thinlto_cache_dir: JJ<"thinlto-cache-dir=">,
+  HelpText<"Path to ThinLTO cached object file directory">;
 defm Xlink : Eq<"Xlink", "Pass <arg> to the COFF linker">, MetaVarName<"<arg>">;
 defm guard_cf : B<"guard-cf", "Enable Control Flow Guard" ,
   "Do not enable Control Flow Guard (default)">;



More information about the llvm-commits mailing list