dhrystone: new benchmark package
PATCH 1/1 dhrystone: new benchmark package
--- package/Config.in | 1 + package/dhrystone/Config.in | 6 +++ package/dhrystone/Makefile | 13 +++++ package/dhrystone/dhrystone-2-HZ.patch | 13 +++++ package/dhrystone/dhrystone-2-cmdline-nruns.patch | 51 +++++++++++++++++++++ package/dhrystone/dhrystone-2-exit.patch | 12 +++++ package/dhrystone/dhrystone-2-prototypes.patch | 21 +++++++++ package/dhrystone/dhrystone.mk | 37 +++++++++++++++ 8 files changed, 154 insertions(+), 0 deletions(-) create mode 100644 package/dhrystone/Config.in create mode 100644 package/dhrystone/Makefile create mode 100644 package/dhrystone/dhrystone-2-HZ.patch create mode 100644 package/dhrystone/dhrystone-2-cmdline-nruns.patch create mode 100644 package/dhrystone/dhrystone-2-exit.patch create mode 100644 package/dhrystone/dhrystone-2-prototypes.patch create mode 100644 package/dhrystone/dhrystone.mk
package/Config.in +1 -0
@@ -17,6 +17,7 @@ source "package/xz/Config.in" endmenu menu "Debugging, profiling and benchmark" +source "package/dhrystone/Config.in" source "package/dmalloc/Config.in" source "package/kexec/Config.in" source "package/lmbench/Config.in"
package/dhrystone/Config.in new file +6 -0
@@ -0,0 +1,6 @@ +config BR2_PACKAGE_DHRYSTONE + bool "dhrystone" + help + easy-to-use integer benchmark + + http://www.netlib.org/benchmark/dhry-c
package/dhrystone/Makefile new file +13 -0
@@ -0,0 +1,13 @@ +CFLAGS += -Wall +CPPFLAGS += -DNO_PROTOTYPES=1 +LDLIBS += -lm + +all: dhrystone + +dhrystone: dhry_1.o dhry_2.o + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) + +clean: + rm -f *.o dhrystone + +.PHONY: all clean
package/dhrystone/dhrystone-2-HZ.patch new file +13 -0
@@ -0,0 +1,13 @@ +--- a/dhry.h ++++ b/dhry.h +@@ -359,6 +359,10 @@ + /* for "times" */ + #endif + ++#ifndef HZ ++#include <sys/param.h> ++#endif ++ + #define Mic_secs_Per_Second 1000000.0 + /* Berkeley UNIX C returns process times in seconds/HZ */ +
package/dhrystone/dhrystone-2-cmdline-nruns.patch new file +51 -0
51 lines not on this page · raw message
package/dhrystone/dhrystone-2-exit.patch new file +12 -0
@@ -0,0 +1,12 @@ +trust the exit status of the program + +--- a/dhry_1.c ++++ b/dhry_1.c +@@ -274,6 +289,7 @@ + printf ("\n"); + } + ++ exit(0); + } + +
package/dhrystone/dhrystone-2-prototypes.patch new file +21 -0
@@ -0,0 +1,21 @@ +--- a/dhry_1.c ++++ b/dhry_1.c +@@ -45,14 +45,18 @@ + + #ifdef TIMES + struct tms time_info; ++#ifndef NO_PROTOTYPES + extern int times (); + /* see library function "times" */ ++#endif + #define Too_Small_Time 120 + /* Measurements should last at least about 2 seconds */ + #endif + #ifdef TIME ++#ifndef NO_PROTOTYPES + extern long time(); + /* see library function "time" */ ++#endif + #define Too_Small_Time 2 + /* Measurements should last at least 2 seconds */ + #endif
package/dhrystone/dhrystone.mk new file +37 -0
@@ -0,0 +1,37 @@ +############################################################# +# +# dhrystone +# +############################################################# + +DHRYSTONE_VERSION = 2 +DHRYSTONE_SOURCE = dhry-c +DHRYSTONE_SITE = http://www.netlib.org/benchmark/ + +define DHRYSTONE_BUILD_CMDS + CFLAGS="$(TARGET_CFLAGS)" \ + $(MAKE) \ + CC="$(TARGET_CC)" \ + -C $(@D) +endef + +define DHRYSTONE_CLEAN_CMDS + $(MAKE) -C $(@D) clean +endef + +define DHRYSTONE_INSTALL_TARGET_CMDS + $(INSTALL) -D $(@D)/dhrystone $(TARGET_DIR)/bin/dhrystone +endef + +define DHRYSTONE_UNINSTALL_TARGET_CMDS + rm -f $(TARGET_DIR)/bin/dhrystone +endef + +$(eval $(call GENTARGETS,package,dhrystone)) + +$(BUILD_DIR)/dhrystone-$(DHRYSTONE_VERSION)/.stamp_extracted: + @$(call MESSAGE,"Extracting") + $(Q)mkdir -p $(@D) + $(Q)cd $(@D) && $(SHELL) $(DL_DIR)/$($(PKG)_SOURCE) + $(Q)cp $($(PKG)_DIR_PREFIX)/dhrystone/Makefile $(@D)/ + $(Q)touch $@
Signature · 1 line
1.7.3.2
PATCH v2 1/1 dhrystone: new benchmark package
---
v2
- leverage TARGET_CONFIGURE_OPTS
- install into /usr/bin
- add info to all the patches
- add patch to pull in malloc/exit/etc... prototypes from C library
package/Config.in | 1 + package/dhrystone/Config.in | 6 ++ package/dhrystone/Makefile | 12 +++++ package/dhrystone/dhrystone-2-HZ.patch | 17 +++++++ package/dhrystone/dhrystone-2-cmdline-nruns.patch | 53 +++++++++++++++++++++ package/dhrystone/dhrystone-2-exit.patch | 14 ++++++ package/dhrystone/dhrystone-2-headers.patch | 15 ++++++ package/dhrystone/dhrystone-2-prototypes.patch | 35 ++++++++++++++ package/dhrystone/dhrystone.mk | 34 +++++++++++++ 9 files changed, 187 insertions(+), 0 deletions(-) create mode 100644 package/dhrystone/Config.in create mode 100644 package/dhrystone/Makefile create mode 100644 package/dhrystone/dhrystone-2-HZ.patch create mode 100644 package/dhrystone/dhrystone-2-cmdline-nruns.patch create mode 100644 package/dhrystone/dhrystone-2-exit.patch create mode 100644 package/dhrystone/dhrystone-2-headers.patch create mode 100644 package/dhrystone/dhrystone-2-prototypes.patch create mode 100644 package/dhrystone/dhrystone.mk
package/Config.in +1 -0
@@ -17,6 +17,7 @@ source "package/xz/Config.in" endmenu menu "Debugging, profiling and benchmark" +source "package/dhrystone/Config.in" source "package/dmalloc/Config.in" source "package/kexec/Config.in" source "package/lmbench/Config.in"
package/dhrystone/Config.in new file +6 -0
@@ -0,0 +1,6 @@ +config BR2_PACKAGE_DHRYSTONE + bool "dhrystone" + help + easy-to-use integer benchmark + + http://www.netlib.org/benchmark/dhry-c
package/dhrystone/Makefile new file +12 -0
@@ -0,0 +1,12 @@ +CPPFLAGS += -DNO_PROTOTYPES=1 +LDLIBS += -lm + +all: dhrystone + +dhrystone: dhry_1.o dhry_2.o + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) + +clean: + rm -f *.o dhrystone + +.PHONY: all clean
package/dhrystone/dhrystone-2-HZ.patch new file +17 -0
@@ -0,0 +1,17 @@ +Get HZ value from system rather than requiring via CPPFLAGS + +Patch by Robin Getz <[email protected]> + +--- a/dhry.h ++++ b/dhry.h +@@ -359,6 +359,10 @@ + /* for "times" */ + #endif + ++#ifndef HZ ++#include <sys/param.h> ++#endif ++ + #define Mic_secs_Per_Second 1000000.0 + /* Berkeley UNIX C returns process times in seconds/HZ */ +
package/dhrystone/dhrystone-2-cmdline-nruns.patch new file +53 -0
53 lines not on this page · raw message
package/dhrystone/dhrystone-2-exit.patch new file +14 -0
@@ -0,0 +1,14 @@ +trust the exit status of the program + +Patch by Robin Getz <[email protected]> + +--- a/dhry_1.c ++++ b/dhry_1.c +@@ -274,6 +289,7 @@ + printf ("\n"); + } + ++ exit(0); + } + +
package/dhrystone/dhrystone-2-headers.patch new file +15 -0
@@ -0,0 +1,15 @@ +get prototypes for malloc/exit/strcpy + +Patch by Mike Frysinger <[email protected]> + +--- a/dhry.h ++++ b/dhry.h +@@ -388,6 +388,8 @@ + /* General definitions: */ + + #include <stdio.h> ++#include <stdlib.h> ++#include <string.h> + /* for strcpy, strcmp */ + + #define Null 0
package/dhrystone/dhrystone-2-prototypes.patch new file +35 -0
@@ -0,0 +1,35 @@ +Avoid collision with C library using NO_PROTOTYPES found in code already + +Patch by Robin Getz <[email protected]> + +--- a/dhry_1.c ++++ b/dhry_1.c +@@ -28,7 +28,9 @@ + int Arr_1_Glob [50]; + int Arr_2_Glob [50] [50]; + ++#ifndef NO_PROTOTYPES + extern char *malloc (); ++#endif + Enumeration Func_1 (); + /* forward declaration necessary since Enumeration may not simply be int */ + +@@ -45,14 +45,18 @@ + + #ifdef TIMES + struct tms time_info; ++#ifndef NO_PROTOTYPES + extern int times (); + /* see library function "times" */ ++#endif + #define Too_Small_Time 120 + /* Measurements should last at least about 2 seconds */ + #endif + #ifdef TIME ++#ifndef NO_PROTOTYPES + extern long time(); + /* see library function "time" */ ++#endif + #define Too_Small_Time 2 + /* Measurements should last at least 2 seconds */ + #endif
package/dhrystone/dhrystone.mk new file +34 -0
@@ -0,0 +1,34 @@ +############################################################# +# +# dhrystone +# +############################################################# + +DHRYSTONE_VERSION = 2 +DHRYSTONE_SOURCE = dhry-c +DHRYSTONE_SITE = http://www.netlib.org/benchmark/ + +define DHRYSTONE_BUILD_CMDS + $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) +endef + +define DHRYSTONE_CLEAN_CMDS + $(MAKE) -C $(@D) clean +endef + +define DHRYSTONE_INSTALL_TARGET_CMDS + $(INSTALL) -D $(@D)/dhrystone $(TARGET_DIR)/usr/bin/dhrystone +endef + +define DHRYSTONE_UNINSTALL_TARGET_CMDS + rm -f $(TARGET_DIR)/usr/bin/dhrystone +endef + +$(eval $(call GENTARGETS,package,dhrystone)) + +$(BUILD_DIR)/dhrystone-$(DHRYSTONE_VERSION)/.stamp_extracted: + @$(call MESSAGE,"Extracting") + $(Q)mkdir -p $(@D) + $(Q)cd $(@D) && $(SHELL) $(DL_DIR)/$($(PKG)_SOURCE) + $(Q)cp $($(PKG)_DIR_PREFIX)/dhrystone/Makefile $(@D)/ + $(Q)touch $@
Signature · 1 line
1.7.3.2
PATCH v2 1/1 dhrystone: new benchmark package
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Mike" == Mike Frysinger <[email protected]> writes:
Mike> Acked-by: Thomas Petazzoni <[email protected]> Mike> Signed-off-by: Mike Frysinger <[email protected]> Mike> ---
Mike> v2
Mike> - leverage TARGET_CONFIGURE_OPTS
Mike> - install into /usr/bin
Mike> - add info to all the patches
Mike> - add patch to pull in malloc/exit/etc... prototypes from C library
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard