Backport upstream patch, add new patch for autoconf C compatibility
Related to: <https://fedoraproject.org/wiki/Changes/PortingToModernC> <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
parent
80b463f2a4
commit
3c0ae17fc1
73
papi-configure-c99-1.patch
Normal file
73
papi-configure-c99-1.patch
Normal file
@ -0,0 +1,73 @@
|
||||
commit dd11311aadbd06ab6c76d49a997a8bb2bcdcd5f7
|
||||
Author: Giuseppe Congiu <gcongiu@icl.utk.edu>
|
||||
Date: Fri Sep 29 10:20:28 2023 +0200
|
||||
|
||||
configure: fix tls detection
|
||||
|
||||
Configure TLS detection tests were failing because of wrong usage of
|
||||
pthread_create(). Problem was caused by wrong definition of thread
|
||||
functions which require void *f(void *) instead of int f(void *) or
|
||||
void f(void *).
|
||||
|
||||
diff --git a/src/configure b/src/configure
|
||||
index 5c8b37b805a7a97e..8ce0047d803bd641 100755
|
||||
--- a/src/configure
|
||||
+++ b/src/configure
|
||||
@@ -5225,7 +5225,7 @@ else
|
||||
#include <unistd.h>
|
||||
extern __thread int i;
|
||||
static int res1, res2;
|
||||
- void thread_main (void *arg) {
|
||||
+ void *thread_main (void *arg) {
|
||||
i = (int)arg;
|
||||
sleep (1);
|
||||
if ((int)arg == 1)
|
||||
@@ -5418,7 +5418,7 @@ else
|
||||
int gettid() {
|
||||
return syscall( SYS_gettid );
|
||||
}
|
||||
- int doThreadOne( void * v ) {
|
||||
+ void *doThreadOne( void * v ) {
|
||||
struct tms tm;
|
||||
int status;
|
||||
while (!done)
|
||||
@@ -5428,7 +5428,7 @@ else
|
||||
threadone = tm.tms_utime;
|
||||
return 0;
|
||||
}
|
||||
- int doThreadTwo( void * v ) {
|
||||
+ void *doThreadTwo( void * v ) {
|
||||
struct tms tm;
|
||||
long i, j = 0xdeadbeef;
|
||||
int status;
|
||||
diff --git a/src/configure.in b/src/configure.in
|
||||
index 01e58c2488ad203a..cb0a4b59bbed1256 100644
|
||||
--- a/src/configure.in
|
||||
+++ b/src/configure.in
|
||||
@@ -707,7 +707,7 @@ AC_ARG_WITH(tls,
|
||||
#include <unistd.h>
|
||||
extern __thread int i;
|
||||
static int res1, res2;
|
||||
- void thread_main (void *arg) {
|
||||
+ void *thread_main (void *arg) {
|
||||
i = (int)arg;
|
||||
sleep (1);
|
||||
if ((int)arg == 1)
|
||||
@@ -849,7 +849,7 @@ AC_ARG_WITH(virtualtimer,
|
||||
int gettid() {
|
||||
return syscall( SYS_gettid );
|
||||
}
|
||||
- int doThreadOne( void * v ) {
|
||||
+ void *doThreadOne( void * v ) {
|
||||
struct tms tm;
|
||||
int status;
|
||||
while (!done)
|
||||
@@ -859,7 +859,7 @@ AC_ARG_WITH(virtualtimer,
|
||||
threadone = tm.tms_utime;
|
||||
return 0;
|
||||
}
|
||||
- int doThreadTwo( void * v ) {
|
||||
+ void *doThreadTwo( void * v ) {
|
||||
struct tms tm;
|
||||
long i, j = 0xdeadbeef;
|
||||
int status;
|
55
papi-configure-c99-2.patch
Normal file
55
papi-configure-c99-2.patch
Normal file
@ -0,0 +1,55 @@
|
||||
configure: Fix return values in start thread routines
|
||||
|
||||
Thread start routines must return a void * value, and future
|
||||
compilers refuse to convert integers to pointers with just a warning
|
||||
(the virtualtimer probe). Without this change, the probe always fails
|
||||
to compile with future compilers (such as GCC 14).
|
||||
|
||||
For the tls probe, return a null pointer for future-proofing, although
|
||||
current and upcoming C compilers do not treat this omission as an
|
||||
error.
|
||||
|
||||
Submitted upstream: <https://github.com/icl-utk-edu/papi/pull/142>
|
||||
|
||||
diff --git a/src/configure b/src/configure
|
||||
index 8ce0047d803bd641..f66dc5fb161916c4 100755
|
||||
--- a/src/configure
|
||||
+++ b/src/configure
|
||||
@@ -5232,6 +5232,7 @@ else
|
||||
res1 = (i == (int)arg);
|
||||
else
|
||||
res2 = (i == (int)arg);
|
||||
+ return NULL;
|
||||
}
|
||||
__thread int i;
|
||||
int main () {
|
||||
@@ -5360,7 +5361,7 @@ else
|
||||
exit(1);
|
||||
}
|
||||
done = 1;
|
||||
- return j;
|
||||
+ return (void *) j;
|
||||
}
|
||||
|
||||
int main( int argc, char ** argv ) {
|
||||
diff --git a/src/configure.in b/src/configure.in
|
||||
index cb0a4b59bbed1256..37ff2a98ef85fcfe 100644
|
||||
--- a/src/configure.in
|
||||
+++ b/src/configure.in
|
||||
@@ -714,6 +714,7 @@ AC_ARG_WITH(tls,
|
||||
res1 = (i == (int)arg);
|
||||
else
|
||||
res2 = (i == (int)arg);
|
||||
+ return NULL;
|
||||
}
|
||||
__thread int i;
|
||||
int main () {
|
||||
@@ -805,7 +806,7 @@ AC_ARG_WITH(virtualtimer,
|
||||
exit(1);
|
||||
}
|
||||
done = 1;
|
||||
- return j;
|
||||
+ return (void *) j;
|
||||
}
|
||||
|
||||
int main( int argc, char ** argv ) {
|
@ -11,13 +11,15 @@
|
||||
Summary: Performance Application Programming Interface
|
||||
Name: papi
|
||||
Version: 7.0.1
|
||||
Release: 5%{?dist}
|
||||
Release: 6%{?dist}
|
||||
License: BSD-3-Clause
|
||||
Requires: papi-libs = %{version}-%{release}
|
||||
URL: http://icl.cs.utk.edu/papi/
|
||||
Source0: http://icl.cs.utk.edu/projects/papi/downloads/%{name}-%{version}.tar.gz
|
||||
Patch1: papi-python3.patch
|
||||
Patch5: papi-nostatic.patch
|
||||
Patch6: papi-configure-c99-1.patch
|
||||
Patch7: papi-configure-c99-2.patch
|
||||
BuildRequires: make
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: doxygen
|
||||
@ -91,6 +93,8 @@ the PAPI user-space libraries and interfaces.
|
||||
%setup -q
|
||||
%patch1 -p1 -b .python3
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
|
||||
%build
|
||||
|
||||
@ -185,6 +189,9 @@ find %{buildroot} -type f -executable ! -iname "*.py" ! -iname "*.sh" | xargs ch
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Dec 18 2023 Florian Weimer <fweimer@redhat.com> - 7.0.1-6
|
||||
- Backport upstream patch, add new patch for autoconf C compatibility
|
||||
|
||||
* Wed Aug 9 2023 William Cohen <wcohen@redhat.com> - 7.0.1-5
|
||||
- migrated to SPDX license
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user