From 1f0c3d1eeb453c95b9894f215a06f75da8677944 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 23 Jan 2019 15:21:12 -0800 Subject: [PATCH] bonnie++: Update to 1.98 This version contains NVME fixes. Edited the patches to modify the package Makefile directly so as to reduce hacks in the OpenWrt Makefile. Added LTO support to lower filesize by ~4KB. Signed-off-by: Rosen Penev --- utils/bonnie++/Makefile | 19 ++--- .../patches/001-cross_compile_fix.patch | 38 --------- .../002-add-verbose-error-messages.patch | 2 +- .../bonnie++/patches/010-openwrt-fixes.patch | 81 +++++++++++++++++++ utils/bonnie++/patches/010-uclibcxx.patch | 35 -------- 5 files changed, 87 insertions(+), 88 deletions(-) delete mode 100644 utils/bonnie++/patches/001-cross_compile_fix.patch create mode 100644 utils/bonnie++/patches/010-openwrt-fixes.patch delete mode 100644 utils/bonnie++/patches/010-uclibcxx.patch diff --git a/utils/bonnie++/Makefile b/utils/bonnie++/Makefile index 3a1d58cb6..632d348eb 100644 --- a/utils/bonnie++/Makefile +++ b/utils/bonnie++/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bonnie++ -PKG_VERSION:=1.97.3 -PKG_RELEASE:=2 +PKG_VERSION:=1.98 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz PKG_SOURCE_URL:=https://www.coker.com.au/bonnie++/ -PKG_HASH:=e27b386ae0dc054fa7b530aab6bdead7aea6337a864d1f982bc9ebacb320746e +PKG_HASH:=6e0bcbc08b78856fd998dd7bcb352d4615a99c26c2dc83d5b8345b102bad0b04 PKG_MAINTAINER:=Florian Fainelli PKG_LICENSE:=GPL-2.0 @@ -39,19 +39,10 @@ define Package/bonniexx/description endef ifeq ($(CONFIG_USE_UCLIBCXX),y) -TARGET_LDFLAGS +=-nodefaultlibs +TARGET_LDFLAGS += -nodefaultlibs endif -TARGET_CXXFLAGS +=-fno-rtti - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - TARGET_CXX="$(TARGET_CXX)" \ - TARGET_LINK="$(TARGET_CXX)" \ - MORECFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CXXFLAGS)" \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - all -endef +TARGET_CXXFLAGS += -fno-rtti -flto define Package/bonniexx/install $(INSTALL_DIR) $(1)/usr/bin diff --git a/utils/bonnie++/patches/001-cross_compile_fix.patch b/utils/bonnie++/patches/001-cross_compile_fix.patch deleted file mode 100644 index e3ff56b12..000000000 --- a/utils/bonnie++/patches/001-cross_compile_fix.patch +++ /dev/null @@ -1,38 +0,0 @@ -Index: bonnie++-1.97.3/configure -=================================================================== ---- bonnie++-1.97.3.orig/configure -+++ bonnie++-1.97.3/configure -@@ -3955,9 +3955,7 @@ rm -f core conftest.err conftest.$ac_obj - - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 --$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} --as_fn_error $? "cannot run test program while cross compiling --See \`config.log' for more details" "$LINENO" 5 ; } -+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} } - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ -Index: bonnie++-1.97.3/Makefile -=================================================================== ---- bonnie++-1.97.3.orig/Makefile -+++ bonnie++-1.97.3/Makefile -@@ -1,5 +1,7 @@ - EXES=bonnie++ zcav getc_putc getc_putc_helper - EXE=bon_csv2html generate_randfile -+TARGET_CXX=g++ -+TARGET_LINK=g++ - - all: $(EXE) $(EXES) - -@@ -10,8 +12,8 @@ eprefix=${prefix} - #MORE_WARNINGS=-Weffc++ - WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -Wcast-align -Wsign-compare -Wpointer-arith -Wwrite-strings -Wformat-security -Wswitch-enum -Winit-self $(MORE_WARNINGS) - CFLAGS=-O2 -DNDEBUG $(WFLAGS) $(MORECFLAGS) --CXX=g++ $(CFLAGS) --LINK=g++ -+CXX=$(TARGET_CXX) $(CFLAGS) -+LINK=$(TARGET_LINK) - THREAD_LFLAGS=-lpthread - - INSTALL=/usr/bin/install -c diff --git a/utils/bonnie++/patches/002-add-verbose-error-messages.patch b/utils/bonnie++/patches/002-add-verbose-error-messages.patch index ccec8e8f1..521ca9c54 100644 --- a/utils/bonnie++/patches/002-add-verbose-error-messages.patch +++ b/utils/bonnie++/patches/002-add-verbose-error-messages.patch @@ -1,6 +1,6 @@ --- a/bon_file.cpp +++ b/bon_file.cpp -@@ -464,25 +464,37 @@ int COpenTest::delete_sequential(BonTime +@@ -469,25 +469,37 @@ int COpenTest::delete_sequential(BonTime } if(m_number_directories != 1) { diff --git a/utils/bonnie++/patches/010-openwrt-fixes.patch b/utils/bonnie++/patches/010-openwrt-fixes.patch new file mode 100644 index 000000000..a26b64adb --- /dev/null +++ b/utils/bonnie++/patches/010-openwrt-fixes.patch @@ -0,0 +1,81 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -7,12 +7,6 @@ SCRIPTS=bon_csv2txt + + prefix=@prefix@ + eprefix=@exec_prefix@ +-#MORE_WARNINGS=-Weffc++ +-WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -Wcast-align -Wsign-compare -Wpointer-arith -Wwrite-strings -Wformat-security -Wswitch-enum -Winit-self $(MORE_WARNINGS) +-CFLAGS=-O2 @debug@ -DNDEBUG $(WFLAGS) $(MORECFLAGS) +-CXX=@CXX@ $(CFLAGS) +-LINK=@CXX@ +-THREAD_LFLAGS=@thread_ldflags@ + + INSTALL=@INSTALL@ + INSTALL_PROGRAM=@INSTALL_PROGRAM@ +@@ -34,22 +28,22 @@ GETCHSRC=getc_putc_helper.cpp duration.cpp + GETCHOBJS=$(GETCHSRC:.cpp=.o) + + bonnie++: $(BONOBJS) +- $(LINK) -o bonnie++ $(BONOBJS) $(THREAD_LFLAGS) ++ $(CXX) $(CXXFLAGS) -o bonnie++ $(BONOBJS) + + zcav: $(ZCAVOBJS) +- $(LINK) -o zcav $(ZCAVOBJS) $(THREAD_LFLAGS) ++ $(CXX) $(CXXFLAGS) -o zcav $(ZCAVOBJS) + + getc_putc: $(GETCOBJS) getc_putc_helper +- $(LINK) -o getc_putc $(GETCOBJS) $(THREAD_LFLAGS) ++ $(CXX) $(CXXFLAGS) -o getc_putc $(GETCOBJS) + + getc_putc_helper: $(GETCHOBJS) +- $(CXX) -o getc_putc_helper $(GETCHOBJS) ++ $(CXX) $(CXXFLAGS) -o getc_putc_helper $(GETCHOBJS) + + bon_csv2html: bon_csv2html.o +- $(LINK) bon_csv2html.o -o bon_csv2html ++ $(CXX) $(CXXFLAGS) bon_csv2html.o -o bon_csv2html + + generate_randfile: generate_randfile.o +- $(LINK) generate_randfile.o -o generate_randfile ++ $(CXX) $(CXXFLAGS) generate_randfile.o -o generate_randfile + + install-bin: $(EXE) $(EXES) + mkdir -p $(eprefix)/bin $(eprefix)/sbin +@@ -63,7 +57,7 @@ install: install-bin + @INSTALL_DATA@ $(MAN8) @mandir@/man8 + + %.o: %.cpp +- $(CXX) -c $< ++ $(CXX) $(CXXFLAGS) -c $< + + clean: + rm -f $(EXE) $(EXES) *.o build-stamp install-stamp +--- a/configure.in ++++ b/configure.in +@@ -31,7 +31,6 @@ fi + + dnl Checks for programs. + AC_LANG_CPLUSPLUS +-AC_PROG_CC + AC_PROG_CXX + AC_PROG_CXXCPP + AC_PROG_INSTALL +@@ -66,7 +65,7 @@ AC_SUBST(linux_pthread) + AC_TRY_COMPILE([#define _GNU_SOURCE + #include + ] , [pthread_mutexattr_t attr; +- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);] ++ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);] + , linux_pthread="yes") + if [[ -n "$linux_pthread" ]]; then + linux_pthread="#define LINUX_PTHREAD" +@@ -83,7 +82,7 @@ void * thread_func(void * param) { return NULL; } + , thread_ldflags="-pthread") + + AC_SUBST(large_file) +-AC_TRY_RUN([#ifndef _LARGEFILE64_SOURCE ++AC_TRY_COMPILE([#ifndef _LARGEFILE64_SOURCE + #define _LARGEFILE64_SOURCE + #endif + #include diff --git a/utils/bonnie++/patches/010-uclibcxx.patch b/utils/bonnie++/patches/010-uclibcxx.patch deleted file mode 100644 index e05b89d65..000000000 --- a/utils/bonnie++/patches/010-uclibcxx.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- a/configure.in -+++ b/configure.in -@@ -31,7 +31,6 @@ fi - - dnl Checks for programs. - AC_LANG_CPLUSPLUS --AC_PROG_CC - AC_PROG_CXX - AC_PROG_CXXCPP - AC_PROG_INSTALL -@@ -60,13 +59,13 @@ if [[ -n "$snprintf" ]]; then - snprintf="#define NO_SNPRINTF" - fi - --AC_CHECK_HEADERS(algorithm algo.h algo) -+AC_CHECK_HEADERS(algorithm) - - AC_SUBST(linux_pthread) - AC_TRY_COMPILE([#define _GNU_SOURCE - #include - ] , [pthread_mutexattr_t attr; -- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);] -+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);] - , linux_pthread="yes") - if [[ -n "$linux_pthread" ]]; then - linux_pthread="#define LINUX_PTHREAD" -@@ -83,7 +82,7 @@ void * thread_func(void * param) { return NULL; } - , thread_ldflags="-pthread") - - AC_SUBST(large_file) --AC_TRY_RUN([#ifndef _LARGEFILE64_SOURCE -+AC_TRY_COMPILE([#ifndef _LARGEFILE64_SOURCE - #define _LARGEFILE64_SOURCE - #endif - #include