diff --git a/papi-6.0.0-sw.patch b/papi-6.0.0-sw.patch new file mode 100644 index 0000000000000000000000000000000000000000..483a36317a115e1325388b1dd9da8e7f90fa6e7e --- /dev/null +++ b/papi-6.0.0-sw.patch @@ -0,0 +1,74 @@ +diff -Nuar papi-6.0.0.org/src/configure papi-6.0.0.sw/src/configure +--- papi-6.0.0.org/src/configure 2023-08-04 14:53:14.229642734 +0800 ++++ papi-6.0.0.sw/src/configure 2023-08-04 15:15:36.257871330 +0800 +@@ -4709,7 +4709,7 @@ + + # First set pthread-mutexes based on arch + case $arch in +- aarch64|arm*|parisc*) ++ sw_64|aarch64|arm*|parisc*) + pthread_mutexes=yes + CFLAGS="$CFLAGS -DUSE_PTHREAD_MUTEXES" + echo "forcing use of pthread mutexes... " >&6 +diff -Nuar papi-6.0.0.org/src/configure.in papi-6.0.0.sw/src/configure.in +--- papi-6.0.0.org/src/configure.in 2023-08-04 14:53:14.198641645 +0800 ++++ papi-6.0.0.sw/src/configure.in 2023-08-04 15:07:59.605759288 +0800 +@@ -410,7 +410,7 @@ + + # First set pthread-mutexes based on arch + case $arch in +- aarch64|arm*|parisc*) ++ sw_64|aarch64|arm*|parisc*) + pthread_mutexes=yes + CFLAGS="$CFLAGS -DUSE_PTHREAD_MUTEXES" + echo "forcing use of pthread mutexes... " >&6 +diff -Nuar papi-6.0.0.org/src/linux-context.h papi-6.0.0.sw/src/linux-context.h +--- papi-6.0.0.org/src/linux-context.h 2023-08-04 14:53:14.232642839 +0800 ++++ papi-6.0.0.sw/src/linux-context.h 2023-08-04 15:05:06.764673199 +0800 +@@ -35,6 +35,8 @@ + #define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.pc + #elif defined(__loongarch__) + #define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.__pc ++#elif defined(__sw_64__) ++#define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.sc_pc + #elif defined(__mips__) + #define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.pc + #elif defined(__hppa__) +diff -Nuar papi-6.0.0.org/src/linux-timer.c papi-6.0.0.sw/src/linux-timer.c +--- papi-6.0.0.org/src/linux-timer.c 2023-08-04 14:53:14.234642909 +0800 ++++ papi-6.0.0.sw/src/linux-timer.c 2023-08-04 15:14:41.349934011 +0800 +@@ -231,6 +231,21 @@ + } + + /************************/ ++/* sw_64 get_cycles() */ ++/************************/ ++ ++#elif defined(__sw_64__) ++static inline long long ++get_cycles( void ) ++{ ++ register unsigned long ret; ++ ++ __asm__ __volatile__ ("rtc %0" : "=r" (ret)); ++ ++ return ret; ++} ++ ++/************************/ + /* aarch64 get_cycles() */ + /************************/ + +diff -Nuar papi-6.0.0.org/src/mb.h papi-6.0.0.sw/src/mb.h +--- papi-6.0.0.org/src/mb.h 2023-08-04 14:53:14.257643717 +0800 ++++ papi-6.0.0.sw/src/mb.h 2023-08-04 15:00:40.723327507 +0800 +@@ -26,6 +26,9 @@ + #elif defined (__alpha__) + #define rmb() asm volatile("mb" ::: "memory") + ++#elif defined (__sw_64__) ++#define rmb() asm volatile("memb" ::: "memory") ++ + #elif defined(__ia64__) + #define rmb() asm volatile ("mf" ::: "memory") + diff --git a/papi.spec b/papi.spec index 4e5bd09ea814078264620e9528bd33d7afe9a16b..0791ff97d505d14aa1c5e6489cf9c5ba03c7118b 100644 --- a/papi.spec +++ b/papi.spec @@ -1,5 +1,8 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 # Default to no static libraries +%ifarch sw_64 +%define with_static 1 +%endif %{!?with_static: %global with_static 0} %bcond_with bundled_libpfm # rdma is not available @@ -33,6 +36,7 @@ Patch40: papi-thread_init.patch BuildRequires: make Patch1000: 1000-papi-anolis-add-loongarch-support.patch +Patch1001: papi-6.0.0-sw.patch BuildRequires: autoconf BuildRequires: doxygen @@ -109,6 +113,7 @@ the PAPI user-space libraries and interfaces. %patch31 -p1 %patch40 -p1 %patch1000 -p1 +%patch1001 -p1 %build @@ -201,6 +206,10 @@ chrpath --delete $RPM_BUILD_ROOT%{_libdir}/*.so* %endif %changelog +* Tue Mar 26 2024 Weisson - 6.0.0-15.0.2 +- cherry-pick `add sw arch #8df28831ab9ee0af53d8fa394c9f5cd1863d6e7d`. +- cherry-pick `explicitly disable static lib #266b8d83eb0812ae4dca5661e9491329cd0d3111`. + * Wed Dec 13 2023 - 6.0.0-15.0.1 - add 1000-papi-anolis-add-loongarch-support.patch