undefined reference to `pthread_atfork'

Pagina: 1
Acties:

Onderwerpen


Acties:
  • 0 Henk 'm!

  • vip200
  • Registratie: Juli 2006
  • Laatst online: 09-08-2024
Ik loop bij het builden van node.js aan tegen een vage error:

./configure
...
Checking for library pthread             : yes
Checking for function pthread_create     : yes
Checking for function pthread_atfork     : not found <-- hier gaat het fout
./node-v0.1.93/deps/libeio/wscript:13: error: the configuration failed (see './node-v0.1.93/build/config.log')


In ./build/config.log
code:
1
2
3
4
5
...
In function `main':
test.c:(.text+0xe): undefined reference to `pthread_atfork'
test.c:(.text+0x12): undefined reference to `pthread_atfork'
...


Heb test.c opgezocht, staat in build/.conf_check_0
code:
1
2
3
4
5
6
7
#include <pthread.h>

        int main() {
        void *p;
        p=(void*)(pthread_atfork);
        return 0;
}


Als ik deze code door gcc haal dan krijg ik inderdaad de foutmelding (undefined reference to pthread_atfork) die hierboven staat.

Het bestand "pthread.h" staat netjes in include/
code:
1
2
3
4
5
...
extern int pthread_atfork (void (*__prepare) (void),
                           void (*__parent) (void),
                           void (*__child) (void)) __THROW;
...


Google heeft niets opgeleverd:
1) Wordt gezegd dat je "gcc -lpthread" moet gebruiken, maar dat zou ./configure toch moeten afhandelen (?) en werkt trouwens ook niet
2) Als je via cygwin op windows C code gaat compilen, heb je pthread-w32 oid nodig, maar ik zit op linux

uname -a
Linux nas1 2.6.24 #1141 Sat Mar 13 00:50:14 CST 2010 ppc GNU/Linux

gcc -v
gcc driver version 3.4.6 executing gcc version 3.4.3

cat /proc/version
Linux version 2.6.24 (root@image13) (gcc version 3.4.3 20041021 (prerelease)) #1141 Sat Mar 13 00:50:14 CST 2010

Acties:
  • 0 Henk 'm!

  • igmar
  • Registratie: April 2000
  • Laatst online: 03-09 22:58

igmar

ISO20022

Welke libc gebruik je ?

code:
1
/lib/libc.so.6


draaien, en graag de uitvoer posten.

Acties:
  • 0 Henk 'm!

  • vip200
  • Registratie: Juli 2006
  • Laatst online: 09-08-2024
GNU C Library stable release version 2.3.4, by Roland McGrath et al.
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 3.4.3 20041021 (prerelease).
Compiled on a Linux 2.6.11 system on 2005-10-05.
Available extensions:
        GNU libio by Per Bothner
        crypt add-on version 2.1 by Michael Glad and others
        linuxthreads-0.10 by Xavier Leroy
        spe-0.1 by Aldy Hernandez
        BIND-8.2.3-T5B
        libthread_db work sponsored by Alpha Processor Inc
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
        software FPU emulation by Richard Henderson, Jakub Jelinek and others
        software FPU emulation by Richard Henderson, Jakub Jelinek and others
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.

Acties:
  • 0 Henk 'm!

  • H!GHGuY
  • Registratie: December 2002
  • Niet online

H!GHGuY

Try and take over the world...

Dat is een redelijk oude versie van glibc, maar pthread_atfork zit er wel in, zoals je zelf zegt.

Ik vermoed dat je wel een #define moet instellen om hem beschikbaar te maken en mogelijk moet je compileren met -nptl. Bekijk even de header file op zoek naar defines die je moet instellen en lees even de handleiding van je compiler op zoek naar die -nptl switch.

ASSUME makes an ASS out of U and ME


Acties:
  • 0 Henk 'm!

  • igmar
  • Registratie: April 2000
  • Laatst online: 03-09 22:58

igmar

ISO20022

vip200 schreef op vrijdag 07 mei 2010 @ 12:50:
        linuxthreads-0.10 by Xavier Leroy
Je libc gebruikt linuxthreads. Die kent geen pthread_atfork(). Z'n opvolger (NPTL) kent 'm wel.