summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2025-07-03 20:13:48 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-07-04 14:56:41 +0100
commit582664d64dee8aac0f04fa76a3b0402e03eaff20 (patch)
tree2e725a1a85c048f04c228c03d93855ab328e60e5
parent37dd8810df2205ce12722f44293cf8991fc4704e (diff)
downloadpoky-582664d64dee8aac0f04fa76a3b0402e03eaff20.tar.gz
compiler-rt,libcxx: Use clang for native-libcxx and gcc for compiler-rt-native
compiler-rt configure calls for c++ compiler which can cause C++ runtime to not be detected on some Yocto autobuilder workers running ubuntu 24.04 therefore let it use gcc for native version Set TOOLCHAIN_NATIVE for using clang for libcxx (From OE-Core rev: d54512c1c0a98516077b77d5414af47d8c2b8c39) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb1
-rw-r--r--meta/recipes-devtools/clang/compiler-rt_git.bb9
-rw-r--r--meta/recipes-devtools/clang/libcxx_git.bb2
3 files changed, 7 insertions, 5 deletions
diff --git a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb
index 47438014b2..087a766302 100644
--- a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb
+++ b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb
@@ -37,6 +37,7 @@ CFLAGS += "${COMPILER_RT}"
37CXXFLAGS += "${COMPILER_RT} ${LIBCPLUSPLUS}" 37CXXFLAGS += "${COMPILER_RT} ${LIBCPLUSPLUS}"
38 38
39TOOLCHAIN = "clang" 39TOOLCHAIN = "clang"
40TOOLCHAIN_NATIVE = "clang"
40 41
41DEPENDS += "ninja-native virtual/crypt compiler-rt" 42DEPENDS += "ninja-native virtual/crypt compiler-rt"
42DEPENDS:append:class-native = " clang-native libxcrypt-native libcxx-native" 43DEPENDS:append:class-native = " clang-native libxcrypt-native libcxx-native"
diff --git a/meta/recipes-devtools/clang/compiler-rt_git.bb b/meta/recipes-devtools/clang/compiler-rt_git.bb
index ff6cc29bf3..342a7b0e95 100644
--- a/meta/recipes-devtools/clang/compiler-rt_git.bb
+++ b/meta/recipes-devtools/clang/compiler-rt_git.bb
@@ -29,14 +29,15 @@ DEPENDS += "ninja-native libgcc"
29DEPENDS:append:class-target = " virtual/cross-c++ clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc gcc-runtime" 29DEPENDS:append:class-target = " virtual/cross-c++ clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc gcc-runtime"
30DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-native clang-crosssdk-${SDK_SYS} nativesdk-gcc-runtime" 30DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-native clang-crosssdk-${SDK_SYS} nativesdk-gcc-runtime"
31DEPENDS:append:class-native = " clang-native" 31DEPENDS:append:class-native = " clang-native"
32DEPENDS:remove:class-native = "libcxx-native compiler-rt-native"
32 33
33# Trick clang.bbclass into not creating circular dependencies 34# Trick clang.bbclass into not creating circular dependencies
34UNWINDLIB:class-nativesdk = "--unwindlib=libgcc" 35UNWINDLIB:class-nativesdk = "--unwindlib=libgcc"
35COMPILER_RT:class-nativesdk = "-rtlib=libgcc" 36COMPILER_RT:class-nativesdk = "-rtlib=libgcc"
36LIBCPLUSPLUS:class-nativesdk = "-stdlib=libstdc++" 37LIBCPLUSPLUS:class-nativesdk = "-stdlib=libstdc++"
37UNWINDLIB:class-native = "--unwindlib=libgcc" 38UNWINDLIB:class-native = ""
38COMPILER_RT:class-native = "-rtlib=libgcc" 39COMPILER_RT:class-native = ""
39LIBCPLUSPLUS:class-native = "-stdlib=libstdc++" 40LIBCPLUSPLUS:class-native = ""
40UNWINDLIB:class-target = "--unwindlib=libgcc" 41UNWINDLIB:class-target = "--unwindlib=libgcc"
41COMPILER_RT:class-target = "-rtlib=libgcc" 42COMPILER_RT:class-target = "-rtlib=libgcc"
42LIBCPLUSPLUS:class-target = "-stdlib=libstdc++" 43LIBCPLUSPLUS:class-target = "-stdlib=libstdc++"
@@ -52,8 +53,6 @@ HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '',
52 53
53CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" 54CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
54CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" 55CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
55BUILD_CC = "${CCACHE}clang ${BUILD_CC_ARCH}"
56BUILD_CXX = "${CCACHE}clang++ ${BUILD_CC_ARCH}"
57LDFLAGS += "${COMPILER_RT} ${UNWINDLIB}" 56LDFLAGS += "${COMPILER_RT} ${UNWINDLIB}"
58CXXFLAGS += "${LIBCPLUSPLUS}" 57CXXFLAGS += "${LIBCPLUSPLUS}"
59 58
diff --git a/meta/recipes-devtools/clang/libcxx_git.bb b/meta/recipes-devtools/clang/libcxx_git.bb
index f5bf17f30a..d355fc3a0f 100644
--- a/meta/recipes-devtools/clang/libcxx_git.bb
+++ b/meta/recipes-devtools/clang/libcxx_git.bb
@@ -25,6 +25,7 @@ DEPENDS += "ninja-native"
25DEPENDS:append:class-target = " virtual/cross-c++ clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${MLPREFIX}compilerlibs" 25DEPENDS:append:class-target = " virtual/cross-c++ clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${MLPREFIX}compilerlibs"
26DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-crosssdk-${SDK_SYS} nativesdk-compiler-rt" 26DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-crosssdk-${SDK_SYS} nativesdk-compiler-rt"
27DEPENDS:append:class-native = " clang-native compiler-rt-native" 27DEPENDS:append:class-native = " clang-native compiler-rt-native"
28DEPENDS:remove:class-native = "libcxx-native"
28 29
29COMPILER_RT ?= "${@bb.utils.contains("PACKAGECONFIG", "compiler-rt", "-rtlib=compiler-rt", "-rtlib=libgcc", d)}" 30COMPILER_RT ?= "${@bb.utils.contains("PACKAGECONFIG", "compiler-rt", "-rtlib=compiler-rt", "-rtlib=libgcc", d)}"
30UNWINDLIB ?= "${@bb.utils.contains("PACKAGECONFIG", "unwind", "-unwindlib=none", "-unwindlib=libgcc", d)}" 31UNWINDLIB ?= "${@bb.utils.contains("PACKAGECONFIG", "unwind", "-unwindlib=none", "-unwindlib=libgcc", d)}"
@@ -55,6 +56,7 @@ LDFLAGS += "${COMPILER_RT} ${UNWINDLIB} ${LIBCPLUSPLUS}"
55CXXFLAGS += "${LIBCPLUSPLUS}" 56CXXFLAGS += "${LIBCPLUSPLUS}"
56 57
57TOOLCHAIN = "clang" 58TOOLCHAIN = "clang"
59TOOLCHAIN_NATIVE = "clang"
58 60
59OECMAKE_SOURCEPATH = "${S}/llvm" 61OECMAKE_SOURCEPATH = "${S}/llvm"
60EXTRA_OECMAKE += "\ 62EXTRA_OECMAKE += "\