diff options
Diffstat (limited to 'recipes-devtools/clang/compiler-rt-sanitizers_git.bb')
-rw-r--r-- | recipes-devtools/clang/compiler-rt-sanitizers_git.bb | 129 |
1 files changed, 0 insertions, 129 deletions
diff --git a/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/recipes-devtools/clang/compiler-rt-sanitizers_git.bb deleted file mode 100644 index 6beb16a..0000000 --- a/recipes-devtools/clang/compiler-rt-sanitizers_git.bb +++ /dev/null | |||
@@ -1,129 +0,0 @@ | |||
1 | # Copyright (C) 2021 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 Sanitizers Runtime" | ||
5 | DESCRIPTION = "Runtime libraries that are required \ | ||
6 | to run the code with sanitizer instrumentation" | ||
7 | HOMEPAGE = "http://compiler-rt.llvm.org/" | ||
8 | SECTION = "base" | ||
9 | |||
10 | require clang.inc | ||
11 | require common-source.inc | ||
12 | |||
13 | BPN = "compiler-rt-sanitizers" | ||
14 | |||
15 | inherit cmake pkgconfig python3native | ||
16 | |||
17 | |||
18 | LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a" | ||
19 | |||
20 | TUNE_CCARGS:remove = "-no-integrated-as" | ||
21 | |||
22 | DEPENDS += "ninja-native virtual/crypt compiler-rt" | ||
23 | DEPENDS:append:class-native = " clang-native libxcrypt-native" | ||
24 | DEPENDS:append:class-nativesdk = " clang-native clang-crosssdk-${SDK_SYS} nativesdk-libxcrypt nativesdk-gcc-runtime" | ||
25 | DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc gcc-runtime" | ||
26 | |||
27 | PACKAGECONFIG ??= "" | ||
28 | PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" | ||
29 | PACKAGECONFIG[static-libcxx] = "-DSANITIZER_USE_STATIC_CXX_ABI=ON -DSANITIZER_USE_STATIC_LLVM_UNWINDER=ON -DCOMPILER_RT_ENABLE_STATIC_UNWINDER=ON,," | ||
30 | # Context Profiling | ||
31 | PACKAGECONFIG[ctx-profile] = "-DCOMPILER_RT_BUILD_CTX_PROFILE=ON,-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF" | ||
32 | |||
33 | HF = "" | ||
34 | HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" | ||
35 | HF[vardepvalue] = "${HF}" | ||
36 | |||
37 | CXXFLAGS:append:libc-musl = " -D_LARGEFILE64_SOURCE" | ||
38 | |||
39 | OECMAKE_TARGET_COMPILE = "compiler-rt" | ||
40 | OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers" | ||
41 | OECMAKE_SOURCEPATH = "${S}/llvm" | ||
42 | EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | ||
43 | -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ | ||
44 | -DCOMPILER_RT_STANDALONE_BUILD=ON \ | ||
45 | -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \ | ||
46 | -DCOMPILER_RT_BUILD_BUILTINS=OFF \ | ||
47 | -DCOMPILER_RT_INCLUDE_TESTS=OFF \ | ||
48 | -DSANITIZER_CXX_ABI_LIBNAME=${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "libc++", "libstdc++", d)} \ | ||
49 | -DCOMPILER_RT_BUILD_XRAY=ON \ | ||
50 | -DCOMPILER_RT_BUILD_SANITIZERS=ON \ | ||
51 | -DCOMPILER_RT_BUILD_LIBFUZZER=ON \ | ||
52 | -DCOMPILER_RT_BUILD_PROFILE=ON \ | ||
53 | -DCOMPILER_RT_BUILD_MEMPROF=ON \ | ||
54 | -DLLVM_ENABLE_RUNTIMES='compiler-rt' \ | ||
55 | -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ | ||
56 | -DLLVM_APPEND_VC_REV=OFF \ | ||
57 | -S ${S}/runtimes \ | ||
58 | " | ||
59 | |||
60 | EXTRA_OECMAKE:append:class-target = "\ | ||
61 | -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ | ||
62 | -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ | ||
63 | -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ | ||
64 | -DCMAKE_C_COMPILER_TARGET=${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}${HF} \ | ||
65 | -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ | ||
66 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ | ||
67 | " | ||
68 | |||
69 | EXTRA_OECMAKE:append:class-nativesdk = "\ | ||
70 | -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ | ||
71 | -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ | ||
72 | -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ | ||
73 | -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ | ||
74 | -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ | ||
75 | -DCMAKE_C_COMPILER_TARGET=${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}${HF} \ | ||
76 | -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ | ||
77 | " | ||
78 | |||
79 | EXTRA_OECMAKE:append:libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=ON " | ||
80 | EXTRA_OECMAKE:append:powerpc = " -DCOMPILER_RT_DEFAULT_TARGET_ARCH=powerpc " | ||
81 | |||
82 | do_install:append () { | ||
83 | mkdir -p ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib | ||
84 | mv ${D}${nonarch_libdir}/linux ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib | ||
85 | # Already shipped with compile-rt Orc support | ||
86 | rm -rf ${D}${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/liborc_rt-*.a | ||
87 | rm -rf ${D}${nonarch_libdir}/clang/${MAJOR_VER}/include/orc/ | ||
88 | } | ||
89 | |||
90 | FILES_SOLIBSDEV = "" | ||
91 | FILES:${PN} += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER} \ | ||
92 | ${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/lib*${SOLIBSDEV} \ | ||
93 | ${nonarch_libdir}/clang/${MAJOR_VER}/*.txt \ | ||
94 | ${nonarch_libdir}/clang/${MAJOR_VER}/share/*.txt" | ||
95 | FILES:${PN}-staticdev += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.a" | ||
96 | FILES:${PN}-dev += "${datadir} ${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/*.syms \ | ||
97 | ${nonarch_libdir}/clang/${MAJOR_VER}/include \ | ||
98 | ${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/clang_rt.crt*.o \ | ||
99 | ${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/libclang_rt.asan-preinit*.a" | ||
100 | INSANE_SKIP:${PN} = "dev-so libdir" | ||
101 | INSANE_SKIP:${PN}-dbg = "libdir" | ||
102 | |||
103 | #PROVIDES:append:class-target = "\ | ||
104 | # virtual/${MLPREFIX}compilerlibs \ | ||
105 | # libgcc \ | ||
106 | # libgcc-initial \ | ||
107 | # libgcc-dev \ | ||
108 | # libgcc-initial-dev \ | ||
109 | # " | ||
110 | # | ||
111 | |||
112 | RDEPENDS:${PN}-dev += "${PN}-staticdev" | ||
113 | |||
114 | BBCLASSEXTEND = "native nativesdk" | ||
115 | |||
116 | ALLOW_EMPTY:${PN} = "1" | ||
117 | ALLOW_EMPTY:${PN}-dev = "1" | ||
118 | |||
119 | TOOLCHAIN = "clang" | ||
120 | # Overrides defaults from clang.bbclass | ||
121 | TOOLCHAIN:class-nativesdk = "clang" | ||
122 | TOOLCHAIN:class-native = "clang" | ||
123 | SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}" | ||
124 | |||
125 | # riscv and x86_64 Sanitizers work on musl too | ||
126 | COMPATIBLE_HOST:libc-musl:x86-64 = "(.*)" | ||
127 | COMPATIBLE_HOST:libc-musl:riscv64 = "(.*)" | ||
128 | COMPATIBLE_HOST:libc-musl:riscv32 = "(.*)" | ||
129 | COMPATIBLE_HOST:libc-musl = "null" | ||