[llvm] [llvm] Linker flags for UEFI (PR #137878)

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 29 15:16:34 PDT 2025


================
@@ -215,15 +215,15 @@ void llvm::emitLinkerFlagsForGlobalCOFF(raw_ostream &OS, const GlobalValue *GV,
                                         const Triple &TT, Mangler &Mangler) {
   if (GV->hasDLLExportStorageClass() && !GV->isDeclaration()) {
 
-    if (TT.isWindowsMSVCEnvironment())
+    if (TT.isWindowsMSVCEnvironment() || TT.isUEFI())
       OS << " /EXPORT:";
     else
       OS << " -export:";
 
     bool NeedQuotes = GV->hasName() && !canBeUnquotedInDirective(GV->getName());
     if (NeedQuotes)
       OS << "\"";
-    if (TT.isWindowsGNUEnvironment() || TT.isWindowsCygwinEnvironment()) {
+    if (TT.isWindowsGNUEnvironment() || TT.isWindowsCygwinEnvironment() || TT.isUEFI()) {
----------------
petrhosek wrote:

Are you sure this is correct? `TT.isWindowsGNUEnvironment` is MSYS and `TT.isWindowsCygwinEnvironment()` is Cygwin, UEFI is neither of those.

https://github.com/llvm/llvm-project/pull/137878


More information about the llvm-commits mailing list