diff options
| author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-11-14 20:00:56 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-01 19:35:11 +0000 |
| commit | 8f41af0ee94e87b673aa75ee2ecb7cf5a43b0d3d (patch) | |
| tree | 1a8564bad404eed7bd83fed77d555290ad457102 /meta/recipes-devtools | |
| parent | bdfff3b14ecc29da760220e5c57aed5627b283b1 (diff) | |
| download | poky-8f41af0ee94e87b673aa75ee2ecb7cf5a43b0d3d.tar.gz | |
mesa: do not rely on native llvm-config in target sysroot
Sadly the magic is not perfect: llvm-config contains a hardcoded
value for the libdir from the native configuration, and things will
break if the target build installs libraries somewhere else (e.g. lib64).
llvm-config in target bindir also needs a rpath adjustment,
otherwise it simply won't even run when e.g. building for arm on x86.
To avoid patching llvm-source let's simply add more cases to the
llvm-config wrapper script, so that falling through to llvm-config binary
is avoided. Fortunately those cases are all static in what they return,
even though llvm-config binary does poke around the file tree to arrive
at them (which is where breakage happens if native and target don't match
exactly wrt libdir).
I verified that this works by building mesa with llvm enabled for
qemuarm64 and with baselib set to 'lib64' - so that both the target
architecture and target libdir differ from native ones.
Upstream tickets:
https://github.com/llvm/llvm-project/issues/58984
https://github.com/mesonbuild/meson/issues/11043
(From OE-Core rev: d2860e67a37623b17fc9c6e1192f06a63b7d52ff)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 056431883e94296b767a479d029b914392e4fd7c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
| -rw-r--r-- | meta/recipes-devtools/llvm/llvm/llvm-config | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/meta/recipes-devtools/llvm/llvm/llvm-config b/meta/recipes-devtools/llvm/llvm/llvm-config index a45f38c650..5e4ded2da5 100644 --- a/meta/recipes-devtools/llvm/llvm/llvm-config +++ b/meta/recipes-devtools/llvm/llvm/llvm-config | |||
| @@ -29,6 +29,15 @@ for arg in "$@"; do | |||
| 29 | --ldflags) | 29 | --ldflags) |
| 30 | output="${output} ${LDFLAGS}" | 30 | output="${output} ${LDFLAGS}" |
| 31 | ;; | 31 | ;; |
| 32 | --shared-mode) | ||
| 33 | output="${output} shared" | ||
| 34 | ;; | ||
| 35 | --libs) | ||
| 36 | output="${output} -lLLVM" | ||
| 37 | ;; | ||
| 38 | --link-shared) | ||
| 39 | break | ||
| 40 | ;; | ||
| 32 | *) | 41 | *) |
| 33 | remain="${remain} ${arg}" | 42 | remain="${remain} ${arg}" |
| 34 | ;; | 43 | ;; |
