From: Khem Raj Date: Fri, 7 Nov 2025 23:06:16 +0000 (-0800) Subject: compiler-rt-sanitizers: Adjust for compiler-rt changes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5be09b4e9d30b165325ed6e7432c5ec914a4408b;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git compiler-rt-sanitizers: Adjust for compiler-rt changes * ORC is not built with compiler-rt anymore, hence package it here * Avoid duplication in specifying cmake sourcedir, use OECMAKE_SOURCEPATH * Since RUNTIMES are bounded there is no need to specify build targets explicitly Signed-off-by: Khem Raj Signed-off-by: Mathieu Dubois-Briand --- diff --git a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb index 588320a1407..53d0d63169c 100644 --- a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb +++ b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb @@ -25,24 +25,20 @@ def get_compiler_rt_arch(bb, d): LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a" -TUNE_CCARGS:remove = "-no-integrated-as" -COMPILER_RT ??= "-rtlib=libgcc -unwindlib=libgcc" -LIBCPLUSPLUS ??= "-stdlib=libstdc++" - CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" BUILD_CC = "${CCACHE}${HOST_PREFIX}clang ${BUILD_CC_ARCH}" BUILD_CXX = "${CCACHE}${HOST_PREFIX}clang++ ${BUILD_CC_ARCH}$" -CFLAGS += "${COMPILER_RT}" -CXXFLAGS += "${COMPILER_RT} ${LIBCPLUSPLUS}" TOOLCHAIN = "clang" TOOLCHAIN_NATIVE = "clang" DEPENDS += "virtual/crypt compiler-rt" DEPENDS:append:class-native = " clang-native libxcrypt-native libcxx-native" -DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-native clang-crosssdk-${SDK_SYS} nativesdk-libxcrypt nativesdk-gcc-runtime" -DEPENDS:append:class-target = " virtual/cross-c++ ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc gcc-runtime" +DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-native clang-crosssdk-${SDK_SYS} nativesdk-libxcrypt" +DEPENDS:append:class-nativesdk = " ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "nativesdk-libcxx", "nativesdk-gcc-runtime", d)}" +DEPENDS:append:class-target = " virtual/cross-c++ ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc" +DEPENDS:append:class-target = " ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "libcxx", "gcc-runtime", d)}" PACKAGECONFIG ??= "" PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" @@ -52,9 +48,7 @@ PACKAGECONFIG[ctx-profile] = "-DCOMPILER_RT_BUILD_CTX_PROFILE=ON,-DCOMPILER_RT_B CXXFLAGS:append:libc-musl = " -D_LARGEFILE64_SOURCE" -OECMAKE_TARGET_COMPILE = "compiler-rt" -OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers" -OECMAKE_SOURCEPATH = "${S}/llvm" +OECMAKE_SOURCEPATH = "${S}/runtimes" INSTALL_VER ?= "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}${VER_SUFFIX}" INSTALL_VER:class-native = "${@oe.utils.trim_version("${PV}", 1)}" @@ -75,7 +69,6 @@ EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ -DLLVM_APPEND_VC_REV=OFF \ -DCOMPILER_RT_INSTALL_PATH=${nonarch_libdir}/clang/${INSTALL_VER} \ - -S ${S}/runtimes \ " EXTRA_OECMAKE:append:class-native = "\ @@ -106,12 +99,6 @@ EXTRA_OECMAKE:append:class-nativesdk = "\ EXTRA_OECMAKE:append:libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=ON " -do_install:append () { - # Already shipped with compile-rt Orc support - rm -rf ${D}${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/liborc_rt-*.a - rm -rf ${D}${nonarch_libdir}/clang/${MAJOR_VER}/include/orc/ -} - FILES_SOLIBSDEV = "" FILES:${PN} += "${nonarch_libdir}/clang/${INSTALL_VER} \ ${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/lib*${SOLIBSDEV} \