summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>2025-04-10 05:54:45 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-04-11 11:44:22 +0100
commitd41b5391ab43609d47041e9b2f4e03a131383e19 (patch)
tree22fc9b97f14270aad55ae3196df143277fa5a983
parent2ecf7ab4694edb0bdb60b3d2059ff3e3416cddc5 (diff)
downloadpoky-d41b5391ab43609d47041e9b2f4e03a131383e19.tar.gz
llvm: remove LLVM_LDFLAGS from llvm-config --ldflags output
On native OE builds the LLVM_LDFLAGS gets a lot of extra flags which may depend on exact build dir and as such be inappropriate to binaries shared through sstate-cache. It is not possible to override this behaviour in llvm-config since crossscripts are not being used for native builds. Ignore LLVM_LDFLAGS for native builds. (From OE-Core rev: a93d2bdf5c0cf1c2c08d99fd4ccd8d1aae0e0ba5) Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/llvm/llvm/0001-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch34
-rw-r--r--meta/recipes-devtools/llvm/llvm_20.1.2.bb2
2 files changed, 36 insertions, 0 deletions
diff --git a/meta/recipes-devtools/llvm/llvm/0001-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch b/meta/recipes-devtools/llvm/llvm/0001-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch
new file mode 100644
index 0000000000..2320399d5f
--- /dev/null
+++ b/meta/recipes-devtools/llvm/llvm/0001-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch
@@ -0,0 +1,34 @@
1From caff2482f786dd7fd5f1f46f2667f7ed847cb8f8 Mon Sep 17 00:00:00 2001
2From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
3Date: Wed, 2 Apr 2025 17:05:17 +0300
4Subject: [PATCH] llvm-config: remove LLVM_LDFLAGS from --ldflags output
5
6On native OE builds the LLVM_LDFLAGS gets a lot of extra flags which may
7depend on exact build dir and as such be inappropriate to binaries
8shared through sstate-cache. It is not possible to override this
9behaviour in llvm-config since crossscripts are not being used for
10native builds. As a OE-specific modification ignore LLVM_LDFLAGS for
11native builds.
12
13Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
14Upstream-Status: Inappropriate [OE-Specific]
15---
16 llvm/tools/llvm-config/llvm-config.cpp | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
20index d5b76b1bb6c1..29f7c2eaa419 100644
21--- a/llvm/tools/llvm-config/llvm-config.cpp
22+++ b/llvm/tools/llvm-config/llvm-config.cpp
23@@ -529,7 +529,7 @@ int main(int argc, char **argv) {
24 OS << ActiveIncludeOption << ' ' << LLVM_CXXFLAGS << '\n';
25 } else if (Arg == "--ldflags") {
26 OS << ((HostTriple.isWindowsMSVCEnvironment()) ? "-LIBPATH:" : "-L")
27- << ActiveLibDir << ' ' << LLVM_LDFLAGS << '\n';
28+ << ActiveLibDir << '\n';
29 } else if (Arg == "--system-libs") {
30 PrintSystemLibs = true;
31 } else if (Arg == "--libs") {
32--
332.39.5
34
diff --git a/meta/recipes-devtools/llvm/llvm_20.1.2.bb b/meta/recipes-devtools/llvm/llvm_20.1.2.bb
index 0fb35a4f5b..d996a7c49c 100644
--- a/meta/recipes-devtools/llvm/llvm_20.1.2.bb
+++ b/meta/recipes-devtools/llvm/llvm_20.1.2.bb
@@ -32,6 +32,8 @@ SRC_URI[sha256sum] = "f0a4a240aabc9b056142d14d5478bb6d962aeac549cbd75b809f549924
32UPSTREAM_CHECK_URI = "https://github.com/llvm/llvm-project" 32UPSTREAM_CHECK_URI = "https://github.com/llvm/llvm-project"
33UPSTREAM_CHECK_REGEX = "llvmorg-(?P<pver>\d+(\.\d+)+)" 33UPSTREAM_CHECK_REGEX = "llvmorg-(?P<pver>\d+(\.\d+)+)"
34 34
35SRC_URI:append:class-native = " file://0001-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch"
36
35S = "${WORKDIR}/llvm-project-${PV}.src" 37S = "${WORKDIR}/llvm-project-${PV}.src"
36 38
37OECMAKE_SOURCEPATH = "${S}/llvm" 39OECMAKE_SOURCEPATH = "${S}/llvm"