Skip to content

Commit

Permalink
configure: fix tls detection
Browse files Browse the repository at this point in the history
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 *).
  • Loading branch information
gcongiu committed Sep 29, 2023
1 parent e96f2b3 commit dd11311
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/configure
Original file line number Diff line number Diff line change
Expand Up @@ -5232,7 +5232,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)
Expand Down Expand Up @@ -5425,7 +5425,7 @@ else
int gettid() {
return syscall( SYS_gettid );
}
int doThreadOne( void * v ) {
void *doThreadOne( void * v ) {
struct tms tm;
int status;
while (!done)
Expand All @@ -5435,7 +5435,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;
Expand Down
6 changes: 3 additions & 3 deletions src/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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;
Expand Down

0 comments on commit dd11311

Please sign in to comment.