Skip to content

Commit

Permalink
app-benchmarks/tiobench: 0.4.2 version bump, fix build w/ GCC-5
Browse files Browse the repository at this point in the history
Gentoo-bug: 520986, 570842
* Also fix perl shebangs to be more portable

Package-Manager: portage-2.3.0
Closes: gentoo#2878
  • Loading branch information
a17r authored and SoapGentoo committed Nov 26, 2016
1 parent 1f5bb47 commit d9a7925
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 1 deletion.
1 change: 1 addition & 0 deletions app-benchmarks/tiobench/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DIST tiobench-0.3.3.tar.gz 28282 SHA256 8ad011059a35ac70cdb5e3d3999ceee44a8e8e9078926844b0685b7ea9db2bcc SHA512 e2752e32e9deaea611217629e99dc8fd738e63b4a21f49a0286f894bece3a258a3d223e0eb403ad5350dbb408738b9c5ba7300a85c8eea464266152965730328 WHIRLPOOL f6bb9b353cbbf007f6095caa5e893b3bac9af2f4cdb681be9b3f1abf6e07a5b4cd8dd0ceebfa96fd4a888fa28528a78ce00ff239c93cb96a11795168e4b2e81e
DIST tiobench-0.4.2.tar.gz 32182 SHA256 d6166edd6892725d413566ffe348d58927726fa7fa000efb384f7bcccad2e0ba SHA512 02e82d86ee889a366c1a00d4fb49f63d926e44ba6e2f297212479a5c13abe008b62c12d44483de7e971b5ebf875d5c07847f1d69dd11b2e87a050e27d8f9f09f WHIRLPOOL 8b6e5601b3079943eb1c7adf2d2fb12d05f36eaba19552c76b042b37743b0ceda5e5fd105cd64db6c0b2c111e20f9c54424113a427ad7b790a01a714c2bc1f87
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Fix perl shebangs, in order to be maximally compatible with Gentoo Prefix.
Rationale: https://blogs.gentoo.org/mgorny/2016/02/08/a-quick-note-on-portable-shebangs/

--- a/scripts/makeimages.pl
+++ b/scripts/makeimages.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl

# Author: James Manning <[email protected]>
# This software may be used and distributed according to the terms of
@@ -8,6 +8,7 @@
# Perl wrapper for calling tiobench.pl and displaying results
# graphically using gnuplot

+use warnings;
use strict;

my $args = join(" ",@ARGV);
--- a/scripts/tiosum.pl
+++ b/scripts/tiosum.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
# Author: Randy Hron <rwhron (at) earthlink dot net>
# This software may be used and distributed according to the terms of
# the GNU General Public License, http://www.gnu.org/copyleft/gpl.html
@@ -6,6 +6,7 @@
# Summarize output of tiobench2.pl for multiple kernels/runs.
# Assumes logfiles created with:
# ./tiobench2.pl > tiobench-`uname -r` 2> tiobench-`uname -r`.err
+use warnings;
use strict;
$|++;

--- a/tiobench.pl
+++ b/tiobench.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl

# Author: James Manning <jmm at users.sf.net>
# Author: Randy Hron <rwhron at earthlink dot net>
@@ -9,6 +9,7 @@
# Perl wrapper for calling the tiotest executable multiple times
# with varying sets of parameters as instructed

+use warnings;
use strict;
use Getopt::Long;

48 changes: 48 additions & 0 deletions app-benchmarks/tiobench/files/tiobench-0.4.2-gcc5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
diff --git a/crc32.c b/crc32.c
index bae7384..a22fc5d 100644
--- a/crc32.c
+++ b/crc32.c
@@ -72,10 +72,9 @@ static const unsigned long crctab[256] = {
0xA2F33668, 0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4
};

-inline
-unsigned long crc32( const void* buffer,
- unsigned long length,
- unsigned long crc)
+unsigned long crc32(const void* buffer,
+ unsigned long length,
+ unsigned long crc)
{
const unsigned char* cp = (const unsigned char*)buffer;

diff --git a/crc32.h b/crc32.h
index 62b3433..cb9b96f 100644
--- a/crc32.h
+++ b/crc32.h
@@ -18,9 +18,8 @@
#ifndef CRC32_H
#define CRC32_H

-inline
-unsigned long crc32( const void* const buffer,
- unsigned long length,
- unsigned long crc);
+unsigned long crc32(const void* const buffer,
+ unsigned long length,
+ unsigned long crc);

#endif
diff --git a/tiotest.c b/tiotest.c
index c23ceb4..bb73fcb 100644
--- a/tiotest.c
+++ b/tiotest.c
@@ -1392,7 +1392,7 @@ static int do_mmap_read_operation(void *loc, ThreadData *d)

if(crc != d->bufferCrc)
{
- fprintf(stderr, "Thread(%lu) mmap consistency check failed at 0x%x\n", d->myNumber, (unsigned int)loc);
+ fprintf(stderr, "Thread(%lu) mmap consistency check failed at 0x%p\n", d->myNumber, loc);
return -1;
}
}
2 changes: 1 addition & 1 deletion app-benchmarks/tiobench/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<name>Alice Ferrazzi</name>
</maintainer>
<upstream>
<remote-id type="sourceforge">tiobench</remote-id>
<remote-id type="github">mkuoppal/tiobench</remote-id>
</upstream>
</pkgmetadata>
45 changes: 45 additions & 0 deletions app-benchmarks/tiobench/tiobench-0.4.2.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

inherit toolchain-funcs

DESCRIPTION="Portable, robust, fully-threaded I/O benchmark program"
HOMEPAGE="https://github.com/mkuoppal/tiobench"
SRC_URI="https://github.com/mkuoppal/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
IUSE=""

RDEPEND="dev-lang/perl"
DEPEND="${RDEPEND}"

PATCHES=(
"${FILESDIR}"/${P}-gcc5.patch
"${FILESDIR}"/${P}-fix-perl-shebang.patch
)

src_prepare() {
default
sed -i \
-e "s:/usr/local/bin:${EPREFIX}/usr/sbin:" tiobench.pl \
|| die "sed tiobench.pl failed"
}

src_compile() {
emake \
CC="$(tc-getCC)" \
LINK="$(tc-getCC)" \
DEFINES="-DLARGEFILES" \
CFLAGS="${CFLAGS}" \
LDFLAGS="${LDFLAGS}"
}

src_install() {
dosbin tiotest tiobench.pl scripts/tiosum.pl
einstalldocs
}

0 comments on commit d9a7925

Please sign in to comment.