diff options
author | Khem Raj <raj.khem@gmail.com> | 2025-07-03 20:13:48 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-07-04 14:56:41 +0100 |
commit | 582664d64dee8aac0f04fa76a3b0402e03eaff20 (patch) | |
tree | 2e725a1a85c048f04c228c03d93855ab328e60e5 | |
parent | 37dd8810df2205ce12722f44293cf8991fc4704e (diff) | |
download | poky-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.bb | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/clang/compiler-rt_git.bb | 9 | ||||
-rw-r--r-- | meta/recipes-devtools/clang/libcxx_git.bb | 2 |
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}" | |||
37 | CXXFLAGS += "${COMPILER_RT} ${LIBCPLUSPLUS}" | 37 | CXXFLAGS += "${COMPILER_RT} ${LIBCPLUSPLUS}" |
38 | 38 | ||
39 | TOOLCHAIN = "clang" | 39 | TOOLCHAIN = "clang" |
40 | TOOLCHAIN_NATIVE = "clang" | ||
40 | 41 | ||
41 | DEPENDS += "ninja-native virtual/crypt compiler-rt" | 42 | DEPENDS += "ninja-native virtual/crypt compiler-rt" |
42 | DEPENDS:append:class-native = " clang-native libxcrypt-native libcxx-native" | 43 | DEPENDS: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" | |||
29 | DEPENDS:append:class-target = " virtual/cross-c++ clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc gcc-runtime" | 29 | DEPENDS:append:class-target = " virtual/cross-c++ clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc gcc-runtime" |
30 | DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-native clang-crosssdk-${SDK_SYS} nativesdk-gcc-runtime" | 30 | DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-native clang-crosssdk-${SDK_SYS} nativesdk-gcc-runtime" |
31 | DEPENDS:append:class-native = " clang-native" | 31 | DEPENDS:append:class-native = " clang-native" |
32 | DEPENDS: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 |
34 | UNWINDLIB:class-nativesdk = "--unwindlib=libgcc" | 35 | UNWINDLIB:class-nativesdk = "--unwindlib=libgcc" |
35 | COMPILER_RT:class-nativesdk = "-rtlib=libgcc" | 36 | COMPILER_RT:class-nativesdk = "-rtlib=libgcc" |
36 | LIBCPLUSPLUS:class-nativesdk = "-stdlib=libstdc++" | 37 | LIBCPLUSPLUS:class-nativesdk = "-stdlib=libstdc++" |
37 | UNWINDLIB:class-native = "--unwindlib=libgcc" | 38 | UNWINDLIB:class-native = "" |
38 | COMPILER_RT:class-native = "-rtlib=libgcc" | 39 | COMPILER_RT:class-native = "" |
39 | LIBCPLUSPLUS:class-native = "-stdlib=libstdc++" | 40 | LIBCPLUSPLUS:class-native = "" |
40 | UNWINDLIB:class-target = "--unwindlib=libgcc" | 41 | UNWINDLIB:class-target = "--unwindlib=libgcc" |
41 | COMPILER_RT:class-target = "-rtlib=libgcc" | 42 | COMPILER_RT:class-target = "-rtlib=libgcc" |
42 | LIBCPLUSPLUS:class-target = "-stdlib=libstdc++" | 43 | LIBCPLUSPLUS:class-target = "-stdlib=libstdc++" |
@@ -52,8 +53,6 @@ HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', | |||
52 | 53 | ||
53 | CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" | 54 | CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" |
54 | CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" | 55 | CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" |
55 | BUILD_CC = "${CCACHE}clang ${BUILD_CC_ARCH}" | ||
56 | BUILD_CXX = "${CCACHE}clang++ ${BUILD_CC_ARCH}" | ||
57 | LDFLAGS += "${COMPILER_RT} ${UNWINDLIB}" | 56 | LDFLAGS += "${COMPILER_RT} ${UNWINDLIB}" |
58 | CXXFLAGS += "${LIBCPLUSPLUS}" | 57 | CXXFLAGS += "${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" | |||
25 | DEPENDS:append:class-target = " virtual/cross-c++ clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${MLPREFIX}compilerlibs" | 25 | DEPENDS:append:class-target = " virtual/cross-c++ clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${MLPREFIX}compilerlibs" |
26 | DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-crosssdk-${SDK_SYS} nativesdk-compiler-rt" | 26 | DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-crosssdk-${SDK_SYS} nativesdk-compiler-rt" |
27 | DEPENDS:append:class-native = " clang-native compiler-rt-native" | 27 | DEPENDS:append:class-native = " clang-native compiler-rt-native" |
28 | DEPENDS:remove:class-native = "libcxx-native" | ||
28 | 29 | ||
29 | COMPILER_RT ?= "${@bb.utils.contains("PACKAGECONFIG", "compiler-rt", "-rtlib=compiler-rt", "-rtlib=libgcc", d)}" | 30 | COMPILER_RT ?= "${@bb.utils.contains("PACKAGECONFIG", "compiler-rt", "-rtlib=compiler-rt", "-rtlib=libgcc", d)}" |
30 | UNWINDLIB ?= "${@bb.utils.contains("PACKAGECONFIG", "unwind", "-unwindlib=none", "-unwindlib=libgcc", d)}" | 31 | UNWINDLIB ?= "${@bb.utils.contains("PACKAGECONFIG", "unwind", "-unwindlib=none", "-unwindlib=libgcc", d)}" |
@@ -55,6 +56,7 @@ LDFLAGS += "${COMPILER_RT} ${UNWINDLIB} ${LIBCPLUSPLUS}" | |||
55 | CXXFLAGS += "${LIBCPLUSPLUS}" | 56 | CXXFLAGS += "${LIBCPLUSPLUS}" |
56 | 57 | ||
57 | TOOLCHAIN = "clang" | 58 | TOOLCHAIN = "clang" |
59 | TOOLCHAIN_NATIVE = "clang" | ||
58 | 60 | ||
59 | OECMAKE_SOURCEPATH = "${S}/llvm" | 61 | OECMAKE_SOURCEPATH = "${S}/llvm" |
60 | EXTRA_OECMAKE += "\ | 62 | EXTRA_OECMAKE += "\ |