diff options
| author | Khem Raj <raj.khem@gmail.com> | 2025-05-04 21:15:17 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-05-05 18:02:48 +0100 |
| commit | 5219464cba2f88cd634cc903199d06ec1991c55d (patch) | |
| tree | 24bbccb2b906c438527c7e4af2e5e2bcb5f99c22 /meta/recipes-devtools | |
| parent | 84f6d5015cc0bfff2e65b543b44470dcca1a314c (diff) | |
| download | poky-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.bb | 6 | ||||
| -rw-r--r-- | meta/recipes-devtools/clang/libcxx_git.bb | 5 |
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 | |||
| 18 | LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a" | 18 | LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a" |
| 19 | 19 | ||
| 20 | TUNE_CCARGS:remove = "-no-integrated-as" | 20 | TUNE_CCARGS:remove = "-no-integrated-as" |
| 21 | COMPILER_RT ??= "-rtlib=libgcc -unwindlib=libgcc" | ||
| 22 | LIBCPLUSPLUS ??= "-stdlib=libstdc++" | ||
| 21 | 23 | ||
| 22 | CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" | 24 | CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" |
| 23 | CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" | 25 | CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" |
| 26 | BUILD_CC = "${CCACHE}${HOST_PREFIX}clang ${BUILD_CC_ARCH}" | ||
| 27 | BUILD_CXX = "${CCACHE}${HOST_PREFIX}clang++ ${BUILD_CC_ARCH}$" | ||
| 28 | CFLAGS += "${COMPILER_RT}" | ||
| 29 | CXXFLAGS += "${COMPILER_RT} ${LIBCPLUSPLUS}" | ||
| 24 | 30 | ||
| 25 | DEPENDS += "ninja-native virtual/crypt compiler-rt" | 31 | DEPENDS += "ninja-native virtual/crypt compiler-rt" |
| 26 | DEPENDS:append:class-native = " clang-native libxcrypt-native libcxx-native" | 32 | DEPENDS: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 | ||
| 50 | CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" | 50 | CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" |
| 51 | CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" | 51 | CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" |
| 52 | BUILD_CC = "${CCACHE}clang ${BUILD_CC_ARCH}" | ||
| 53 | BUILD_CXX = "${CCACHE}clang++ ${BUILD_CC_ARCH}" | ||
| 54 | CFLAGS += "${COMPILER_RT}" | ||
| 55 | CXXFLAGS += "${COMPILER_RT} ${LIBCPLUSPLUS}" | ||
| 56 | |||
| 52 | OECMAKE_SOURCEPATH = "${S}/llvm" | 57 | OECMAKE_SOURCEPATH = "${S}/llvm" |
| 53 | EXTRA_OECMAKE += "\ | 58 | EXTRA_OECMAKE += "\ |
| 54 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | 59 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
