powerpc uClibc0.9.32 threads ( old and NPTL)

Andrei ayakimov at iptec-inc.com
Fri Dec 30 00:19:01 UTC 2011


On Thu, 2011-12-29 at 19:54 +0100, Bernhard Reutner-Fischer wrote:
> 
> On Dec 29, 2011 12:10 AM, "Andrei" <ayakimov at iptec-inc.com> wrote:
> >
> > It looks broken for me.
> > You can build a uClibc 0.9.32 - no problem there.
> > it working fine with uClibc 0.9.30.3.
> > I have build uClibc 0.9.32 using buildroot2011.08 and
> > crosstool-ng-1.13.2 an crosstool-ng-1.13.0
> >
> > This test faling for me at two thread model (old and NPTL) in
> 0.9.32,
> > but working with uClibc 0.9.30.3. (old only - NPLT not supported for
> > powepc):
> >
> > #include <pthread.h>
> >
> > #include <stdio.h>
> > #include <string.h>
> > #include <unistd.h>
> > #include <sys/types.h>
> >
> > #include <errno.h>
> >
> >
> > pthread_t thread;
> >
> > int     param = 1;
> >
> > void *test(void *hndl) {
> >
> >  printf("Thread started with param: %d\n", *((int *)hndl));
> >  while(1) ;
> > }
> >
> > int start_tread()
> > {
> >    pthread_attr_t attr;
> >    struct sched_param sched;
> >    int res;
> >
> >    sched.sched_priority= 10;
> >
> >    pthread_attr_init(&attr);
> >    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
> >
> >    res = pthread_attr_setstacksize (&attr, 16*1024);
> >
> >    if(res != 0) {
> >        printf("cannnot set a stack: %s.\n", strerror(res));
> >        return 0;
> >    }
> >
> >    res = pthread_attr_setschedpolicy(&attr, SCHED_FIFO);
> >    if(res != 0) {
> >        printf("cannnot set policy: %s.\n", strerror(res));
> >        return 0;
> >    }
> >    res = pthread_attr_setschedparam(&attr, &sched);
> >    if(res != 0) {
> >        printf("cannnot set sheduler: %s.\n", strerror(res));
> >        return 0;
> >    }
> >    if(getuid() == 0){
> >        res =
> > pthread_attr_setinheritsched(&attr,PTHREAD_EXPLICIT_SCHED);
> >        if(res != 0) {
> >                printf("cannnot set inherit: %s.\n", strerror(res));
> >            return 0;
> >        }
> >    }
> >
> >    res = pthread_create(&thread, &attr, test, &param);
> >    if(res != 0) {
> >        printf("cannnot start therad: %s.\n", strerror(res));
> >        return 0;
> >    }
> >    return 1;
> > }
> >
> > int main ()
> > {
> >        start_tread();
> >
> >        while(1);
> > }
> >
> >
> > Any advise?
> 
> How does it fail?
> Can you reproduce it with current master?
> 
Unfortunately it will take a time to build current master, my buildroot
(2011.08) can not compile head master with gcc 4.5.3 this is errors:

libc/sysdeps/linux/powerpc/crt1.S: Assembler messages:
libc/sysdeps/linux/powerpc/crt1.S:48: Error: no such instruction: `mr
9,1'
libc/sysdeps/linux/powerpc/crt1.S:49: Error: no such instruction:
`clrrwi 1,1,4'
libc/sysdeps/linux/powerpc/crt1.S:65: Error: no such instruction: `lis
13,_SDA_BASE_ at ha'
libc/sysdeps/linux/powerpc/crt1.S:66: Error: no such instruction: `addi
13,13,_SDA_BASE_ at l'
libc/sysdeps/linux/powerpc/crt1.S:69: Error: no such instruction: `li
0,0'
libc/sysdeps/linux/powerpc/crt1.S:70: Error: no such instruction: `stwu
1,-16(1)'
libc/sysdeps/linux/powerpc/crt1.S:71: Error: no such instruction: `mtlr
0'
libc/sysdeps/linux/powerpc/crt1.S:72: Error: no such instruction: `stw
0,0(1)'
libc/sysdeps/linux/powerpc/crt1.S:74: Error: no such instruction: `lwz
4,0(9)'
libc/sysdeps/linux/powerpc/crt1.S:76: Error: no such instruction: `addi
5,9,4'
libc/sysdeps/linux/powerpc/crt1.S:77: Error: no such instruction: `mr
8,3'
libc/sysdeps/linux/powerpc/crt1.S:89: Error: no such instruction: `lis
6,_init at ha'
libc/sysdeps/linux/powerpc/crt1.S:90: Error: no such instruction: `addi
6,6,_init at l'
libc/sysdeps/linux/powerpc/crt1.S:91: Error: no such instruction: `lis
7,_fini at ha'
libc/sysdeps/linux/powerpc/crt1.S:92: Error: no such instruction: `addi
7,7,_fini at l'
libc/sysdeps/linux/powerpc/crt1.S:93: Error: no such instruction: `lis
3,main at ha'
libc/sysdeps/linux/powerpc/crt1.S:94: Error: no such instruction: `addi
3,3,main at l'
libc/sysdeps/linux/powerpc/crt1.S:95: Error: no such instruction: `b
__uClibc_main'
  



More information about the uClibc mailing list