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 <[email protected]>
---
 meta/classes-recipe/clang-native.bbclass | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 meta/classes-recipe/clang-native.bbclass

diff --git a/meta/classes-recipe/clang-native.bbclass 
b/meta/classes-recipe/clang-native.bbclass
new file mode 100644
index 00000000000..a136deeee38
--- /dev/null
+++ b/meta/classes-recipe/clang-native.bbclass
@@ -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"
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206733): 
https://lists.openembedded.org/g/openembedded-core/message/206733
Mute This Topic: https://lists.openembedded.org/mt/109411602/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to