xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-devtools/jemalloc/jemalloc_5.2.1.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1# Copyright (C) 2021 Mingli Yu <mingli.yu@windriver.com>
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4SUMMARY = "General-purpose scalable concurrent malloc implementation"
5
6DESCRIPTION = "jemalloc is a general purpose malloc(3) implementation that emphasizes \
7fragmentation avoidance and scalable concurrency support."
8
9HOMEPAGE = "https://github.com/jemalloc/jemalloc"
10LICENSE = "BSD-2-Clause"
11
12SECTION = "libs"
13
14LIC_FILES_CHKSUM = "file://COPYING;md5=ea061f8731d5e6a5761dfad951ef5f5f"
15
16SRC_URI = "git://github.com/jemalloc/jemalloc.git;branch=master;protocol=https \
17           file://0001-Makefile.in-make-sure-doc-generated-before-install.patch \
18           file://run-ptest \
19"
20
21# Workaround for https://github.com/llvm/llvm-project/issues/52765
22SRC_URI:append:libc-glibc:toolchain-clang = " file://0001-test-Disable-optimization-with-clang-for-aligned_all.patch "
23
24SRCREV = "ea6b3e973b477b8061e0076bb257dbd7f3faa756"
25
26S = "${WORKDIR}/git"
27
28inherit autotools ptest
29
30EXTRA_AUTORECONF += "--exclude=autoheader"
31
32EXTRA_OECONF:append:libc-musl = " --with-jemalloc-prefix=je_"
33
34do_install:append() {
35	sed -i -e 's@${STAGING_DIR_HOST}@@g' \
36               -e 's@${STAGING_DIR_NATIVE}@@g' \
37               -e 's@${WORKDIR}@@g' ${D}${bindir}/jemalloc-config
38}
39
40do_compile_ptest() {
41	oe_runmake tests
42}
43
44do_install_ptest() {
45	install -d ${D}${PTEST_PATH}/tests
46	subdirs="test/unit test/integration test/stress "
47	for tooltest in ${subdirs}
48	do
49		cp -r ${B}/${tooltest} ${D}${PTEST_PATH}/tests
50	done
51	find ${D}${PTEST_PATH}/tests \( -name "*.d" -o -name "*.o" \) -exec rm -f {} \;
52}
53