summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2025-05-04 21:15:17 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-05-05 18:02:48 +0100
commit5219464cba2f88cd634cc903199d06ec1991c55d (patch)
tree24bbccb2b906c438527c7e4af2e5e2bcb5f99c22 /meta/recipes-devtools
parent84f6d5015cc0bfff2e65b543b44470dcca1a314c (diff)
downloadpoky-5219464cba2f88cd634cc903199d06ec1991c55d.tar.gz
libcxx,compiler-rt-sanitizers: Add cflags to build with clang compiler
We are using clang-native to build the native versions of these recipes but we are missing the needed compiler flags to let it c/c++ runtime appropriately. This also ensures that meta-clang does not have to worry about the compiler settings for nativesdk/native pieces separately. (From OE-Core rev: b3b97ff790f42c5844c9f6aaeab9e23d355febfa) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb6
-rw-r--r--meta/recipes-devtools/clang/libcxx_git.bb5
2 files changed, 11 insertions, 0 deletions
diff --git a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb
index b3c4bfcffd..b987a5cc76 100644
--- a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb
+++ b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb
@@ -18,9 +18,15 @@ inherit cmake pkgconfig python3native
18LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a" 18LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a"
19 19
20TUNE_CCARGS:remove = "-no-integrated-as" 20TUNE_CCARGS:remove = "-no-integrated-as"
21COMPILER_RT ??= "-rtlib=libgcc -unwindlib=libgcc"
22LIBCPLUSPLUS ??= "-stdlib=libstdc++"
21 23
22CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" 24CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
23CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" 25CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
26BUILD_CC = "${CCACHE}${HOST_PREFIX}clang ${BUILD_CC_ARCH}"
27BUILD_CXX = "${CCACHE}${HOST_PREFIX}clang++ ${BUILD_CC_ARCH}$"
28CFLAGS += "${COMPILER_RT}"
29CXXFLAGS += "${COMPILER_RT} ${LIBCPLUSPLUS}"
24 30
25DEPENDS += "ninja-native virtual/crypt compiler-rt" 31DEPENDS += "ninja-native virtual/crypt compiler-rt"
26DEPENDS:append:class-native = " clang-native libxcrypt-native libcxx-native" 32DEPENDS:append:class-native = " clang-native libxcrypt-native libcxx-native"
diff --git a/meta/recipes-devtools/clang/libcxx_git.bb b/meta/recipes-devtools/clang/libcxx_git.bb
index d2655d9da9..f5987199ec 100644
--- a/meta/recipes-devtools/clang/libcxx_git.bb
+++ b/meta/recipes-devtools/clang/libcxx_git.bb
@@ -49,6 +49,11 @@ OECMAKE_TARGET_INSTALL = "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "instal
49 49
50CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" 50CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
51CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" 51CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
52BUILD_CC = "${CCACHE}clang ${BUILD_CC_ARCH}"
53BUILD_CXX = "${CCACHE}clang++ ${BUILD_CC_ARCH}"
54CFLAGS += "${COMPILER_RT}"
55CXXFLAGS += "${COMPILER_RT} ${LIBCPLUSPLUS}"
56
52OECMAKE_SOURCEPATH = "${S}/llvm" 57OECMAKE_SOURCEPATH = "${S}/llvm"
53EXTRA_OECMAKE += "\ 58EXTRA_OECMAKE += "\
54 -DCMAKE_BUILD_TYPE=RelWithDebInfo \ 59 -DCMAKE_BUILD_TYPE=RelWithDebInfo \