[clang] [NFC][clang] No sharedlibs for UEFI (PR #137872)

Prabhu Rajasekaran via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 29 13:23:14 PDT 2025


https://github.com/Prabhuk created https://github.com/llvm/llvm-project/pull/137872

There is no support for shared libraries for UEFI target. Remove the
incorrect -dll flag set from UEFI toolchain.


>From 60473fc01469167d742cee1fcdc1b05b93482f94 Mon Sep 17 00:00:00 2001
From: prabhukr <prabhukr at google.com>
Date: Tue, 29 Apr 2025 13:21:16 -0700
Subject: [PATCH] [NFC][clang] No sharedlibs for UEFI

There is no support for shared libraries for UEFI target. Remove the
incorrect -dll flag set from UEFI toolchain.
---
 clang/lib/Driver/ToolChains/UEFI.cpp      | 3 ---
 clang/test/Driver/uefi-constructed-args.c | 1 -
 2 files changed, 4 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/UEFI.cpp b/clang/lib/Driver/ToolChains/UEFI.cpp
index a9d7e7892c5a6..fbef72e34a3b1 100644
--- a/clang/lib/Driver/ToolChains/UEFI.cpp
+++ b/clang/lib/Driver/ToolChains/UEFI.cpp
@@ -80,9 +80,6 @@ void tools::uefi::Linker::ConstructJob(Compilation &C, const JobAction &JA,
   // "Terminal Service Aware" flag is not needed for UEFI applications.
   CmdArgs.push_back("-tsaware:no");
 
-  // EFI_APPLICATION to be linked as DLL by default.
-  CmdArgs.push_back("-dll");
-
   if (Args.hasArg(options::OPT_g_Group, options::OPT__SLASH_Z7))
     CmdArgs.push_back("-debug");
 
diff --git a/clang/test/Driver/uefi-constructed-args.c b/clang/test/Driver/uefi-constructed-args.c
index 44d2271e0c8ba..49ede47a8953e 100644
--- a/clang/test/Driver/uefi-constructed-args.c
+++ b/clang/test/Driver/uefi-constructed-args.c
@@ -11,5 +11,4 @@
 // CHECK-SAME: "-subsystem:efi_application"
 // CHECK-SAME: "-entry:EfiMain"
 // CHECK-SAME: "-tsaware:no"
-// CHECK-SAME: "-dll"
 // CHECK-SAME: "-debug"



More information about the cfe-commits mailing list