summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-07-13 22:40:02 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2017-07-24 18:57:34 +0200
commit68b6fbf28a368ec34c51c8e6a7003fb5c1083554 (patch)
tree10f11ce742cf4a37e91b42ecec1f906065e184c4 /meta-oe
parent4ff2e26dedff9caa14ffef57a7002b0fd021c17d (diff)
downloadmeta-openembedded-68b6fbf28a368ec34c51c8e6a7003fb5c1083554.tar.gz
lmbench: Fix build with musl
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-Check-for-musl-define-guard-before-redefining-sockle.patch29
-rw-r--r--meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch76
-rw-r--r--meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb8
3 files changed, 112 insertions, 1 deletions
diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-Check-for-musl-define-guard-before-redefining-sockle.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-Check-for-musl-define-guard-before-redefining-sockle.patch
new file mode 100644
index 000000000..20791bf23
--- /dev/null
+++ b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-Check-for-musl-define-guard-before-redefining-sockle.patch
@@ -0,0 +1,29 @@
1From 31d58ed7e6552781f415501e96d7cc74f83b910d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 12 Jul 2017 18:08:51 -0700
4Subject: [PATCH 1/2] Check for musl define guard before redefining socklen_t
5
6musl uses __DEFINED_socklen_t so check for that as well
7along with HAVE_socklen_t
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 src/bench.h | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/src/bench.h b/src/bench.h
15index 597d068..2ebdf5a 100644
16--- a/src/bench.h
17+++ b/src/bench.h
18@@ -77,7 +77,7 @@ typedef long long int64;
19 #endif /* HAVE_int64_t */
20 #endif /* HAVE_int64 */
21
22-#ifndef HAVE_socklen_t
23+#if !defined(HAVE_socklen_t) && !defined(__DEFINED_socklen_t)
24 typedef int socklen_t;
25 #endif
26
27--
282.13.2
29
diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch
new file mode 100644
index 000000000..d5c8f5f2f
--- /dev/null
+++ b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch
@@ -0,0 +1,76 @@
1From 76f3a9abc2ff96155425ef97d8c5520cfbc8fe6a Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 12 Jul 2017 18:09:46 -0700
4Subject: [PATCH 2/2] build: Adjust CFLAGS/LDFLAGS to append values passed from
5 env
6
7For musl we have to pass additional arguments via cflags and ldflags
8to link in librirpc, make room for those changes to take effect
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 scripts/build | 2 +-
13 src/Makefile | 14 +++++++-------
14 2 files changed, 8 insertions(+), 8 deletions(-)
15
16diff --git a/scripts/build b/scripts/build
17index 34a1371..3786741 100755
18--- a/scripts/build
19+++ b/scripts/build
20@@ -18,7 +18,7 @@ done
21
22 trap 'rm -f ${BASE}$$.s ${BASE}$$.c ${BASE}$$.o ${BASE}$$; exit 1' 1 2 15
23
24-LDLIBS=-lm
25+LDLIBS+=-lm
26
27 # check for HP-UX's ANSI compiler
28 echo "main(int ac, char *av[]) { int i; }" > ${BASE}$$.c
29diff --git a/src/Makefile b/src/Makefile
30index d9efd54..96467d7 100644
31--- a/src/Makefile
32+++ b/src/Makefile
33@@ -112,8 +112,8 @@ LIBOBJS= $O/lib_tcp.o $O/lib_udp.o $O/lib_unix.o $O/lib_timing.o \
34 $O/lib_sched.o
35
36 lmbench: $(UTILS)
37- @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all
38- -@env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="k$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt
39+ @env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all
40+ -@env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="k$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt
41
42 results: lmbench
43 @env OS="${OS}" ../scripts/config-run
44@@ -137,7 +137,7 @@ os: lmbench
45 @env OS="${OS}" BENCHMARK_HARDWARE=NO BENCHMARK_OS=YES ../scripts/results
46
47 install: lmbench
48- @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build install-target
49+ @env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build install-target
50
51 install-target:
52 if [ ! -d $(BASE) ]; then mkdir $(BASE); fi
53@@ -155,16 +155,16 @@ all: $(EXES) $O/lmbench
54 opt: $(OPT_EXES)
55 asm: $(ASMS)
56 $(ASMS):
57- $(CC) -S $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ `basename $@ .s`.c
58+ $(CC) -S $(CFLAGS) $(CPPFLAGS) -o $@ `basename $@ .s`.c $(LDFLAGS)
59
60 Wall:
61- @env CFLAGS="-g -O -Wall" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt
62+ @env CFLAGS+="-g -O -Wall" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt
63
64 debug:
65- @env CFLAGS="-g -O -DDEBUG" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt
66+ @env CFLAGS+="-g -O -DDEBUG" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt
67
68 assembler:
69- @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build asm
70+ @env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build asm
71
72
73 tag:
74--
752.13.2
76
diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb b/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb
index 43ac1d038..03b3721ca 100644
--- a/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb
+++ b/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb
@@ -7,6 +7,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
7 7
8inherit autotools-brokensep 8inherit autotools-brokensep
9 9
10DEPENDS_append_libc-musl = " libtirpc"
11CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
12LDLIBS_append_libc-musl = " -ltirpc "
13
10PR = "r2" 14PR = "r2"
11 15
12SRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \ 16SRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \
@@ -20,12 +24,14 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \
20 file://fix-lmbench-memory-check-failure.patch \ 24 file://fix-lmbench-memory-check-failure.patch \
21 file://0001-avoid-gcc-optimize-away-the-loops.patch \ 25 file://0001-avoid-gcc-optimize-away-the-loops.patch \
22 file://0001-lat_http.c-Add-printf-format.patch \ 26 file://0001-lat_http.c-Add-printf-format.patch \
27 file://0001-Check-for-musl-define-guard-before-redefining-sockle.patch \
28 file://0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch \
23 " 29 "
24SRC_URI[md5sum] = "b3351a3294db66a72e2864a199d37cbf" 30SRC_URI[md5sum] = "b3351a3294db66a72e2864a199d37cbf"
25SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551" 31SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551"
26 32
27EXTRA_OEMAKE = 'CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" CFLAGS="${CFLAGS}" \ 33EXTRA_OEMAKE = 'CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" CFLAGS="${CFLAGS}" \
28 LDFLAGS="${LDFLAGS}" LD="${LD}" OS="${TARGET_SYS}" \ 34 LDFLAGS="${LDFLAGS}" LDLIBS="${LDLIBS}" LD="${LD}" OS="${TARGET_SYS}" \
29 TARGET="${TARGET_OS}" BASE="${prefix}" MANDIR="${mandir}"' 35 TARGET="${TARGET_OS}" BASE="${prefix}" MANDIR="${mandir}"'
30 36
31do_configure() { 37do_configure() {