From 25828e9b595a190e0a87e165092dd8ec84f0d3cf Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Fri, 22 Dec 2023 07:32:19 +0200 Subject: 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 --- recipes-devtools/clang/clang/llvm-config | 38 ++++++++++++++++---------------- 1 file 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 exec "$NEXT_LLVM_CONFIG" fi -if [[ $1 == "--libs" ]]; then - exec "$NEXT_LLVM_CONFIG" $@ -fi - -if [[ $1 == "--bindir" ]]; then - unset YOCTO_ALTERNATE_EXE_PATH - exec "$NEXT_LLVM_CONFIG" $@ -fi - -if [[ $1 == "--libfiles" ]]; then - exec "$NEXT_LLVM_CONFIG" $@ -fi - - +remain="" +output="" for arg in "$@"; do case "$arg" in --cppflags) - echo $CPPFLAGS + output="${output} ${CPPFLAGS}" ;; --cflags) - echo $CFLAGS + output="${output} ${CFLAGS}" ;; --cxxflags) - echo $CXXFLAGS + output="${output} ${CXXFLAGS}" ;; --ldflags) - echo $LDFLAGS + output="${output} ${LDFLAGS}" + ;; + --shared-mode) + output="${output} shared" + ;; + --link-shared) + break ;; *) - echo "$("$NEXT_LLVM_CONFIG" "$arg")" + remain="${remain} ${arg}" ;; esac done + +if [ "${remain}" != "" ]; then + output="${output} "$("$NEXT_LLVM_CONFIG" ${remain}) +fi + +echo "${output}" -- cgit v1.2.3-54-g00ecf