diff options
| author | Khem Raj <raj.khem@gmail.com> | 2025-05-04 21:15:11 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-05-05 18:02:48 +0100 |
| commit | 79030cd4c463f7fd6a716d94ab5dc7707a3fed77 (patch) | |
| tree | 620b060128c3a6e1ae2d9ecd1ae6a0722aaf0ab1 /meta/recipes-devtools/clang/compiler-rt_git.bb | |
| parent | 437ad6eaa8383a2c2ab9364caa05442e99ed6efc (diff) | |
| download | poky-79030cd4c463f7fd6a716d94ab5dc7707a3fed77.tar.gz | |
clang: Merge llvm/clang family recipes from meta-clang
This can ensure that meta-clang does not carry them and can rely on core layer
while mesa can use them too.
Omit time stamps in openmp from generated files to improve
reproducibility
fix the issue that:
| file /usr/include/llvm/Config/llvm-config.h conflicts between attempted installs of lib32-llvm-dev-20.1.2-r0.core2_32 and llvm-dev-20.1.2-r0.core2_64
(From OE-Core rev: d77e398095228b34851762858a76640e3c2cb0ab)
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/clang/compiler-rt_git.bb')
| -rw-r--r-- | meta/recipes-devtools/clang/compiler-rt_git.bb | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/meta/recipes-devtools/clang/compiler-rt_git.bb b/meta/recipes-devtools/clang/compiler-rt_git.bb new file mode 100644 index 0000000000..9392854127 --- /dev/null +++ b/meta/recipes-devtools/clang/compiler-rt_git.bb | |||
| @@ -0,0 +1,121 @@ | |||
| 1 | # Copyright (C) 2015 Khem Raj <raj.khem@gmail.com> | ||
| 2 | # Released under the MIT license (see COPYING.MIT for the terms) | ||
| 3 | |||
| 4 | SUMMARY = "LLVM based C/C++ compiler Runtime" | ||
| 5 | DESCRIPTIOM = "Simple builtin library that provides an \ | ||
| 6 | implementation of the low-level target-specific \ | ||
| 7 | hooks required by code generation and other runtime \ | ||
| 8 | components" | ||
| 9 | HOMEPAGE = "http://compiler-rt.llvm.org/" | ||
| 10 | SECTION = "base" | ||
| 11 | |||
| 12 | require common-clang.inc | ||
| 13 | require common-source.inc | ||
| 14 | |||
| 15 | BPN = "compiler-rt" | ||
| 16 | |||
| 17 | inherit cmake pkgconfig python3native | ||
| 18 | |||
| 19 | |||
| 20 | LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a" | ||
| 21 | |||
| 22 | LIBCPLUSPLUS = "" | ||
| 23 | COMPILER_RT = "" | ||
| 24 | |||
| 25 | TUNE_CCARGS:remove = "-no-integrated-as" | ||
| 26 | |||
| 27 | INHIBIT_DEFAULT_DEPS = "1" | ||
| 28 | |||
| 29 | DEPENDS += "ninja-native libgcc" | ||
| 30 | DEPENDS:append:class-target = " virtual/cross-c++ clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc gcc-runtime" | ||
| 31 | DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-native clang-crosssdk-${SDK_SYS} nativesdk-gcc-runtime" | ||
| 32 | DEPENDS:append:class-native = " clang-native" | ||
| 33 | |||
| 34 | # Trick clang.bbclass into not creating circular dependencies | ||
| 35 | UNWINDLIB:class-nativesdk:toolchain-clang = "--unwindlib=libgcc" | ||
| 36 | COMPILER_RT:class-nativesdk:toolchain-clang = "-rtlib=libgcc --unwindlib=libgcc" | ||
| 37 | LIBCPLUSPLUS:class-nativesdk:toolchain-clang = "-stdlib=libstdc++" | ||
| 38 | UNWINDLIB:class-native:toolchain-clang = "--unwindlib=libgcc" | ||
| 39 | COMPILER_RT:class-native:toolchain-clang = "-rtlib=libgcc --unwindlib=libgcc" | ||
| 40 | LIBCPLUSPLUS:class-native:toolchain-clang = "-stdlib=libstdc++" | ||
| 41 | UNWINDLIB:class-target:toolchain-clang = "--unwindlib=libgcc" | ||
| 42 | COMPILER_RT:class-target:toolchain-clang = "-rtlib=libgcc --unwindlib=libgcc" | ||
| 43 | LIBCPLUSPLUS:class-target:toolchain-clang = "-stdlib=libstdc++" | ||
| 44 | |||
| 45 | PACKAGECONFIG ??= "" | ||
| 46 | PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" | ||
| 47 | PACKAGECONFIG[profile] = "-DCOMPILER_RT_BUILD_PROFILE=ON,-DCOMPILER_RT_BUILD_PROFILE=OFF" | ||
| 48 | # Context Profiling, might need to enable 'profile' too | ||
| 49 | PACKAGECONFIG[ctx-profile] = "-DCOMPILER_RT_BUILD_CTX_PROFILE=ON,-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF" | ||
| 50 | |||
| 51 | HF = "" | ||
| 52 | HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" | ||
| 53 | HF[vardepvalue] = "${HF}" | ||
| 54 | |||
| 55 | OECMAKE_TARGET_COMPILE = "compiler-rt" | ||
| 56 | OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers" | ||
| 57 | OECMAKE_SOURCEPATH = "${S}/llvm" | ||
| 58 | EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | ||
| 59 | -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ | ||
| 60 | -DCOMPILER_RT_STANDALONE_BUILD=ON \ | ||
| 61 | -DCOMPILER_RT_INCLUDE_TESTS=OFF \ | ||
| 62 | -DCOMPILER_RT_BUILD_XRAY=OFF \ | ||
| 63 | -DCOMPILER_RT_BUILD_SANITIZERS=OFF \ | ||
| 64 | -DCOMPILER_RT_BUILD_MEMPROF=OFF \ | ||
| 65 | -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \ | ||
| 66 | -DLLVM_ENABLE_RUNTIMES='compiler-rt' \ | ||
| 67 | -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ | ||
| 68 | -DLLVM_APPEND_VC_REV=OFF \ | ||
| 69 | -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ | ||
| 70 | -S ${S}/runtimes \ | ||
| 71 | " | ||
| 72 | |||
| 73 | EXTRA_OECMAKE:append:class-native = "\ | ||
| 74 | -DCOMPILER_RT_DEFAULT_TARGET_ARCH=${HOST_ARCH} \ | ||
| 75 | -DCMAKE_C_COMPILER_TARGET=${HOST_ARCH} \ | ||
| 76 | " | ||
| 77 | |||
| 78 | EXTRA_OECMAKE:append:class-target = "\ | ||
| 79 | -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ | ||
| 80 | -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ | ||
| 81 | -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ | ||
| 82 | -DCMAKE_C_COMPILER_TARGET=${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}${HF} \ | ||
| 83 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ | ||
| 84 | " | ||
| 85 | |||
| 86 | EXTRA_OECMAKE:append:class-nativesdk = "\ | ||
| 87 | -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ | ||
| 88 | -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ | ||
| 89 | -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ | ||
| 90 | -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ | ||
| 91 | -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ | ||
| 92 | -DCMAKE_C_COMPILER_TARGET=${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}${HF} \ | ||
| 93 | " | ||
| 94 | EXTRA_OECMAKE:append:powerpc = " -DCOMPILER_RT_DEFAULT_TARGET_ARCH=powerpc " | ||
| 95 | |||
| 96 | do_install:append () { | ||
| 97 | mkdir -p ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib | ||
| 98 | mv ${D}${nonarch_libdir}/linux ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib | ||
| 99 | } | ||
| 100 | |||
| 101 | FILES_SOLIBSDEV = "" | ||
| 102 | |||
| 103 | FILES:${PN} += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/lib*${SOLIBSDEV} \ | ||
| 104 | ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/*.txt \ | ||
| 105 | ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/share/*.txt" | ||
| 106 | FILES:${PN}-staticdev += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.a" | ||
| 107 | FILES:${PN}-dev += "${datadir} ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.syms \ | ||
| 108 | ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/include \ | ||
| 109 | ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/clang_rt.crt*.o \ | ||
| 110 | ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/libclang_rt.asan-preinit*.a" | ||
| 111 | |||
| 112 | INSANE_SKIP:${PN} = "dev-so libdir" | ||
| 113 | INSANE_SKIP:${PN}-dbg = "libdir" | ||
| 114 | |||
| 115 | RDEPENDS:${PN}-dev += "${PN}-staticdev" | ||
| 116 | |||
| 117 | BBCLASSEXTEND = "native nativesdk" | ||
| 118 | |||
| 119 | ALLOW_EMPTY:${PN} = "1" | ||
| 120 | |||
| 121 | SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}" | ||
