[M3devel] [cm3] unresolved pthread symbols during bootstrap

Ronny Forberger ronny.forberger at elegosoft.com
Wed May 30 15:24:16 CEST 2007


Dear m3-Developers,

I could not successfully build the cm3 compiler when invoking

   

> ./do-cm3-std.sh buildship


from the script directory as described in the documentation.

The build process stops by the following:

> === package /root/cm3/m3-sys/m3cgcat ===
>  +++ cm3 -build  -DROOT='/root/cm3'  && cm3 -ship -DROOT='/root/cm3'  +++
> --- building in LINUXLIBC6 ---
>
> ignoring ../src/m3overrides
>
>  -> linking m3cgcat
> /usr/local/cm3/pkg/m3core/LINUXLIBC6/libm3core.a(ThreadPThread.mo): In 
> function `ThreadPThread__InnerLockMutex':
> /root/cm3/m3-libs/m3core/LINUXLIBC6/ThreadPThread.m3:142: undefined 
> reference to `pthread_cond_wait'
>
[ some similar lines removed ]

>
> /usr/local/cm3/pkg/m3core/LINUXLIBC6/libm3core.a(ThreadPThread.mo): In 
> function `RTHooks__PushEFrame':
> /root/cm3/m3-libs/m3core/LINUXLIBC6/ThreadPThread.m3:1429: undefined 
> reference to `pthread_getspecific'
> /root/cm3/m3-libs/m3core/LINUXLIBC6/ThreadPThread.m3:1430: undefined 
> reference to `pthread_setspecific'
> /usr/local/cm3/pkg/m3core/LINUXLIBC6/libm3core.a(ThreadPThread.mo): In 
> function `RTHooks__PopEFrame':
> /root/cm3/m3-libs/m3core/LINUXLIBC6/ThreadPThread.m3:1437: undefined 
> reference to `pthread_setspecific'
> /usr/local/cm3/pkg/m3core/LINUXLIBC6/libm3core.a(ThreadPThread.mo): In 
> function `ThreadPThread__InitHandlers':
> /root/cm3/m3-libs/m3core/LINUXLIBC6/ThreadPThread.m3:1442: undefined 
> reference to `pthread_key_create'
> /root/cm3/m3-libs/m3core/LINUXLIBC6/ThreadPThread.m3:1443: undefined 
> reference to `pthread_setspecific'
> /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libc.a(vfork.o): In 
> function `vfork':
> (.text+0x1): undefined reference to `pthread_create'
> collect2: ld returned 1 exit status
> Fatal Error: package build failed
>  *** execution of  failed ***


Looks like gcc cannot link against the pthread-lib.

I have already added

> "PTHREAD"    : [ "-L/usr/lib", "-lpthread" ]

to the SYSTEM_LIBS array in cm3.cfg.

This is a Debian 4.0  'etch' system (x86) where libpthread.a resides in 
/usr/lib.

I can build trivial C programs like gcc foo.c -L /usr/lib -lpthread 
arccordingly which become linked against libpthread.a properly.


Do you have any glues?

Best regards,

Ronny

-- 
Ronny Forberger
Systemadministrator

elego Software Solutions GmbH           ronny.forberger(at)elegosoft.com
Ohmstraße 9,  10179 Berlin              HRB 77719
Tel.: +49 30 23 45 86 96                Amtsgericht Charlottenburg
Fax:  +49 30 23 45 86 95                Sitz der Gesellschaft: Berlin
http://www.elegosoft.com                Geschäftsführer: Olaf Wagner

Bitte senden Sie Ihre technischen Support-Anfragen an admins(at)elego.de .




More information about the M3devel mailing list