From 9f245e4ee21d5b788787cbb26b8a52fd32d60775 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 3 Sep 2022 14:11:46 -0700 Subject: clang-native.bbclass: Move to classes folder classes-recipe domain is new and will break kirkstone and need very recent bitbake, let it settle some dust before adopting it for meta-clang Fixes https://github.com/kraj/meta-clang/issues/651 Signed-off-by: Khem Raj --- classes/clang-native.bbclass | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 classes/clang-native.bbclass (limited to 'classes') diff --git a/classes/clang-native.bbclass b/classes/clang-native.bbclass new file mode 100644 index 0000000..51fafcd --- /dev/null +++ b/classes/clang-native.bbclass @@ -0,0 +1,23 @@ +# inherit this class if you would like to use clang to compile the native +# version of your recipes instead of system compiler ( which is normally gcc ) +# on build machines +# to use it add +# +# inherit clang-native +# +# to the concerned recipe via a bbappend or directly to recipe file +# +DEPENDS:append:runtime-llvm = " clang-native compiler-rt-native libcxx-native" +# Use libcxx headers for native parts +CXXFLAGS:append:runtime-llvm = " -stdlib=libc++" +BUILD_CXXFLAGS:append:runtime-llvm = " -isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++" +# Use libgcc for native parts +LDFLAGS:append:runtime-llvm = " -stdlib=libc++ -rtlib=libgcc -unwindlib=libgcc" +BUILD_LDFLAGS:append:runtime-llvm = " -stdlib=libc++ -rtlib=libgcc -unwindlib=libgcc" +BUILD_CC:runtime-llvm = "${CCACHE}clang -isysroot=${STAGING_DIR_NATIVE}" +BUILD_CXX:runtime-llvm = "${CCACHE}clang++ -isysroot=${STAGING_DIR_NATIVE}" +BUILD_CPP:runtime-llvm = "${CCACHE}clang -isysroot=${STAGING_DIR_NATIVE} -E" +BUILD_CCLD:runtime-llvm = "${CCACHE}clang" +BUILD_RANLIB:runtime-llvm = "llvm-ranlib" +BUILD_AR:runtime-llvm = "llvm-ar" +BUILD_NM:runtime-llvm = "llvm-nm" -- cgit v1.2.3-54-g00ecf