summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/clang/compiler-rt_git.bb
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2025-05-04 21:15:11 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-05-05 18:02:48 +0100
commit79030cd4c463f7fd6a716d94ab5dc7707a3fed77 (patch)
tree620b060128c3a6e1ae2d9ecd1ae6a0722aaf0ab1 /meta/recipes-devtools/clang/compiler-rt_git.bb
parent437ad6eaa8383a2c2ab9364caa05442e99ed6efc (diff)
downloadpoky-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.bb121
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
4SUMMARY = "LLVM based C/C++ compiler Runtime"
5DESCRIPTIOM = "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"
9HOMEPAGE = "http://compiler-rt.llvm.org/"
10SECTION = "base"
11
12require common-clang.inc
13require common-source.inc
14
15BPN = "compiler-rt"
16
17inherit cmake pkgconfig python3native
18
19
20LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a"
21
22LIBCPLUSPLUS = ""
23COMPILER_RT = ""
24
25TUNE_CCARGS:remove = "-no-integrated-as"
26
27INHIBIT_DEFAULT_DEPS = "1"
28
29DEPENDS += "ninja-native libgcc"
30DEPENDS:append:class-target = " virtual/cross-c++ clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc gcc-runtime"
31DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-native clang-crosssdk-${SDK_SYS} nativesdk-gcc-runtime"
32DEPENDS:append:class-native = " clang-native"
33
34# Trick clang.bbclass into not creating circular dependencies
35UNWINDLIB:class-nativesdk:toolchain-clang = "--unwindlib=libgcc"
36COMPILER_RT:class-nativesdk:toolchain-clang = "-rtlib=libgcc --unwindlib=libgcc"
37LIBCPLUSPLUS:class-nativesdk:toolchain-clang = "-stdlib=libstdc++"
38UNWINDLIB:class-native:toolchain-clang = "--unwindlib=libgcc"
39COMPILER_RT:class-native:toolchain-clang = "-rtlib=libgcc --unwindlib=libgcc"
40LIBCPLUSPLUS:class-native:toolchain-clang = "-stdlib=libstdc++"
41UNWINDLIB:class-target:toolchain-clang = "--unwindlib=libgcc"
42COMPILER_RT:class-target:toolchain-clang = "-rtlib=libgcc --unwindlib=libgcc"
43LIBCPLUSPLUS:class-target:toolchain-clang = "-stdlib=libstdc++"
44
45PACKAGECONFIG ??= ""
46PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF"
47PACKAGECONFIG[profile] = "-DCOMPILER_RT_BUILD_PROFILE=ON,-DCOMPILER_RT_BUILD_PROFILE=OFF"
48# Context Profiling, might need to enable 'profile' too
49PACKAGECONFIG[ctx-profile] = "-DCOMPILER_RT_BUILD_CTX_PROFILE=ON,-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF"
50
51HF = ""
52HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}"
53HF[vardepvalue] = "${HF}"
54
55OECMAKE_TARGET_COMPILE = "compiler-rt"
56OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers"
57OECMAKE_SOURCEPATH = "${S}/llvm"
58EXTRA_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
73EXTRA_OECMAKE:append:class-native = "\
74 -DCOMPILER_RT_DEFAULT_TARGET_ARCH=${HOST_ARCH} \
75 -DCMAKE_C_COMPILER_TARGET=${HOST_ARCH} \
76"
77
78EXTRA_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
86EXTRA_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"
94EXTRA_OECMAKE:append:powerpc = " -DCOMPILER_RT_DEFAULT_TARGET_ARCH=powerpc "
95
96do_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
101FILES_SOLIBSDEV = ""
102
103FILES:${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"
106FILES:${PN}-staticdev += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.a"
107FILES:${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
112INSANE_SKIP:${PN} = "dev-so libdir"
113INSANE_SKIP:${PN}-dbg = "libdir"
114
115RDEPENDS:${PN}-dev += "${PN}-staticdev"
116
117BBCLASSEXTEND = "native nativesdk"
118
119ALLOW_EMPTY:${PN} = "1"
120
121SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}"