diff options
author | Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> | 2025-04-10 05:54:45 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-04-11 11:44:22 +0100 |
commit | d41b5391ab43609d47041e9b2f4e03a131383e19 (patch) | |
tree | 22fc9b97f14270aad55ae3196df143277fa5a983 | |
parent | 2ecf7ab4694edb0bdb60b3d2059ff3e3416cddc5 (diff) | |
download | poky-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.patch | 34 | ||||
-rw-r--r-- | meta/recipes-devtools/llvm/llvm_20.1.2.bb | 2 |
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 @@ | |||
1 | From caff2482f786dd7fd5f1f46f2667f7ed847cb8f8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> | ||
3 | Date: Wed, 2 Apr 2025 17:05:17 +0300 | ||
4 | Subject: [PATCH] llvm-config: remove LLVM_LDFLAGS from --ldflags output | ||
5 | |||
6 | On native OE builds the LLVM_LDFLAGS gets a lot of extra flags which may | ||
7 | depend on exact build dir and as such be inappropriate to binaries | ||
8 | shared through sstate-cache. It is not possible to override this | ||
9 | behaviour in llvm-config since crossscripts are not being used for | ||
10 | native builds. As a OE-specific modification ignore LLVM_LDFLAGS for | ||
11 | native builds. | ||
12 | |||
13 | Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> | ||
14 | Upstream-Status: Inappropriate [OE-Specific] | ||
15 | --- | ||
16 | llvm/tools/llvm-config/llvm-config.cpp | 2 +- | ||
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp | ||
20 | index 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 | -- | ||
33 | 2.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 | |||
32 | UPSTREAM_CHECK_URI = "https://github.com/llvm/llvm-project" | 32 | UPSTREAM_CHECK_URI = "https://github.com/llvm/llvm-project" |
33 | UPSTREAM_CHECK_REGEX = "llvmorg-(?P<pver>\d+(\.\d+)+)" | 33 | UPSTREAM_CHECK_REGEX = "llvmorg-(?P<pver>\d+(\.\d+)+)" |
34 | 34 | ||
35 | SRC_URI:append:class-native = " file://0001-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch" | ||
36 | |||
35 | S = "${WORKDIR}/llvm-project-${PV}.src" | 37 | S = "${WORKDIR}/llvm-project-${PV}.src" |
36 | 38 | ||
37 | OECMAKE_SOURCEPATH = "${S}/llvm" | 39 | OECMAKE_SOURCEPATH = "${S}/llvm" |