diff options
author | Alistair Francis <alistair.francis@wdc.com> | 2018-09-12 13:30:52 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2018-09-12 21:14:26 -0700 |
commit | ec8195223427013a31a1487433824613fe4ff518 (patch) | |
tree | f474fe13af1fb5a69eeb9404f0d2769e010a8618 | |
parent | e5e95cf3a3c18d9fe23ce662695d861398acacbe (diff) | |
download | meta-openembedded-ec8195223427013a31a1487433824613fe4ff518.tar.gz |
pmdk: Initial commit of the PMDK SDK
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
7 files changed, 242 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/pmdk/files/0001-jemalloc-jemalloc.cfg-Specify-the-host-when-building.patch b/meta-oe/recipes-extended/pmdk/files/0001-jemalloc-jemalloc.cfg-Specify-the-host-when-building.patch new file mode 100644 index 000000000..747538b0c --- /dev/null +++ b/meta-oe/recipes-extended/pmdk/files/0001-jemalloc-jemalloc.cfg-Specify-the-host-when-building.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 2a22dc96c3bbb5c9bbcc008f58d4f5c64e3d19e6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alistair Francis <alistair.francis@wdc.com> | ||
3 | Date: Mon, 23 Jul 2018 11:23:39 -0700 | ||
4 | Subject: [PATCH] jemalloc/jemalloc.cfg: Specify the host when building | ||
5 | jemalloc | ||
6 | |||
7 | To avoid this error: | ||
8 | configure: error: cannot run C compiled programs. | ||
9 | If you meant to cross compile, use `--host'. | ||
10 | when cross compiling specify the host when configuring jemalloc. | ||
11 | |||
12 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
13 | Upstream-Status: Inappropriate [configuration] | ||
14 | --- | ||
15 | src/jemalloc/jemalloc.cfg | 1 + | ||
16 | 1 file changed, 1 insertion(+) | ||
17 | |||
18 | diff --git a/src/jemalloc/jemalloc.cfg b/src/jemalloc/jemalloc.cfg | ||
19 | index 196129de6..79ebbab1c 100644 | ||
20 | --- a/src/jemalloc/jemalloc.cfg | ||
21 | +++ b/src/jemalloc/jemalloc.cfg | ||
22 | @@ -3,3 +3,4 @@ | ||
23 | --with-private-namespace=je_vmem_ | ||
24 | --disable-xmalloc | ||
25 | --disable-munmap | ||
26 | +--host=${HOST_SYS} | ||
27 | -- | ||
28 | 2.17.1 | ||
29 | |||
diff --git a/meta-oe/recipes-extended/pmdk/files/0002-Makefile-Don-t-install-the-docs.patch b/meta-oe/recipes-extended/pmdk/files/0002-Makefile-Don-t-install-the-docs.patch new file mode 100644 index 000000000..bd1b97c24 --- /dev/null +++ b/meta-oe/recipes-extended/pmdk/files/0002-Makefile-Don-t-install-the-docs.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | From 460a96e390cb80278784cfe36629e280fe7ffef7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alistair Francis <alistair.francis@wdc.com> | ||
3 | Date: Mon, 23 Jul 2018 11:31:17 -0700 | ||
4 | Subject: [PATCH 2/2] Makefile: Don't install the docs | ||
5 | |||
6 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
7 | Upstream-Status: Inappropriate [disable feature] | ||
8 | --- | ||
9 | Makefile | 1 - | ||
10 | 1 file changed, 1 deletion(-) | ||
11 | |||
12 | diff --git a/Makefile b/Makefile | ||
13 | index 224a315f6..ce7f84afb 100644 | ||
14 | --- a/Makefile | ||
15 | +++ b/Makefile | ||
16 | @@ -144,7 +144,6 @@ rpm dpkg: pkg-clean source | ||
17 | |||
18 | install uninstall: | ||
19 | $(MAKE) -C src $@ | ||
20 | - $(MAKE) -C doc $@ | ||
21 | |||
22 | .PHONY: all clean clobber test check cstyle check-license install uninstall\ | ||
23 | source rpm dpkg pkg-clean pcheck check-remote format doc $(SUBDIRS) | ||
24 | -- | ||
25 | 2.17.1 | ||
26 | |||
diff --git a/meta-oe/recipes-extended/pmdk/files/0003-Makefile-Don-t-build-the-examples.patch b/meta-oe/recipes-extended/pmdk/files/0003-Makefile-Don-t-build-the-examples.patch new file mode 100644 index 000000000..f75d94197 --- /dev/null +++ b/meta-oe/recipes-extended/pmdk/files/0003-Makefile-Don-t-build-the-examples.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From a7f07dca2468ea226d2f07fc0105166e75cadaf8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alistair Francis <alistair.francis@wdc.com> | ||
3 | Date: Thu, 6 Sep 2018 16:18:50 -0700 | ||
4 | Subject: [PATCH] Makefile: Don't build the examples | ||
5 | |||
6 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
7 | Upstream-Status: Inappropriate [disable feature] | ||
8 | --- | ||
9 | src/Makefile | 4 ++-- | ||
10 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
11 | |||
12 | diff --git a/src/Makefile b/src/Makefile | ||
13 | index 4b50dd8b5..e00501e31 100644 | ||
14 | --- a/src/Makefile | ||
15 | +++ b/src/Makefile | ||
16 | @@ -38,13 +38,13 @@ include $(TOP)/src/version.inc | ||
17 | |||
18 | TARGETS = libpmem libvmem libpmemblk libpmemlog libpmemobj libpmempool\ | ||
19 | libpmemcto libvmmalloc tools | ||
20 | -ALL_TARGETS = $(TARGETS) common librpmem examples benchmarks | ||
21 | +ALL_TARGETS = $(TARGETS) common librpmem benchmarks | ||
22 | |||
23 | SCOPE_DIRS = $(TARGETS) common librpmem rpmem_common | ||
24 | |||
25 | DEBUG_RELEASE_TARGETS = common libpmem libvmem libpmemblk libpmemlog libpmemobj\ | ||
26 | libpmempool libvmmalloc librpmem libpmemcto | ||
27 | -RELEASE_TARGETS = tools examples benchmarks | ||
28 | +RELEASE_TARGETS = tools benchmarks | ||
29 | |||
30 | CLEAN_NO_JE_TARGETS = $(ALL_TARGETS) rpmem_common test | ||
31 | CLEAN_TARGETS = $(CLEAN_NO_JE_TARGETS) jemalloc | ||
32 | -- | ||
33 | 2.17.1 | ||
34 | |||
diff --git a/meta-oe/recipes-extended/pmdk/files/0004-os_posix-Manually-implement-secure_getenv-if-require.patch b/meta-oe/recipes-extended/pmdk/files/0004-os_posix-Manually-implement-secure_getenv-if-require.patch new file mode 100644 index 000000000..624f17bd4 --- /dev/null +++ b/meta-oe/recipes-extended/pmdk/files/0004-os_posix-Manually-implement-secure_getenv-if-require.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From 33affa9ee97691efb73f439fcdba4adb8625a26a Mon Sep 17 00:00:00 2001 | ||
2 | From: Alistair Francis <alistair.francis@wdc.com> | ||
3 | Date: Mon, 10 Sep 2018 12:59:48 -0700 | ||
4 | Subject: [PATCH] os_posix: Manually implement secure_getenv() if required | ||
5 | |||
6 | Manually implement the secure_getenv() if we need to, this is required | ||
7 | if using musl. | ||
8 | |||
9 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
10 | Upstream-Status: Pending | ||
11 | --- | ||
12 | src/common/os_posix.c | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/src/common/os_posix.c b/src/common/os_posix.c | ||
16 | index 2d70a0a29..fb09b6ce0 100644 | ||
17 | --- a/src/common/os_posix.c | ||
18 | +++ b/src/common/os_posix.c | ||
19 | @@ -261,7 +261,7 @@ os_setenv(const char *name, const char *value, int overwrite) | ||
20 | /* | ||
21 | * secure_getenv -- provide GNU secure_getenv for FreeBSD | ||
22 | */ | ||
23 | -#ifdef __FreeBSD__ | ||
24 | +#if defined(__FreeBSD__) || !HAVE___SECURE_GETENV | ||
25 | static char * | ||
26 | secure_getenv(const char *name) | ||
27 | { | ||
28 | -- | ||
29 | 2.17.1 | ||
30 | |||
diff --git a/meta-oe/recipes-extended/pmdk/files/0005-pmempool-Remove-unused-__USE_UNIX98-define.patch b/meta-oe/recipes-extended/pmdk/files/0005-pmempool-Remove-unused-__USE_UNIX98-define.patch new file mode 100644 index 000000000..75c35f865 --- /dev/null +++ b/meta-oe/recipes-extended/pmdk/files/0005-pmempool-Remove-unused-__USE_UNIX98-define.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From 92e63699ea83074298971b0251f002562be4dbd3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alistair Francis <alistair.francis@wdc.com> | ||
3 | Date: Mon, 10 Sep 2018 13:23:37 -0700 | ||
4 | Subject: [PATCH 2/3] pmempool: Remove unused __USE_UNIX98 define | ||
5 | |||
6 | Remove the unused __USE_UNIX98 to fix musl build failures. | ||
7 | |||
8 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
9 | Upstream-Status: Pending | ||
10 | --- | ||
11 | src/tools/pmempool/info.c | 3 --- | ||
12 | 1 file changed, 3 deletions(-) | ||
13 | |||
14 | diff --git a/src/tools/pmempool/info.c b/src/tools/pmempool/info.c | ||
15 | index b4010bf35..7b890a123 100644 | ||
16 | --- a/src/tools/pmempool/info.c | ||
17 | +++ b/src/tools/pmempool/info.c | ||
18 | @@ -45,9 +45,6 @@ | ||
19 | #include <inttypes.h> | ||
20 | #include <assert.h> | ||
21 | #include <sys/param.h> | ||
22 | -#ifndef __FreeBSD__ | ||
23 | -#define __USE_UNIX98 | ||
24 | -#endif | ||
25 | #include <unistd.h> | ||
26 | #include <sys/mman.h> | ||
27 | |||
28 | -- | ||
29 | 2.17.1 | ||
30 | |||
diff --git a/meta-oe/recipes-extended/pmdk/files/0006-Makefile.inc-Allow-extra-libs-to-be-specified.patch b/meta-oe/recipes-extended/pmdk/files/0006-Makefile.inc-Allow-extra-libs-to-be-specified.patch new file mode 100644 index 000000000..2042fdb25 --- /dev/null +++ b/meta-oe/recipes-extended/pmdk/files/0006-Makefile.inc-Allow-extra-libs-to-be-specified.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From a88e806f9ce8cc071e81abad688643d53f393176 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alistair Francis <alistair.francis@wdc.com> | ||
3 | Date: Mon, 10 Sep 2018 14:18:38 -0700 | ||
4 | Subject: [PATCH 3/3] Makefile.inc: Allow extra libs to be specified | ||
5 | |||
6 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
7 | Upstream-Status: Pending | ||
8 | --- | ||
9 | src/Makefile.inc | 2 ++ | ||
10 | src/common.inc | 2 ++ | ||
11 | src/tools/Makefile.inc | 1 + | ||
12 | 3 files changed, 5 insertions(+) | ||
13 | |||
14 | diff --git a/src/common.inc b/src/common.inc | ||
15 | index 032cb83ea..2d5c4bedf 100644 | ||
16 | --- a/src/common.inc | ||
17 | +++ b/src/common.inc | ||
18 | @@ -74,6 +74,8 @@ GCOV_CFLAGS=-fprofile-arcs -ftest-coverage --coverage | ||
19 | GCOV_LDFLAGS=-fprofile-arcs -ftest-coverage | ||
20 | GCOV_LIBS=-lgcov | ||
21 | |||
22 | +LIBS += $(EXTRA_LIBS) | ||
23 | + | ||
24 | osdep = $(1)_$(shell uname -s | tr "[:upper:]" "[:lower:]")$(2) | ||
25 | get_arch = $(shell $(CC) -dumpmachine | awk -F'[/-]' '{print $$1}') | ||
26 | |||
27 | -- | ||
28 | 2.17.1 | ||
29 | |||
diff --git a/meta-oe/recipes-extended/pmdk/pmdk_1.4.2.bb b/meta-oe/recipes-extended/pmdk/pmdk_1.4.2.bb new file mode 100644 index 000000000..3da22a970 --- /dev/null +++ b/meta-oe/recipes-extended/pmdk/pmdk_1.4.2.bb | |||
@@ -0,0 +1,64 @@ | |||
1 | SUMMARY = "Persistent Memory Development Kit" | ||
2 | DESCRIPTION = "Persistent Memory Development Kit" | ||
3 | HOMEPAGE = "http://pmem.io" | ||
4 | SECTION = "libs" | ||
5 | LICENSE = "BSD" | ||
6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=7db1106255a1baa80391fd2e21eebab7" | ||
7 | DEPENDS = "ndctl" | ||
8 | |||
9 | # Required to have the fts.h header for musl | ||
10 | DEPENDS_append_libc-musl = " fts" | ||
11 | |||
12 | SRC_URI = "https://github.com/pmem/${BPN}/archive/${PV}.tar.gz \ | ||
13 | file://0001-jemalloc-jemalloc.cfg-Specify-the-host-when-building.patch \ | ||
14 | file://0002-Makefile-Don-t-install-the-docs.patch \ | ||
15 | file://0003-Makefile-Don-t-build-the-examples.patch \ | ||
16 | file://0005-pmempool-Remove-unused-__USE_UNIX98-define.patch \ | ||
17 | file://0006-Makefile.inc-Allow-extra-libs-to-be-specified.patch \ | ||
18 | " | ||
19 | |||
20 | SRC_URI_append_libc-musl = " file://0004-os_posix-Manually-implement-secure_getenv-if-require.patch" | ||
21 | |||
22 | SRC_URI[md5sum] = "bde73bca9ef5b90911deb0fdcfb15ccf" | ||
23 | SRC_URI[sha256sum] = "df7e658e75d28cd80f6d2ff7b9fc9ae2885d52f8923fdbacecfd46215115fb4c" | ||
24 | |||
25 | inherit autotools-brokensep pkgconfig | ||
26 | |||
27 | # Fix jemalloc error: | ||
28 | # | configure: error: cannot run C compiled programs. | ||
29 | # | If you meant to cross compile, use `--host'. | ||
30 | # | ||
31 | # Also fix #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp] | ||
32 | EXTRA_OEMAKE = "HOST_SYS='${HOST_SYS}' EXTRA_CFLAGS='${SELECTED_OPTIMIZATION}'" | ||
33 | |||
34 | # Fix the missing fts libs when using musl | ||
35 | EXTRA_OEMAKE_append_libc-musl = " EXTRA_LIBS='-lfts'" | ||
36 | |||
37 | do_install() { | ||
38 | oe_runmake PREFIX=${prefix} DESTDIR=${D} install | ||
39 | |||
40 | # Copy these into the standard directories | ||
41 | install -d ${D}${bindir}/ | ||
42 | mv ${D}/usr/local/bin/pmempool ${D}${bindir}/ | ||
43 | mv ${D}/usr/local/bin/daxio ${D}${bindir}/ | ||
44 | |||
45 | install -d ${D}${libdir} | ||
46 | mv ${D}/usr/local/lib/*so* ${D}${libdir}/ | ||
47 | |||
48 | install -d ${D}${libdir}/pkgconfig | ||
49 | mv ${D}/usr/local/lib/pkgconfig/*.pc ${D}${libdir}/pkgconfig/ | ||
50 | |||
51 | install -d ${D}${includedir} | ||
52 | mv ${D}/usr/local/include/* ${D}${includedir}/ | ||
53 | |||
54 | # Remove uneeded files | ||
55 | rm -rf ${D}/usr/local/ | ||
56 | } | ||
57 | |||
58 | # Include these by default otherwise the SDK is not very useful | ||
59 | FILES_${PN} += "${bindir}/pmempool ${bindir}/daxio" | ||
60 | FILES_${PN} += "${libdir}/*so*" | ||
61 | FILES_${PN} += "${libdir}/pkgconfig/*.pc" | ||
62 | FILES_${PN} += "${includedir}/libpmemobj++/* ${includedir}/libpmemobj/*" | ||
63 | |||
64 | COMPATIBLE_HOST='(x86_64).*' | ||