summaryrefslogtreecommitdiffstats
path: root/meta-qat/recipes-extended/zlib-qat
diff options
context:
space:
mode:
Diffstat (limited to 'meta-qat/recipes-extended/zlib-qat')
-rw-r--r--meta-qat/recipes-extended/zlib-qat/zlib-qat/0001-qat_zlib.h-Add-pthread.h-for-MUSL.patch29
-rw-r--r--meta-qat/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-qat_mem-build-qat_mem-ko-against-yocto-kernel-src.patch51
-rw-r--r--meta-qat/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-zlib-Remove-rpaths-from-makefile.patch52
-rw-r--r--meta-qat/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-zlib-qat-add-a-install-target-to-makefile.patch46
-rw-r--r--meta-qat/recipes-extended/zlib-qat/zlib-qat_0.4.7-002.bb133
5 files changed, 311 insertions, 0 deletions
diff --git a/meta-qat/recipes-extended/zlib-qat/zlib-qat/0001-qat_zlib.h-Add-pthread.h-for-MUSL.patch b/meta-qat/recipes-extended/zlib-qat/zlib-qat/0001-qat_zlib.h-Add-pthread.h-for-MUSL.patch
new file mode 100644
index 00000000..b45ae794
--- /dev/null
+++ b/meta-qat/recipes-extended/zlib-qat/zlib-qat/0001-qat_zlib.h-Add-pthread.h-for-MUSL.patch
@@ -0,0 +1,29 @@
1From 30c4a1181cbe696dd1b9f52c8e9422ef8c331e8f Mon Sep 17 00:00:00 2001
2From: Saul Wold <sgw@linux.intel.com>
3Date: Thu, 9 Feb 2017 12:40:47 -0800
4Subject: [PATCH] qat_zlib.h: Add pthread.h for MUSL
5
6MUSL is stricter when it comes to header file inclusion, so add
7the additional header thats needed to compile with MUSL.
8
9Upstream-Status: Pending
10Signed-off-by: Saul Wold <sgw@linux.intel.com>
11---
12 qat_zlib.h | 1 +
13 1 file changed, 1 insertion(+)
14
15diff --git a/qat_zlib.h b/qat_zlib.h
16index 2747f84..d9ac312 100644
17--- a/qat_zlib.h
18+++ b/qat_zlib.h
19@@ -8,6 +8,7 @@
20 #include <stdlib.h>
21 #include <assert.h>
22 #include <time.h>
23+#include <pthread.h>
24
25 #include "cpa_dc.h"
26 #ifdef USE_QAE_MEM
27--
282.7.4
29
diff --git a/meta-qat/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-qat_mem-build-qat_mem-ko-against-yocto-kernel-src.patch b/meta-qat/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-qat_mem-build-qat_mem-ko-against-yocto-kernel-src.patch
new file mode 100644
index 00000000..9e774db2
--- /dev/null
+++ b/meta-qat/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-qat_mem-build-qat_mem-ko-against-yocto-kernel-src.patch
@@ -0,0 +1,51 @@
1From aa65d69632142d24ec44ed4c2d66371e1a1be7b4 Mon Sep 17 00:00:00 2001
2From: Anuj Mittal <anujx.mittal@intel.com>
3Date: Thu, 18 Jun 2015 11:56:08 +0800
4Subject: [PATCH] qat_mem: build qat_mem ko against yocto kernel src
5
6Upstream-Status: Inappropriate [Configuration]
7
8This tweaks the kernel source and build path in the makefile
9to make sure the module is built against the right source.
10
11Signed-off-by: Anuj Mittal <anujx.mittal@intel.com>
12---
13 contrib/qat/qat_mem/Makefile | 13 +++++--------
14 1 file changed, 5 insertions(+), 8 deletions(-)
15
16diff --git a/contrib/qat/qat_mem/Makefile b/contrib/qat/qat_mem/Makefile
17index ddf5b59..ad6d4a4 100644
18--- a/contrib/qat/qat_mem/Makefile
19+++ b/contrib/qat/qat_mem/Makefile
20@@ -61,16 +61,10 @@
21 #########################################################################
22
23 MODULENAME := qat_mem
24-KDIR := /lib/modules/$(shell uname -r)/build
25+KDIR := $(KERNEL_SOURCE_ROOT)
26 PWD := $(shell pwd)
27
28-ifeq ($(shell uname -r|grep -c grsec-WR), 1)
29-AUTO_CONF=/lib/modules/$(shell uname -r)/build/include/generated/autoconf.h
30-else
31-AUTO_CONF=/usr/src/kernels/$(shell uname -r)/include/linux/autoconf.h
32-endif
33-
34-CC := gcc -Wall -imacros $(AUTO_CONF)
35+CC := ${CC} -Wall -imacros $(KERNEL_BUILDDIR)/include/generated/autoconf.h
36
37 ifeq ($(KERNELRELEASE),)
38 all: $(MODULENAME)_test
39@@ -80,6 +74,9 @@ else
40 obj-m := $(MODULENAME).o
41 endif
42
43+modules_install:
44+ $(MAKE) -C $(KDIR) M=$(PWD) modules_install
45+
46 $(MODULENAME)_test: $(MODULENAME)_test.c
47 $(CC) -g -o $(MODULENAME)_test $(MODULENAME)_test.c
48
49--
501.7.9.5
51
diff --git a/meta-qat/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-zlib-Remove-rpaths-from-makefile.patch b/meta-qat/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-zlib-Remove-rpaths-from-makefile.patch
new file mode 100644
index 00000000..c3605112
--- /dev/null
+++ b/meta-qat/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-zlib-Remove-rpaths-from-makefile.patch
@@ -0,0 +1,52 @@
1From aad2675c7bb635d8b7be47fa89a3ee87ba19d2e8 Mon Sep 17 00:00:00 2001
2From: Anuj Mittal <anujx.mittal@intel.com>
3Date: Thu, 18 Jun 2015 11:46:17 +0800
4Subject: [PATCH] zlib: Remove rpaths from makefile
5
6Upstream-Status: Inappropriate [configuration]
7
8This removes references to RPATHS that are no longer
9necesary when building using bitbake.
10
11Signed-off-by: Anuj Mittal <anujx.mittal@intel.com>
12---
13 Makefile.in | 4 ++--
14 contrib/qat/qat_zlib_test/Makefile | 3 ---
15 2 files changed, 2 insertions(+), 5 deletions(-)
16
17diff --git a/Makefile.in b/Makefile.in
18index 94d8a80..cba5291 100644
19--- a/Makefile.in
20+++ b/Makefile.in
21@@ -59,12 +59,12 @@ ICP_LAC_API_DIR=$(ICP_API_DIR)/lac/
22 ICP_DC_API_DIR=$(ICP_API_DIR)/dc/
23 CFLAGS+=-D_GNU_SOURCE -I$(ICP_API_DIR) -I$(ICP_DC_API_DIR) -I$(ICP_LAC_API_DIR) -I$(ICP_SAL_API_DIR)
24 SFLAGS+=-D_GNU_SOURCE -I$(ICP_API_DIR) -I$(ICP_DC_API_DIR) -I$(ICP_LAC_API_DIR) -I$(ICP_SAL_API_DIR)
25-ADDITIONAL_LDFLAGS+=-Wl,-rpath,$(ZLIB_ROOT) -lz
26+#ADDITIONAL_LDFLAGS+=-Wl,-rpath,$(ZLIB_ROOT) -lz
27 SHARED_APP_FLAGS=-Wl,-rpath,$(ZLIB_ROOT) -L$(ZLIB_ROOT) -lz
28
29 ifdef ICP_BUILD_OUTPUT
30 TEST_LDFLAGS+=-L$(ICP_BUILD_OUTPUT)
31- ADDITIONAL_LDFLAGS+=-Wl,-rpath,$(ICP_BUILD_OUTPUT) -L$(ICP_BUILD_OUTPUT)
32+# ADDITIONAL_LDFLAGS+=-Wl,-rpath,$(ICP_BUILD_OUTPUT) -L$(ICP_BUILD_OUTPUT)
33 endif
34
35 ifdef ZLIB_DH895XCC
36diff --git a/contrib/qat/qat_zlib_test/Makefile b/contrib/qat/qat_zlib_test/Makefile
37index 8a29a92..ca31dd2 100644
38--- a/contrib/qat/qat_zlib_test/Makefile
39+++ b/contrib/qat/qat_zlib_test/Makefile
40@@ -84,9 +84,6 @@ OBJS = $(SRCS:%.c=%.o)
41 COVERAGE_OBJS =
42 EXE=
43 LIBQAT=
44-ifdef ICP_BUILD_OUTPUT
45- LIBQAT+= -Wl,-rpath,$(ICP_BUILD_OUTPUT) -L$(ICP_BUILD_OUTPUT)
46-endif
47
48 DRIVER=icp_qa_al
49 ifdef WITH_CPA_MUX
50--
511.7.9.5
52
diff --git a/meta-qat/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-zlib-qat-add-a-install-target-to-makefile.patch b/meta-qat/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-zlib-qat-add-a-install-target-to-makefile.patch
new file mode 100644
index 00000000..c7aec55a
--- /dev/null
+++ b/meta-qat/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-zlib-qat-add-a-install-target-to-makefile.patch
@@ -0,0 +1,46 @@
1From d78121d790c4a248bc47d1c662791fe57ac4af38 Mon Sep 17 00:00:00 2001
2From: Anuj Mittal <anujx.mittal@intel.com>
3Date: Thu, 18 Jun 2015 11:53:23 +0800
4Subject: [PATCH] zlib-qat: add a install target to makefile
5
6Upstream-Status: Inappropriate [Configuration]
7
8This adds an install target to qat_zlib_test and qat_mem makefiles
9to facilitate the installation of test binaries to {D}.
10
11Signed-off-by: Anuj Mittal <anujx.mittal@intel.com>
12---
13 contrib/qat/qat_mem/Makefile | 3 +++
14 contrib/qat/qat_zlib_test/Makefile | 3 +++
15 2 files changed, 6 insertions(+)
16
17diff --git a/contrib/qat/qat_mem/Makefile b/contrib/qat/qat_mem/Makefile
18index ad6d4a4..e4d77b6 100644
19--- a/contrib/qat/qat_mem/Makefile
20+++ b/contrib/qat/qat_mem/Makefile
21@@ -74,6 +74,9 @@ else
22 obj-m := $(MODULENAME).o
23 endif
24
25+install: modules_install
26+ cp qat_mem_test $(INSTALL_MOD_PATH)$(bindir)
27+
28 modules_install:
29 $(MAKE) -C $(KDIR) M=$(PWD) modules_install
30
31diff --git a/contrib/qat/qat_zlib_test/Makefile b/contrib/qat/qat_zlib_test/Makefile
32index ca31dd2..7da5ddd 100644
33--- a/contrib/qat/qat_zlib_test/Makefile
34+++ b/contrib/qat/qat_zlib_test/Makefile
35@@ -112,5 +112,8 @@ comptestappsh$(EXE): $(OBJS) Makefile
36 $(CC) -o comptestappsh $(OBJS) $(COVERAGE) \
37 $(SHAREDLIBQAT)
38
39+install:
40+ cp comptestapp $(DESTDIR)$(bindir)
41+
42 clean:
43 rm -f $(OBJS) $(COVERAGE_OBJS) comptestapp comptestappsh
44--
451.7.9.5
46
diff --git a/meta-qat/recipes-extended/zlib-qat/zlib-qat_0.4.7-002.bb b/meta-qat/recipes-extended/zlib-qat/zlib-qat_0.4.7-002.bb
new file mode 100644
index 00000000..f5b247b2
--- /dev/null
+++ b/meta-qat/recipes-extended/zlib-qat/zlib-qat_0.4.7-002.bb
@@ -0,0 +1,133 @@
1SUMMARY = "Zlib QAT_MEM Memory Management Module for Intel Quick Assist \
2Technology"
3
4DESCRIPTION = "This software acelerates the data compression algorithm \
5in the zlib software library via the Intel QuickAssist Technology \
6implemented on Intel Communications Chipset 89xx and 895x Series based platforms."
7
8HOMEPAGE = "http://zlib.net/"
9SECTION = "libs"
10LICENSE = "Zlib & GPLv2 & BSD"
11LIC_FILES_CHKSUM = "file://${WORKDIR}/zlib-${ZLIB_VERSION}/zlib.h;beginline=4;endline=23;md5=fde612df1e5933c428b73844a0c494fd \
12 file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 \
13 file://${COMMON_LICENSE_DIR}/BSD;md5=3775480a712fc46a69647678acb234cb"
14
15# For target side versions of openssl enable support for OCF Linux driver
16# if they are available.
17DEPENDS += "cryptodev-linux pkgconfig virtual/qat"
18
19SRC_URI = "http://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz;name=zlib \
20 https://01.org/sites/default/files/page/zlib_shim_0.4.7-002_withdocumentation.zip;name=zlibqat \
21 file://zlib-qat-0.4.7-002-qat_mem-build-qat_mem-ko-against-yocto-kernel-src.patch \
22 file://zlib-qat-0.4.7-002-zlib-qat-add-a-install-target-to-makefile.patch \
23 file://zlib-qat-0.4.7-002-zlib-Remove-rpaths-from-makefile.patch \
24 "
25SRC_URI_append_libc-musl = " file://0001-qat_zlib.h-Add-pthread.h-for-MUSL.patch"
26
27SRC_URI[zlib.md5sum] = "44d667c142d7cda120332623eab69f40"
28SRC_URI[zlib.sha256sum] = "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d"
29
30SRC_URI[zlibqat.md5sum] = "dfde8618198aa8d35ecc00d10dcc7000"
31SRC_URI[zlibqat.sha256sum] = "8e5786400bbc2a879ae705c864ec63b53ae019b4f2d1c94524a97223847b6e46"
32
33COMPATIBLE_MACHINE = "crystalforest|intel-corei7-64"
34
35ZLIB_VERSION = "1.2.8"
36ZLIB_QAT_VERSION = "0.4.7-002"
37QAT_PATCH_VERSION = "l.0.4.7_002"
38
39S = "${WORKDIR}/zlib-${ZLIB_VERSION}"
40
41export ICP_ROOT = "${S}"
42export ZLIB_ROOT = "${S}"
43export KERNEL_SOURCE_ROOT = "${STAGING_KERNEL_DIR}"
44export KERNEL_BUILDDIR = "${STAGING_KERNEL_BUILDDIR}"
45export ICP_LAC_API_DIR = "${STAGING_DIR_TARGET}${includedir}/lac"
46export ICP_DC_API_DIR = "${STAGING_DIR_TARGET}${includedir}/dc"
47export ZLIB_DH895XCC = "1"
48export ZLIB_MEMORY_DRIVER = "qat_mem"
49export ICP_BUILD_OUTPUT = "${STAGING_DIR_TARGET}"
50EXTRA_OEMAKE = "-e MAKEFLAGS="
51TARGET_CC_ARCH += "${LDFLAGS}"
52
53inherit module
54MEM_PATH = "${S}/contrib/qat"
55
56zlibqat_do_patch() {
57 cd ${WORKDIR}
58 unzip -q -o zlib_quickassist_patch_${QAT_PATCH_VERSION}_stable.zip
59 cd zlib_quickassist_patch_${QAT_PATCH_VERSION}_devbranch
60 tar -xvzf zlib-${ZLIB_VERSION}-qat.L.${ZLIB_QAT_VERSION}.tar.gz
61 cp -f zlib-${ZLIB_VERSION}-qat.patch ${WORKDIR}
62 cd ${S}
63 if [ ! -d ${S}/debian/patches ]; then
64 mkdir -p ${S}/debian/patches
65 cp -f ${WORKDIR}/zlib-${ZLIB_VERSION}-qat.patch ${S}/debian/patches
66 echo "zlib-${ZLIB_VERSION}-qat.patch -p1" > ${S}/debian/patches/series
67 fi
68 quilt pop -a || true
69 if [ -d ${S}/.pc-zlibqat ]; then
70 rm -rf ${S}/.pc
71 mv ${S}/.pc-zlibqat ${S}/.pc
72 QUILT_PATCHES=${S}/debian/patches quilt pop -a
73 rm -rf ${S}/.pc
74 fi
75 QUILT_PATCHES=${S}/debian/patches quilt push -a
76 mv ${S}/.pc ${S}/.pc-zlibqat
77}
78
79# We invoke base do_patch at end, to incorporate any local patch
80python do_patch() {
81 bb.build.exec_func('zlibqat_do_patch', d)
82 bb.build.exec_func('patch_do_patch', d)
83}
84
85#addtask zlibqat_patch after do_prepare_recipe_sysroot before patch_do_patch
86#addtask do_zlibqat_patch after do_prepare_recipe_sysroot before do_configure
87
88do_configure() {
89 ./configure --prefix=${prefix} --shared --libdir=${libdir}
90}
91
92do_compile() {
93 unset CFLAGS CXXFLAGS
94 oe_runmake
95
96 cd ${S}/contrib/qat/qat_mem
97 oe_runmake
98
99 cd ${S}/contrib/qat/qat_zlib_test
100 oe_runmake
101}
102
103do_install() {
104 install -m 0755 -d ${D}${bindir}/
105 install -m 0755 -d ${D}${sysconfdir}/zlib_conf/
106
107 install -m 0755 zpipe ${D}${bindir}
108 install -m 0755 minigzip ${D}${bindir}
109
110 cd ${MEM_PATH}/qat_mem
111 oe_runmake INSTALL_MOD_PATH=${D} INSTALL_MOD_DIR="kernel/drivers" install
112
113 cd ${S}/contrib/qat/qat_zlib_test
114 oe_runmake DESTDIR=${D} install
115
116 install -m 660 ${MEM_PATH}/config/dh895xcc/multi_thread_optimized/* ${D}${sysconfdir}/zlib_conf/
117}
118
119PACKAGES += "${PN}-app"
120
121FILES_${PN} += " \
122 ${sysconfdir}/zlib_conf/ \
123 "
124
125FILES_${PN}-app += " \
126 ${bindir}/* \
127 "
128
129FILES_${PN}-dbg += " \
130 ${bindir}/.debug \
131 "
132
133EXCLUDE_FROM_WORLD_core2-32-intel-common = "1"