mirror of
https://git.yoctoproject.org/poky
synced 2026-06-07 03:04:04 +00:00
llvm-tblgen-native: add new recipe
Building the LLVM projects often means using the TableGen tools (llvm-tblgen etc). We currently build them as part of clang-native, but I am teasing the clang recipe into its component parts and having to build llvm-native or lldb-native simply for one tool isn't ideal. Instead, add a native recipe that simply builds the tablegen binaries for llvm, clang, and lldb (From OE-Core rev: fbf63e03fe09ca74022c9d06442b4f1021b71d57) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
728d87c9bd
commit
bd3792a7ad
@@ -480,6 +480,7 @@ RECIPE_MAINTAINER:pn-linux-yocto-dev = "Bruce Ashfield <bruce.ashfield@gmail.com
|
||||
RECIPE_MAINTAINER:pn-linux-yocto-rt = "Bruce Ashfield <bruce.ashfield@gmail.com>"
|
||||
RECIPE_MAINTAINER:pn-linux-yocto-tiny = "Bruce Ashfield <bruce.ashfield@gmail.com>"
|
||||
RECIPE_MAINTAINER:pn-llvm-project-source-20.1.7 = "Khem Raj <raj.khem@gmail.com>"
|
||||
RECIPE_MAINTAINER:pn-llvm-tblgen-native = "Khem Raj <raj.khem@gmail.com>"
|
||||
RECIPE_MAINTAINER:pn-logrotate = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER:pn-log4cplus = "Unassigned <unassigned@yoctoproject.org>"
|
||||
RECIPE_MAINTAINER:pn-lrzsz = "Anuj Mittal <anuj.mittal@intel.com>"
|
||||
|
||||
@@ -207,7 +207,7 @@ EXTRA_OECMAKE:append:class-target = "\
|
||||
-DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \
|
||||
"
|
||||
|
||||
DEPENDS = "binutils zlib zstd libffi libxml2 libxml2-native ninja-native swig-native spirv-tools-native"
|
||||
DEPENDS = "binutils zlib zstd libffi libxml2 libxml2-native ninja-native swig-native spirv-tools-native llvm-tblgen-native"
|
||||
DEPENDS:append:class-nativesdk = " clang-crosssdk-${SDK_SYS} virtual/nativesdk-cross-binutils nativesdk-python3"
|
||||
DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} python3 ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcxx', '', d)} spirv-llvm-translator-native"
|
||||
|
||||
@@ -276,18 +276,16 @@ do_install:append:class-native () {
|
||||
install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clangd-indexer ${D}${bindir}/clangd-indexer
|
||||
fi
|
||||
install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tidy-confusable-chars-gen ${D}${bindir}/clang-tidy-confusable-chars-gen
|
||||
install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tblgen ${D}${bindir}/clang-tblgen
|
||||
install -Dm 0755 ${B}${BINPATHPREFIX}/bin/lldb-tblgen ${D}${bindir}/lldb-tblgen
|
||||
install -Dm 0755 ${B}${BINPATHPREFIX}/bin/llvm-min-tblgen ${D}${bindir}/llvm-min-tblgen
|
||||
install -Dm 0755 ${B}${BINPATHPREFIX}/bin/prepare_builtins ${D}${bindir}/prepare_builtins
|
||||
|
||||
for f in `find ${D}${bindir} -executable -type f -not -type l`; do
|
||||
test -n "`file -b $f|grep -i ELF`" && ${STRIP} $f
|
||||
echo "stripped $f"
|
||||
done
|
||||
ln -sf clang-tblgen ${D}${bindir}/clang-tblgen${PV}
|
||||
ln -sf llvm-tblgen ${D}${bindir}/llvm-tblgen${PV}
|
||||
ln -sf llvm-config ${D}${bindir}/llvm-config${PV}
|
||||
|
||||
# These are provided by llvm-tblgen-native
|
||||
rm ${D}${bindir}/*-tblgen
|
||||
}
|
||||
|
||||
do_install:append:class-nativesdk () {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
SUMMARY = "LLVM TableGen binaries, for the build host"
|
||||
SECTION = "devel"
|
||||
|
||||
# Building the LLVM projects often means using the TableGen tools (llvm-tblgen,
|
||||
# etc). We could build these as part of llvm-native, but there are cases where
|
||||
# this would be overkill. For example, building a target LLDB needs native
|
||||
# tablegen binaries and a target libllvm so having to build a complete native
|
||||
# llvm is not needed.
|
||||
|
||||
require common-clang.inc
|
||||
require common-source.inc
|
||||
|
||||
inherit cmake pkgconfig native
|
||||
|
||||
OECMAKE_SOURCEPATH = "${S}/llvm"
|
||||
|
||||
EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS='llvm;clang;lldb'"
|
||||
|
||||
BINARIES = "llvm-min-tblgen llvm-tblgen clang-tblgen lldb-tblgen"
|
||||
|
||||
OECMAKE_TARGET_COMPILE = "${BINARIES}"
|
||||
|
||||
do_install() {
|
||||
for f in ${BINARIES}; do
|
||||
install -D ${B}/bin/$f ${D}${bindir}/$f
|
||||
done
|
||||
}
|
||||
Reference in New Issue
Block a user