summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-benchmark
diff options
context:
space:
mode:
authorJose Alarcon <jose.alarcon@ge.com>2017-08-22 08:05:38 +0300
committerMartin Jansa <Martin.Jansa@gmail.com>2017-08-28 11:06:03 +0200
commit5272165c3f1f0db5aeb483028c68bf86043653f3 (patch)
tree7e28dc6db95a1fc4f870223ebd938a46410e58ce /meta-oe/recipes-benchmark
parent28558af4d060541d3d2c4b5f81a9b7a61a259a1c (diff)
downloadmeta-openembedded-5272165c3f1f0db5aeb483028c68bf86043653f3.tar.gz
Dhrystone: add recipe 2.1
Dhrystone is a synthetic computing benchmark program developed in 1984 by Reinhold P. Weicker intended to be representative of system (integer) programming. https://en.wikipedia.org/wiki/Dhrystone Signed-off-by: Jose Alarcon <jose.alarcon@ge.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-benchmark')
-rw-r--r--meta-oe/recipes-benchmark/dhrystone/dhrystone-2.1/dhrystone.patch81
-rw-r--r--meta-oe/recipes-benchmark/dhrystone/dhrystone_2.1.bb26
2 files changed, 107 insertions, 0 deletions
diff --git a/meta-oe/recipes-benchmark/dhrystone/dhrystone-2.1/dhrystone.patch b/meta-oe/recipes-benchmark/dhrystone/dhrystone-2.1/dhrystone.patch
new file mode 100644
index 000000000..6a5350c37
--- /dev/null
+++ b/meta-oe/recipes-benchmark/dhrystone/dhrystone-2.1/dhrystone.patch
@@ -0,0 +1,81 @@
1dhrystone: fix compilation problems
2
3This patch fixes two compilation errors with original
4dhrystone sources:
5* Redefinition of times() with wrong return type
6 - Fixed by commenting out the unnecessary redefinition
7* Undefined identifier HZ
8 - Originally HZ was supposed to be the clock frequency
9 value for times()
10 - For Linux, the frequency should come from sysconf
11 - This patch defines global varible HZ and initializes
12 it from sysconf
13
14Additionally, this patch adds a simple Makefile.
15
16Upstream-status: Pending
17
18Sign-off-by: Kimmo Surakka <kimmo.surakka@ge.com>
19Signed-off-by: Jose Alarcon <jose.alarcon@ge.com>
20---
21
22diff -Naur dhry.orig/dhry_1.c dhry/dhry_1.c
23--- dhry.orig/dhry_1.c 2015-07-20 14:25:58.059945353 +0300
24+++ dhry/dhry_1.c 2015-07-20 12:43:25.318945353 +0300
25@@ -45,11 +45,15 @@
26
27 #ifdef TIMES
28 struct tms time_info;
29-extern int times ();
30+/* extern int times (); */
31 /* see library function "times" */
32 #define Too_Small_Time 120
33 /* Measurements should last at least about 2 seconds */
34 #endif
35+#ifndef HZ
36+#include <unistd.h> /* sysconf */
37+ long HZ;
38+#endif
39 #ifdef TIME
40 extern long time();
41 /* see library function "time" */
42@@ -84,6 +88,9 @@
43
44 /* Initializations */
45
46+#ifndef HZ
47+ HZ = sysconf(_SC_CLK_TCK);
48+#endif
49 Next_Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
50 Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
51
52diff -Naur dhry.orig/dhry.h dhry/dhry.h
53--- dhry.orig/dhry.h 2015-07-20 14:25:58.054945353 +0300
54+++ dhry/dhry.h 2015-07-20 12:42:59.903945353 +0300
55@@ -420,4 +420,6 @@
56 } variant;
57 } Rec_Type, *Rec_Pointer;
58
59-
60+#ifndef HZ
61+ extern long HZ;
62+#endif
63diff -Naur dhry.orig/Makefile dhry/Makefile
64--- dhry.orig/Makefile 1970-01-01 02:00:00.000000000 +0200
65+++ dhry/Makefile 2015-07-20 14:10:45.832945353 +0300
66@@ -0,0 +1,15 @@
67+CC=gcc
68+
69+all: dhry
70+
71+dhry: dhry_1.o dhry_2.o
72+ $(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS)
73+
74+dhry_1.o: dhry_1.c dhry.h
75+
76+dhry_2.o: dhry_2.c dhry.h
77+
78+clean:
79+ rm -f *.o *~
80+
81+.PHONY: all clean
diff --git a/meta-oe/recipes-benchmark/dhrystone/dhrystone_2.1.bb b/meta-oe/recipes-benchmark/dhrystone/dhrystone_2.1.bb
new file mode 100644
index 000000000..17e8c700c
--- /dev/null
+++ b/meta-oe/recipes-benchmark/dhrystone/dhrystone_2.1.bb
@@ -0,0 +1,26 @@
1SUMMARY = "Dhrystone CPU benchmark"
2LICENSE = "PD"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/PD;md5=b3597d12946881e13cb3b548d1173851"
4
5SRC_URI = "http://www.netlib.org/benchmark/dhry-c;downloadfilename=dhry-c.shar \
6 file://dhrystone.patch"
7SRC_URI[md5sum] = "75aa5909c174eed98c134be2f56307da"
8SRC_URI[sha256sum] = "038a7e9169787125c3451a6c941f3aca5db2d2f3863871afcdce154ef17f4e3e"
9
10# Need to override Makefile variables
11EXTRA_OEMAKE = "-e MAKEFLAGS="
12
13do_unpack() {
14 [ -d ${S} ] || mkdir -p ${S}
15 cd ${S}
16 sh ${DL_DIR}/dhry-c.shar
17}
18do_install() {
19 install -d ${D}${bindir}
20 install -m 0755 ${S}/dhry ${D}${bindir}
21}
22
23# Prevent procedure merging as required by dhrystone.c:
24CFLAGS += "-fno-lto"
25
26LDFLAGS += "-fno-lto"