[oe-commits] Otavio Salvador : tiobench: fix aligned allocation method clash with newer glibc

git at git.openembedded.org git at git.openembedded.org
Tue Aug 7 10:31:29 UTC 2012


Module: meta-openembedded.git
Branch: master
Commit: 5d9de465ca73850bea3f0b76de3d74d6ab6f9b4b
URL:    http://git.openembedded.org/?p=meta-openembedded.git&a=commit;h=5d9de465ca73850bea3f0b76de3d74d6ab6f9b4b

Author: Otavio Salvador <otavio at ossystems.com.br>
Date:   Fri Aug  3 18:43:00 2012 +0000

tiobench: fix aligned allocation method clash with newer glibc

glibc 2.16 added aligned allocation support to stdlib and those
function clashes with the local implementation done in tiobench. We
fix it using a '_' prefix on those.

Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
Signed-off-by: Koen Kooi <koen at dominion.thruhere.net>

---

 .../tiobench-0.3.3/avoid-glibc-clashes.patch       |   57 ++++++++++++++++++++
 .../recipes-benchmark/tiobench/tiobench_0.3.3.bb   |    3 +
 2 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/avoid-glibc-clashes.patch b/meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/avoid-glibc-clashes.patch
new file mode 100644
index 0000000..321d299
--- /dev/null
+++ b/meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/avoid-glibc-clashes.patch
@@ -0,0 +1,57 @@
+From: Otavio Salvador <otavio at ossystems.com.br>
+Subject: [PATCH] Avoid aligned allocation function name clashes
+
+glibc added new methods for aligned allocation and it clashes with the
+local version used by 'tiobench'. To fix it, we prefix the methods
+with '_'.
+
+Upstream-Status: Pending
+
+Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
+---
+ tiotest.c |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tiotest.c b/tiotest.c
+index 38f54e7..6b3d0c3 100644
+--- a/tiotest.c
++++ b/tiotest.c
+@@ -31,7 +31,7 @@ static const char* versionStr = "tiotest v0.3.3 (C) 1999-2000 Mika Kuoppala <mik
+ */
+ ArgumentOptions args;
+ 
+-static void * aligned_alloc(ssize_t size)
++static void * _aligned_alloc(ssize_t size)
+ {
+ 	caddr_t a;
+ 	a = mmap((caddr_t )0, size, 
+@@ -41,7 +41,7 @@ static void * aligned_alloc(ssize_t size)
+ 	return a;
+ }
+ 
+-static int aligned_free(caddr_t a, ssize_t size)
++static int _aligned_free(caddr_t a, ssize_t size)
+ {
+ 	return munmap(a, size);
+ }
+@@ -281,7 +281,7 @@ void initialize_test( ThreadTest *d )
+ 		pthread_attr_setscope(&(d->threads[i].thread_attr),
+ 				      PTHREAD_SCOPE_SYSTEM);
+ 
+-		d->threads[i].buffer = aligned_alloc( d->threads[i].blockSize );
++		d->threads[i].buffer = _aligned_alloc( d->threads[i].blockSize );
+ 		if( d->threads[i].buffer == NULL )
+ 		{
+ 			perror("Error allocating memory");
+@@ -383,7 +383,7 @@ void cleanup_test( ThreadTest *d )
+ 	{
+ 		if (!args.rawDrives)
+ 		unlink(d->threads[i].fileName);
+-		aligned_free( d->threads[i].buffer, d->threads[i].blockSize );
++		_aligned_free( d->threads[i].buffer, d->threads[i].blockSize );
+ 		d->threads[i].buffer = 0;
+ 	
+ 		pthread_attr_destroy( &(d->threads[i].thread_attr) );
+-- 
+1.7.7
+
diff --git a/meta-oe/recipes-benchmark/tiobench/tiobench_0.3.3.bb b/meta-oe/recipes-benchmark/tiobench/tiobench_0.3.3.bb
index 3b77b38..5b95ac0 100644
--- a/meta-oe/recipes-benchmark/tiobench/tiobench_0.3.3.bb
+++ b/meta-oe/recipes-benchmark/tiobench/tiobench_0.3.3.bb
@@ -3,9 +3,12 @@ HOMEPAGE = "http://sourceforge.net/projects/tiobench/"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b"
 
+PR = "r1"
+
 SRC_URI = "\
     http://sourceforge.net/projects/tiobench/files/tiobench/${PV}/${P}.tar.gz \
     file://tiobench-makefile.patch \
+    file://avoid-glibc-clashes.patch \
     "
 SRC_URI[md5sum] = "bf485bf820e693c79e6bd2a38702a128"
 SRC_URI[sha256sum] = "8ad011059a35ac70cdb5e3d3999ceee44a8e8e9078926844b0685b7ea9db2bcc"





More information about the Openembedded-commits mailing list