summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2023-12-22 07:32:19 +0200
committerKhem Raj <raj.khem@gmail.com>2023-12-29 08:51:23 -0800
commit25828e9b595a190e0a87e165092dd8ec84f0d3cf (patch)
tree3f4dbdf29af8b8a35886d0fb3eb07247e132fb1c
parent497f2983d0305d7d6b80a0b1260232c186cf136b (diff)
downloadmeta-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-config38
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"
18fi 18fi
19 19
20if [[ $1 == "--libs" ]]; then 20remain=""
21 exec "$NEXT_LLVM_CONFIG" $@ 21output=""
22fi
23
24if [[ $1 == "--bindir" ]]; then
25 unset YOCTO_ALTERNATE_EXE_PATH
26 exec "$NEXT_LLVM_CONFIG" $@
27fi
28
29if [[ $1 == "--libfiles" ]]; then
30 exec "$NEXT_LLVM_CONFIG" $@
31fi
32
33
34for arg in "$@"; do 22for 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
52done 46done
47
48if [ "${remain}" != "" ]; then
49 output="${output} "$("$NEXT_LLVM_CONFIG" ${remain})
50fi
51
52echo "${output}"