new file mode 100644
@@ -0,0 +1,24 @@
+# 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 = " 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"
+DEPENDS:append = " clang-native"
+BUILD_CC = "${CCACHE}clang -isysroot=${STAGING_DIR_NATIVE}"
+BUILD_CXX = "${CCACHE}clang++ -isysroot=${STAGING_DIR_NATIVE}"
+BUILD_CPP = "${CCACHE}clang -isysroot=${STAGING_DIR_NATIVE} -E"
+BUILD_CCLD = "${CCACHE}clang"
+BUILD_RANLIB = "llvm-ranlib"
+BUILD_AR = "llvm-ar"
+BUILD_NM = "llvm-nm"
Some packages demand clang all the way, including for native pieces e.g. chromium, this helps to get that going Signed-off-by: Khem Raj <raj.khem@gmail.com> --- meta/classes-recipe/clang-native.bbclass | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 meta/classes-recipe/clang-native.bbclass