Skip to content

Commit

Permalink
llvm-config: update following the oe-core script
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
lumag authored and kraj committed Dec 29, 2023
1 parent 497f298 commit 25828e9
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions recipes-devtools/clang/clang/llvm-config
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

0 comments on commit 25828e9

Please sign in to comment.