All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 1/5] clang-native: Add class to use clang as native compiler
@ 2025-07-02  5:32 Khem Raj
  2025-07-02  5:32 ` [PATCH v5 2/5] base.bbclass: Deferred inherit native toolchain class Khem Raj
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Khem Raj @ 2025-07-02  5:32 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

Some recipes demand full clang/llvm builds e.g. chromium we need to use
clang as native toolchain. This class collects all needed bits to enable
OE built clang to provide the clang native toolchain

Setting

TOOLCHAIN_NATIVE = "clang"

in recipe will chose clang for native toolchain

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/toolchain/clang-native.bbclass | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 meta/classes/toolchain/clang-native.bbclass

diff --git a/meta/classes/toolchain/clang-native.bbclass b/meta/classes/toolchain/clang-native.bbclass
new file mode 100644
index 00000000000..4de491a1cb5
--- /dev/null
+++ b/meta/classes/toolchain/clang-native.bbclass
@@ -0,0 +1,18 @@
+BUILD_CC = "${CCACHE}${BUILD_PREFIX}clang ${BUILD_CC_ARCH}"
+BUILD_CXX = "${CCACHE}${BUILD_PREFIX}clang++ ${BUILD_CC_ARCH}"
+BUILD_FC = "${BUILD_PREFIX}gfortran ${BUILD_CC_ARCH}"
+BUILD_CPP = "${BUILD_PREFIX}clang ${BUILD_CC_ARCH} -E"
+BUILD_LD = "${BUILD_PREFIX}ld ${BUILD_LD_ARCH}"
+BUILD_CCLD = "${BUILD_PREFIX}clang ${BUILD_CC_ARCH}"
+BUILD_AR = "${BUILD_PREFIX}llvm-ar"
+BUILD_AS = "${BUILD_PREFIX}as ${BUILD_AS_ARCH}"
+BUILD_RANLIB = "${BUILD_PREFIX}llvm-ranlib -D"
+BUILD_STRIP = "${BUILD_PREFIX}llvm-strip"
+BUILD_OBJCOPY = "${BUILD_PREFIX}llvm-objcopy"
+BUILD_OBJDUMP = "${BUILD_PREFIX}llvm-objdump"
+BUILD_NM = "${BUILD_PREFIX}llvm-nm"
+BUILD_READELF = "${BUILD_PREFIX}llvm-readelf"
+
+DEPENDS += "clang-native libcxx-native compiler-rt-native"
+
+LDFLAGS += " --rtlib=libgcc --unwindlib=libgcc"


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-07-02 10:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02  5:32 [PATCH v5 1/5] clang-native: Add class to use clang as native compiler Khem Raj
2025-07-02  5:32 ` [PATCH v5 2/5] base.bbclass: Deferred inherit native toolchain class Khem Raj
2025-07-02  5:32 ` [PATCH v5 3/5] compiler-rt,libcxx: Use clang for native versions as well Khem Raj
2025-07-02  5:32 ` [PATCH v5 4/5] sanity/utils: Directly use gcc, not BUILD_CC Khem Raj
2025-07-02  5:48   ` Patchtest results for " patchtest
2025-07-02  5:32 ` [PATCH v5 5/5] sanity/utils: Directly use gcc instead of BUILD_CC in host_gcc_version Khem Raj
2025-07-02 10:33   ` [OE-core] " Antonin Godard
2025-07-02 10:37     ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.