papi/papi-configure-c99-1.patch

74 lines
3.5 KiB
Diff

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;