Skip to content

Commit 02ae26b

Browse files
Prabhukclingfei
authored andcommitted
[UEFI] Add driver path to program paths list (llvm#162387)
UEFI toolchain driver implementation does not set the path where tools such as lld-link can be found. This patch fixes that.
1 parent f1d9874 commit 02ae26b

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

clang/lib/Driver/ToolChains/UEFI.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ using namespace clang;
2424
using namespace llvm::opt;
2525

2626
UEFI::UEFI(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
27-
: ToolChain(D, Triple, Args) {}
27+
: ToolChain(D, Triple, Args) {
28+
getProgramPaths().push_back(getDriver().Dir);
29+
}
2830

2931
Tool *UEFI::buildLinker() const { return new tools::uefi::Linker(*this); }
3032

clang/test/Driver/fuse-ld.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,8 @@
101101
// RUN: | FileCheck %s --check-prefix CHECK-WINDOWS-MSVC-BFD
102102
// CHECK-WINDOWS-MSVC-BFD: "{{.*}}ld.bfd"
103103
// CHECK-WINDOWS-MSVC-BFD-SAME: "-o"
104+
105+
// RUN: %clang %s -### -fuse-ld=lld \
106+
// RUN: --target=x86_64-unknown-uefi 2>&1 \
107+
// RUN: | FileCheck %s --check-prefix CHECK-UEFI-LLD-LINK
108+
// CHECK-UEFI-LLD-LINK: "{{.*}}lld-link

clang/test/Driver/uefi-constructed-args.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@
1212
// CHECK-SAME: "/entry:EfiMain"
1313
// CHECK-SAME: "/tsaware:no"
1414
// CHECK-SAME: "/debug"
15+
16+
// RUN: %clang -### --target=x86_64-unknown-uefi -print-search-dirs 2>&1 \
17+
// RUN: | FileCheck -check-prefixes=PROGPATH %s
18+
// PROGPATH: InstalledDir: [[DRIVER_INSTALLED_DIR:.*]]
19+
// PROGPATH: programs: =[[DRIVER_INSTALLED_DIR]]

0 commit comments

Comments
 (0)