[uClinux-dev] thread error Samsung 4510B

Enrico Lanza lanza at ivreasistemi.it
Fri Oct 7 03:24:10 EDT 2005


Hi,

 

I have some problem to run thread in Samsung 4510B enviroment.

 

This is my source:

 

**** Prog.c ****

 

#include <stdio.h>

#include <unistd.h>

#include <pthread.h>

 

pthread_t thread;

 

void *thread_fx(void *par);

 

int main()

{

printf("PROG INIT\n\r");

if (pthread_create(&thread, NULL, thread_fx, NULL))

            {

            printf("pthread_create error\n\r");

            }

printf("PROG RUN\n\r");

pthread_join(thread, 0);

return(0);

}

 

void *thread_fx(void *par)

{

int i;

 

printf("THREAD 2 START\n\r");

for (i = 0; i < 100; i++)

            {

            printf("THREAD 2 RUN\n\r");

            }

pthread_exit(0);

}

 

******************

 

 

 

*** Makefile ***

 

EXEC = thread

OBJS = prog.o

 

CFLAGS += -I/home/linux/work/uClinux-dist/uClibc/include
-I/home/linux/work/uClinux-dist/uClibc/libc/sysdeps/linux/common

 

all: $(EXEC)

 

romfs:

            $(ROMFSINST) /bin/$(EXEC)

 

$(EXEC): $(OBJS)

            $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)

 

clean:

            -rm -f $(EXEC) *.elf *.gdb *.o

 

$(OBJS):

 

 

******************

 

 

I tried to compile this source and I got an error in
uClinux-dist/uClibc/libc/sysdeps/linux/common/sigthread.h file as
follow:

 

/home/linux/work/uClinux-dist/uClibc/libc/sysdeps/linux/common/sigthread
.h:32 parse error before '*'

 

 

I commented this line as below:

 

//extern int pthread_sigmask (int __how, __const __sigset_t *__restrict
__newmask, __sigset_t *__restrict __oldmask) __THROW;

 

So the compiler result was OK. I run the program in target but it didn't
work.

 

I put this option flag in Makefile

 

LDFLAGS = -D_REENTRANT

LDLIBS = -lpthread

 

but occurred a compiler error:

 

arm-elf-gcc -D_REENTRANT -o thread prog.o -lpthread -X -o thread
/opt/uClinux/lib/gcc-lib/arm-elf/2.95.3/crtbegin.o
-L/opt/uClinux/lib/gcc-lib/arm-elf/2.95.3 -L/opt/uClinux/arm-elf/lib
prog.o -lpthread -lgcc -lc -lgcc
/opt/uClinux/lib/gcc-lib/arm-elf/2.95.3/crtend.o

/opt/uClinux/arm-elf/bin/gld: cannot open crt0.o: No such file or
directory

 

 

Can you help me about this problem?

 

Thanks

 

Enrico

 

 

 

 

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.uclinux.org/pipermail/uclinux-dev/attachments/20051007/8ba26d64/attachment.html>


More information about the uClinux-dev mailing list