[clang] [Driver] Make use of AddFilePathLibArgs() on NetBSD. (PR #71371)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 6 01:43:04 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-driver
@llvm/pr-subscribers-clang
Author: Brad Smith (brad0)
<details>
<summary>Changes</summary>
This will help using lld or mold as a linker.
---
Full diff: https://github.com/llvm/llvm-project/pull/71371.diff
2 Files Affected:
- (modified) clang/lib/Driver/ToolChains/NetBSD.cpp (+1)
- (modified) clang/test/Driver/netbsd.c (+5)
``````````diff
diff --git a/clang/lib/Driver/ToolChains/NetBSD.cpp b/clang/lib/Driver/ToolChains/NetBSD.cpp
index cfde8d40a77ae16..90b195a007caa78 100644
--- a/clang/lib/Driver/ToolChains/NetBSD.cpp
+++ b/clang/lib/Driver/ToolChains/NetBSD.cpp
@@ -269,6 +269,7 @@ void netbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
Args.addAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group,
options::OPT_s, options::OPT_t, options::OPT_r});
+ ToolChain.AddFilePathLibArgs(Args, CmdArgs);
bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
diff --git a/clang/test/Driver/netbsd.c b/clang/test/Driver/netbsd.c
index 760cba4ac4e0c9f..f900205501ee455 100644
--- a/clang/test/Driver/netbsd.c
+++ b/clang/test/Driver/netbsd.c
@@ -461,3 +461,8 @@
// DRIVER-PASS-INCLUDES: "-cc1" {{.*}}"-resource-dir" "[[RESOURCE:[^"]+]]"
// DRIVER-PASS-INCLUDES-SAME: "-internal-isystem" "[[RESOURCE]]{{/|\\\\}}include"
// DRIVER-PASS-INCLUDES-SAME: {{^}} "-internal-externc-isystem" "{{.*}}/usr/include"
+
+// Check that the driver passes the system library path.
+// RUN: %clang -### %s --target=x86_64-unknown-netbsd 2>&1 \
+// RUN: | FileCheck %s --check-prefix=DRIVER-PASS-LIB-PATH
+// DRIVER-PASS-LIB-PATH: "-L/usr/lib"
``````````
</details>
https://github.com/llvm/llvm-project/pull/71371
More information about the cfe-commits
mailing list