summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-oe/recipes-devtools/jemalloc
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-devtools/jemalloc')
-rw-r--r--meta-openembedded/meta-oe/recipes-devtools/jemalloc/files/0001-Makefile.in-make-sure-doc-generated-before-install.patch42
-rw-r--r--meta-openembedded/meta-oe/recipes-devtools/jemalloc/files/run-ptest21
-rw-r--r--meta-openembedded/meta-oe/recipes-devtools/jemalloc/jemalloc_5.2.1.bb21
3 files changed, 82 insertions, 2 deletions
diff --git a/meta-openembedded/meta-oe/recipes-devtools/jemalloc/files/0001-Makefile.in-make-sure-doc-generated-before-install.patch b/meta-openembedded/meta-oe/recipes-devtools/jemalloc/files/0001-Makefile.in-make-sure-doc-generated-before-install.patch
new file mode 100644
index 000000000..0a1fe6d76
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-devtools/jemalloc/files/0001-Makefile.in-make-sure-doc-generated-before-install.patch
@@ -0,0 +1,42 @@
+From 1efb45330f5dbe475a092cda6982e6d7e135485a Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Tue, 10 Aug 2021 13:02:18 +0000
+Subject: [PATCH] Makefile.in: make sure doc generated before install
+
+There is a race between the doc generation and the doc installation,
+so make the install depend on the build for doc to fix the error occurs
+sometimes as below:
+ | TOPDIR/tmp-glibc/hosttools/install: cannot stat 'doc/jemalloc.3': No such file or directory
+ | make: *** [Makefile:513: install_doc_man] Error 1
+
+Upstream-Status: Submitted [https://github.com/jemalloc/jemalloc/pull/2108]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ Makefile.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 7128b007..ab94f0c8 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -501,14 +501,14 @@ install_lib: install_lib_static
+ endif
+ install_lib: install_lib_pc
+
+-install_doc_html:
++install_doc_html: build_doc_html
+ $(INSTALL) -d $(DATADIR)/doc/jemalloc$(install_suffix)
+ @for d in $(DOCS_HTML); do \
+ echo "$(INSTALL) -m 644 $$d $(DATADIR)/doc/jemalloc$(install_suffix)"; \
+ $(INSTALL) -m 644 $$d $(DATADIR)/doc/jemalloc$(install_suffix); \
+ done
+
+-install_doc_man:
++install_doc_man: build_doc_man
+ $(INSTALL) -d $(MANDIR)/man3
+ @for d in $(DOCS_MAN3); do \
+ echo "$(INSTALL) -m 644 $$d $(MANDIR)/man3"; \
+--
+2.29.2
+
diff --git a/meta-openembedded/meta-oe/recipes-devtools/jemalloc/files/run-ptest b/meta-openembedded/meta-oe/recipes-devtools/jemalloc/files/run-ptest
new file mode 100644
index 000000000..b351f947e
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-devtools/jemalloc/files/run-ptest
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+saved_dir=$PWD
+for dir in tests/* ; do
+ cd $dir
+ for atest in * ; do
+ if [ \( -x $atest \) -a \( -f $atest \) ] ; then
+ rm -rf tests.log
+ ./$atest > tests.log 2>&1
+ sed -e '/: pass/ s/^/PASS: /g' \
+ -e '/: skip/ s/^/SKIP: /g' \
+ -e '/: fail/ s/^/FAIL: /g' \
+ -e 's/: pass//g' \
+ -e 's/: skip//g' \
+ -e 's/: fail//g' \
+ -e '/^--- pass:/d' tests.log
+ fi
+ done
+ cd $saved_dir
+done
+
diff --git a/meta-openembedded/meta-oe/recipes-devtools/jemalloc/jemalloc_5.2.1.bb b/meta-openembedded/meta-oe/recipes-devtools/jemalloc/jemalloc_5.2.1.bb
index 39637663f..b5d53bb11 100644
--- a/meta-openembedded/meta-oe/recipes-devtools/jemalloc/jemalloc_5.2.1.bb
+++ b/meta-openembedded/meta-oe/recipes-devtools/jemalloc/jemalloc_5.2.1.bb
@@ -13,14 +13,31 @@ SECTION = "libs"
LIC_FILES_CHKSUM = "file://README;md5=6900e4a158982e4c4715bf16aa54fa10"
-SRC_URI = "git://github.com/jemalloc/jemalloc.git"
+SRC_URI = "git://github.com/jemalloc/jemalloc.git \
+ file://0001-Makefile.in-make-sure-doc-generated-before-install.patch \
+ file://run-ptest \
+"
SRCREV = "ea6b3e973b477b8061e0076bb257dbd7f3faa756"
S = "${WORKDIR}/git"
-inherit autotools
+inherit autotools ptest
EXTRA_AUTORECONF += "--exclude=autoheader"
EXTRA_OECONF:append:libc-musl = " --with-jemalloc-prefix=je_"
+
+do_compile_ptest() {
+ oe_runmake tests
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests
+ subdirs="test/unit test/integration test/stress "
+ for tooltest in ${subdirs}
+ do
+ cp -r ${B}/${tooltest} ${D}${PTEST_PATH}/tests
+ done
+ find ${D}${PTEST_PATH}/tests \( -name "*.d" -o -name "*.o" \) -exec rm -f {} \;
+}