diff options
Diffstat (limited to 'recipes-devtools/clang/compiler-rt-sanitizers_git.bb')
-rw-r--r-- | recipes-devtools/clang/compiler-rt-sanitizers_git.bb | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/recipes-devtools/clang/compiler-rt-sanitizers_git.bb new file mode 100644 index 0000000..aa3a9ac --- /dev/null +++ b/recipes-devtools/clang/compiler-rt-sanitizers_git.bb | |||
@@ -0,0 +1,97 @@ | |||
1 | # Copyright (C) 2021 Khem Raj <raj.khem@gmail.com> | ||
2 | # Released under the MIT license (see COPYING.MIT for the terms) | ||
3 | |||
4 | DESCRIPTION = "LLVM based C/C++ compiler Runtime" | ||
5 | HOMEPAGE = "http://compiler-rt.llvm.org/" | ||
6 | SECTION = "base" | ||
7 | |||
8 | require clang.inc | ||
9 | require common-source.inc | ||
10 | |||
11 | inherit cmake pkgconfig python3native | ||
12 | |||
13 | |||
14 | LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a" | ||
15 | |||
16 | TUNE_CCARGS_remove = "-no-integrated-as" | ||
17 | |||
18 | RUNTIME = "llvm" | ||
19 | |||
20 | DEPENDS += "ninja-native clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${TARGET_PREFIX}compilerlibs" | ||
21 | DEPENDS_append_libc-glibc = " libxcrypt" | ||
22 | DEPENDS_append_class-nativesdk = " clang-native nativesdk-libxcrypt" | ||
23 | |||
24 | PACKAGECONFIG ??= "" | ||
25 | PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" | ||
26 | |||
27 | HF = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" | ||
28 | HF[vardepvalue] = "${HF}" | ||
29 | |||
30 | OECMAKE_TARGET_COMPILE = "compiler-rt" | ||
31 | OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers" | ||
32 | OECMAKE_SOURCEPATH = "${S}/llvm" | ||
33 | EXTRA_OECMAKE += "-DCOMPILER_RT_STANDALONE_BUILD=OFF \ | ||
34 | -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=${HOST_ARCH}${HF}${HOST_VENDOR}-${HOST_OS} \ | ||
35 | -DCOMPILER_RT_BUILD_BUILTINS=OFF \ | ||
36 | -DSANITIZER_CXX_ABI_LIBNAME=${@bb.utils.contains("RUNTIME", "llvm", "libc++", "libstdc++", d)} \ | ||
37 | -DSANITIZER_USE_STATIC_CXX_ABI=ON \ | ||
38 | -DSANITIZER_USE_STATIC_LLVM_UNWINDER=ON \ | ||
39 | -DCOMPILER_RT_BUILD_XRAY=ON \ | ||
40 | -DCOMPILER_RT_BUILD_SANITIZERS=ON \ | ||
41 | -DCOMPILER_RT_BUILD_LIBFUZZER=ON \ | ||
42 | -DCOMPILER_RT_BUILD_PROFILE=ON \ | ||
43 | -DCOMPILER_RT_BUILD_MEMPROF=ON \ | ||
44 | -DLLVM_ENABLE_PROJECTS='compiler-rt' \ | ||
45 | -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ | ||
46 | -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ | ||
47 | -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ | ||
48 | -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ | ||
49 | " | ||
50 | |||
51 | EXTRA_OECMAKE_append_class-nativesdk = "\ | ||
52 | -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ | ||
53 | -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ | ||
54 | " | ||
55 | |||
56 | EXTRA_OECMAKE_append_libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=ON " | ||
57 | EXTRA_OECMAKE_append_powerpc = " -DCOMPILER_RT_DEFAULT_TARGET_ARCH=powerpc " | ||
58 | |||
59 | do_install_append () { | ||
60 | if [ -n "${LLVM_LIBDIR_SUFFIX}" ]; then | ||
61 | mkdir -p ${D}${nonarch_libdir} | ||
62 | mv ${D}${libdir}/clang ${D}${nonarch_libdir}/clang | ||
63 | rmdir --ignore-fail-on-non-empty ${D}${libdir} | ||
64 | fi | ||
65 | } | ||
66 | |||
67 | FILES_SOLIBSDEV = "" | ||
68 | FILES_${PN} += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/lib*${SOLIBSDEV} \ | ||
69 | ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/*.txt \ | ||
70 | ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/share/*.txt" | ||
71 | FILES_${PN}-staticdev += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.a" | ||
72 | FILES_${PN}-dev += "${datadir} ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.syms \ | ||
73 | ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/include \ | ||
74 | ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/clang_rt.crt*.o \ | ||
75 | ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/libclang_rt.asan-preinit*.a \ | ||
76 | " | ||
77 | INSANE_SKIP_${PN} = "dev-so libdir" | ||
78 | INSANE_SKIP_${PN}-dbg = "libdir" | ||
79 | |||
80 | #PROVIDES_append_class-target = "\ | ||
81 | # virtual/${TARGET_PREFIX}compilerlibs \ | ||
82 | # libgcc \ | ||
83 | # libgcc-initial \ | ||
84 | # libgcc-dev \ | ||
85 | # libgcc-initial-dev \ | ||
86 | # " | ||
87 | # | ||
88 | |||
89 | RDEPENDS_${PN}-dev += "${PN}-staticdev" | ||
90 | |||
91 | BBCLASSEXTEND = "native nativesdk" | ||
92 | |||
93 | ALLOW_EMPTY_${PN} = "1" | ||
94 | ALLOW_EMPTY_${PN}-dev = "1" | ||
95 | |||
96 | TOOLCHAIN_forcevariable = "clang" | ||
97 | SYSROOT_DIRS_append_class-target = " ${nonarch_libdir}" | ||