Blame SOURCES/papi-bz1326977.patch

c7ea89
commit 547f44124e1a38b8c5c635f673d88054ce6ff0d3
c7ea89
Author: Asim YarKhan <yarkhan@icl.utk.edu>
c7ea89
Date:   Thu Oct 16 12:19:34 2014 -0400
c7ea89
c7ea89
    byte_profile.c: PPC64 add support for PPC64 Little Endian to byte_profile.c
c7ea89
    
c7ea89
    Thanks to Carl Love for this patch and the following description:
c7ea89
    The POWER 8 platform is Little Endian.  It uses ELF
c7ea89
    version 2 which does not use function descriptors.  This
c7ea89
    patch adds the needed #ifdef support to correctly compile
c7ea89
    the test case for Big Endian or Little Endian.
c7ea89
    
c7ea89
    This patch is untested by the PAPI developers (hardware not easily accessible).
c7ea89
c7ea89
diff --git a/src/ctests/byte_profile.c b/src/ctests/byte_profile.c
c7ea89
index 0f33c0d..f693e9f 100644
c7ea89
--- a/src/ctests/byte_profile.c
c7ea89
+++ b/src/ctests/byte_profile.c
c7ea89
@@ -213,9 +213,14 @@ main( int argc, char **argv )
c7ea89
 /* Itanium and PowerPC64 processors return function descriptors instead
c7ea89
  * of function addresses. You must dereference the descriptor to get the address.
c7ea89
 */
c7ea89
-#if defined(ITANIUM1) || defined(ITANIUM2) || defined(__powerpc64__)
c7ea89
+#if defined(ITANIUM1) || defined(ITANIUM2) \
c7ea89
+    || (defined(__powerpc64__) && (_CALL_ELF != 2))
c7ea89
 	start = ( caddr_t ) ( ( ( struct fdesc * ) start )->ip );
c7ea89
 	end = ( caddr_t ) ( ( ( struct fdesc * ) end )->ip );
c7ea89
+        /* PPC64 Big Endian is ELF version 1 which uses function descriptors.
c7ea89
+         *  PPC64 Little Endian is ELF version 2 which does not use
c7ea89
+         * function descriptors
c7ea89
+         */
c7ea89
 #endif
c7ea89
 
c7ea89
 	/* call dummy so it doesn't get optimized away */
c7ea89
commit 14f70ebc77deaad4a3fc3f808613772ef1165137
c7ea89
Author: Asim YarKhan <yarkhan@icl.utk.edu>
c7ea89
Date:   Wed Oct 15 14:48:05 2014 -0400
c7ea89
c7ea89
    PPC64 add support for PPC64 Little Endian to sprofile.c
c7ea89
    
c7ea89
    Thanks to Carl Love for this patch and the following description:
c7ea89
    The POWER 8 platform is Little Endian.  It uses ELF
c7ea89
    version 2 which does not use function descriptors.  This
c7ea89
    patch adds the needed #ifdef support to correctly compile
c7ea89
    the test case for Big Endian or Little Endian.
c7ea89
c7ea89
diff --git a/src/ctests/sprofile.c b/src/ctests/sprofile.c
c7ea89
index e7ee47a..4bd7cc7 100644
c7ea89
--- a/src/ctests/sprofile.c
c7ea89
+++ b/src/ctests/sprofile.c
c7ea89
@@ -1,4 +1,4 @@
c7ea89
-/* 
c7ea89
+/*
c7ea89
 * File:    sprofile.c
c7ea89
 * Author:  Philip Mucci
c7ea89
 *          mucci@cs.utk.edu
c7ea89
@@ -10,10 +10,15 @@
c7ea89
 
c7ea89
 /* These architectures use Function Descriptors as Function Pointers */
c7ea89
 
c7ea89
-#if (defined(linux) && defined(__ia64__)) || (defined(_AIX)) ||(defined(__powerpc64__))
c7ea89
+#if (defined(linux) && defined(__ia64__)) || (defined(_AIX)) \
c7ea89
+  || ((defined(__powerpc64__) && (_CALL_ELF != 2)))
c7ea89
+/* PPC64 Big Endian is ELF version 1 which uses function descriptors */
c7ea89
 #define DO_READS (unsigned long)(*(void **)do_reads)
c7ea89
 #define DO_FLOPS (unsigned long)(*(void **)do_flops)
c7ea89
 #else
c7ea89
+/* PPC64 Little Endian is ELF version 2 which does not use
c7ea89
+ * function descriptors
c7ea89
+ */
c7ea89
 #define DO_READS (unsigned long)(do_reads)
c7ea89
 #define DO_FLOPS (unsigned long)(do_flops)
c7ea89
 #endif