Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-05

fpc program now can work under uclibc based linux system, but using cthreads fails.

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Florian Klaempfl
to 开心
Show quoted text 7 lines
I compile my program with fpc2.3.1, then copy all the necessary .o files to uclibc linux to link, and it works! But cthreads.pp throwing an Access Violation on my system, I tried to debug this and am stuck now in *cthreads*.pp. line 289: if *pthread_create*(ppthread_t(@threadid), @thread_attr, @ThreadMain,ti) 0 then I would like to know how to patch it.

Do you have any example how it works in C?

Reply by email

Jonas Maebe
to 开心:
开心 wrote 9 lines
I compile my program with fpc2.3.1, then copy all the necessary .o files to uclibc linux to link, and it works! But cthreads.pp throwing an Access Violation on my system, I tried to debug this and am stuck now in cthreads.pp. line 289: if pthread_create(ppthread_t(@threadid), @thread_attr, @ThreadMain,ti) 0 then I would like to know how to patch it.

The definition of some pthread types may be different in uclibc than in gnu libc. Check whether the types and function definitions in rtl/ linux/pthread.inc match those in your C header files.

Jonas

Reply by email

Jonas Maebe
to 开心
开心 wrote
But using pthreads alone is working fine.

The example you gave does not use e.g. a pthread_attr_t, while the cthreads unit does. There may also be other differences.

Jonas

Reply by email