diff options
author | Dmitry Baryshkov <dmitry.baryshkov@linaro.org> | 2023-12-22 07:32:19 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-12-29 08:51:23 -0800 |
commit | 25828e9b595a190e0a87e165092dd8ec84f0d3cf (patch) | |
tree | 3f4dbdf29af8b8a35886d0fb3eb07247e132fb1c | |
parent | 497f2983d0305d7d6b80a0b1260232c186cf136b (diff) | |
download | meta-clang-25828e9b595a190e0a87e165092dd8ec84f0d3cf.tar.gz |
llvm-config: update following the oe-core script
The Mesa Clover meson.build script passes two options to llvm-config
script, --libs --ldflags. The script from meta-clang passes control to
the native llvm-config script, which unfortunately results in the native
dynamic linker option leaking to the cross build. Fix that by adopting
the approach from OE-core and filter known options before calling into
the native llvm-config.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
-rw-r--r-- | recipes-devtools/clang/clang/llvm-config | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/recipes-devtools/clang/clang/llvm-config b/recipes-devtools/clang/clang/llvm-config index bfdc61a..6a0dd54 100644 --- a/recipes-devtools/clang/clang/llvm-config +++ b/recipes-devtools/clang/clang/llvm-config | |||
@@ -17,36 +17,36 @@ if [[ $# == 0 ]]; then | |||
17 | exec "$NEXT_LLVM_CONFIG" | 17 | exec "$NEXT_LLVM_CONFIG" |
18 | fi | 18 | fi |
19 | 19 | ||
20 | if [[ $1 == "--libs" ]]; then | 20 | remain="" |
21 | exec "$NEXT_LLVM_CONFIG" $@ | 21 | output="" |
22 | fi | ||
23 | |||
24 | if [[ $1 == "--bindir" ]]; then | ||
25 | unset YOCTO_ALTERNATE_EXE_PATH | ||
26 | exec "$NEXT_LLVM_CONFIG" $@ | ||
27 | fi | ||
28 | |||
29 | if [[ $1 == "--libfiles" ]]; then | ||
30 | exec "$NEXT_LLVM_CONFIG" $@ | ||
31 | fi | ||
32 | |||
33 | |||
34 | for arg in "$@"; do | 22 | for arg in "$@"; do |
35 | case "$arg" in | 23 | case "$arg" in |
36 | --cppflags) | 24 | --cppflags) |
37 | echo $CPPFLAGS | 25 | output="${output} ${CPPFLAGS}" |
38 | ;; | 26 | ;; |
39 | --cflags) | 27 | --cflags) |
40 | echo $CFLAGS | 28 | output="${output} ${CFLAGS}" |
41 | ;; | 29 | ;; |
42 | --cxxflags) | 30 | --cxxflags) |
43 | echo $CXXFLAGS | 31 | output="${output} ${CXXFLAGS}" |
44 | ;; | 32 | ;; |
45 | --ldflags) | 33 | --ldflags) |
46 | echo $LDFLAGS | 34 | output="${output} ${LDFLAGS}" |
35 | ;; | ||
36 | --shared-mode) | ||
37 | output="${output} shared" | ||
38 | ;; | ||
39 | --link-shared) | ||
40 | break | ||
47 | ;; | 41 | ;; |
48 | *) | 42 | *) |
49 | echo "$("$NEXT_LLVM_CONFIG" "$arg")" | 43 | remain="${remain} ${arg}" |
50 | ;; | 44 | ;; |
51 | esac | 45 | esac |
52 | done | 46 | done |
47 | |||
48 | if [ "${remain}" != "" ]; then | ||
49 | output="${output} "$("$NEXT_LLVM_CONFIG" ${remain}) | ||
50 | fi | ||
51 | |||
52 | echo "${output}" | ||