[llvm-branch-commits] [clang] 7e666e9 - [clang][hexagon] Handle library path arguments earlier
Tobias Hieta via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Aug 8 23:59:27 PDT 2023
Author: Brian Cain
Date: 2023-08-09T08:56:40+02:00
New Revision: 7e666e9d605f589b149b5086d2fbd51b94a8be73
URL: https://github.com/llvm/llvm-project/commit/7e666e9d605f589b149b5086d2fbd51b94a8be73
DIFF: https://github.com/llvm/llvm-project/commit/7e666e9d605f589b149b5086d2fbd51b94a8be73.diff
LOG: [clang][hexagon] Handle library path arguments earlier
The removal of the early return in 96832a6bf7e0e7f1e8d634d38c44a1b32d512923
was an error: it would include the 'standalone' library that's not used
by linux.
Instead we reproduce the library path handling in the linux/musl block.
Differential Revision: https://reviews.llvm.org/D156771
(cherry picked from commit 5bc4b34a3aa9c6ea10663a252ac46d20862b38d5)
Added:
Modified:
clang/lib/Driver/ToolChains/Hexagon.cpp
clang/test/Driver/hexagon-toolchain-linux.c
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Hexagon.cpp b/clang/lib/Driver/ToolChains/Hexagon.cpp
index dab7382532520a..aed4ab1955b4f3 100644
--- a/clang/lib/Driver/ToolChains/Hexagon.cpp
+++ b/clang/lib/Driver/ToolChains/Hexagon.cpp
@@ -383,6 +383,11 @@ constructHexagonLinkArgs(Compilation &C, const JobAction &JA,
if (HTC.ShouldLinkCXXStdlib(Args))
HTC.AddCXXStdlibLibArgs(Args, CmdArgs);
}
+ const ToolChain::path_list &LibPaths = HTC.getFilePaths();
+ for (const auto &LibPath : LibPaths)
+ CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + LibPath));
+ Args.ClaimAllArgs(options::OPT_L);
+ return;
}
//----------------------------------------------------------------------------
diff --git a/clang/test/Driver/hexagon-toolchain-linux.c b/clang/test/Driver/hexagon-toolchain-linux.c
index 61a5581b009c23..423306affdce3a 100644
--- a/clang/test/Driver/hexagon-toolchain-linux.c
+++ b/clang/test/Driver/hexagon-toolchain-linux.c
@@ -120,8 +120,12 @@
// CHECK009-SAME: {{^}} "-internal-isystem" "[[RESOURCE]]/include"
// CHECK009-SAME: {{^}} "-internal-externc-isystem" "[[INSTALLED_DIR]]/../target/hexagon/include"
-// RUN: %clang -fdriver-only -Werror -v -L/tmp \
-// RUN: --target=hexagon-unknown-linux-musl %s 2>&1 \
+// RUN: %clang -Werror -L/tmp \
+// RUN: --target=hexagon-unknown-linux-musl %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK010 %s
// CHECK010: InstalledDir: [[INSTALLED_DIR:.+]]
+// CHECK010-NOT: "-lstandalone"
+// CHECK010-NOT: crt0_standalone.o
+// CHECK010: crt1.o
// CHECK010: "-L/tmp"
+// CHECK010-NOT: "-lstandalone"
More information about the llvm-branch-commits
mailing list