Discussion:
How to add pthread support for GCC powerpc-eabi cross platform?
Jeffi Edward.J
2009-10-23 04:57:28 UTC
Permalink
Hi all,

I build cross tool chain for powerpc-eabi platform with newlib.
When i compiled a POSIX thread program, gcc issues error. In few pages I
could see that current newlib doesnt have support of pthread for
powerpc-eabi platform.
Is there any other way to add pthread support for GCC with newlib?
Sorry if this is not the correct forum to post this query.

Thanks,
Jeffi
--
View this message in context: http://www.nabble.com/How-to-add-pthread-support-for-GCC-powerpc-eabi-cross-platform--tp26020930p26020930.html
Sent from the gcc - Help mailing list archive at Nabble.com.
Michael Eager
2009-10-23 06:36:26 UTC
Permalink
Post by Jeffi Edward.J
Hi all,
I build cross tool chain for powerpc-eabi platform with newlib.
When i compiled a POSIX thread program, gcc issues error. In few pages I
could see that current newlib doesnt have support of pthread for
powerpc-eabi platform.
Is there any other way to add pthread support for GCC with newlib?
Sorry if this is not the correct forum to post this query.
Probably you would have more luck with the Newlib
mailing list: mailto:***@sourceware.org
--
Michael Eager ***@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
Kai Ruottu
2009-10-23 08:32:53 UTC
Permalink
Post by Michael Eager
Post by Jeffi Edward.J
Hi all,
I build cross tool chain for powerpc-eabi platform with newlib.
When i compiled a POSIX thread program, gcc issues error. In few pages I
could see that current newlib doesnt have support of pthread for
powerpc-eabi platform.
Is there any other way to add pthread support for GCC with newlib?
Sorry if this is not the correct forum to post this query.
Probably you would have more luck with the Newlib
For a layman like me some things sound predestined like that Posix threads
being an additional feature in an Posix-compatible opsys meanwhile the
standard C library like newlib implements the base Posix C functions. The
real priests will know more about these things. So...

What is the "operating system" on the target? Does it support Posix
threads?

At least Cygwin on Win32 uses newlib as the base C library and should
support
Posix threads. Also the RTEMS RTOS should use newlib and support Posix
threads :

http://www.rtems.com/wiki/index.php/RTEMSFeatures

So I would be really surprised if newlib should nowadays implement some
"operating system" too...
Ian Lance Taylor
2009-10-23 14:45:24 UTC
Permalink
Post by Kai Ruottu
For a layman like me some things sound predestined like that Posix threads
being an additional feature in an Posix-compatible opsys meanwhile the
standard C library like newlib implements the base Posix C functions. The
real priests will know more about these things. So...
What is the "operating system" on the target? Does it support Posix
threads?
At least Cygwin on Win32 uses newlib as the base C library and should
support
Posix threads. Also the RTEMS RTOS should use newlib and support Posix
http://www.rtems.com/wiki/index.php/RTEMSFeatures
So I would be really surprised if newlib should nowadays implement some
"operating system" too...
newlib used not only on cygwin and RTEMS, but also on pure embedded
systems with no operating system. In that case newlib relies on
libgloss to provide some basic functionality. In that scenario, it
makes sense to ask whether the newlib/libgloss combination provides
POSIX threads for a specific target.

In general, as far as I know, the answer is "no." POSIX threads are
fairly difficult to implement correctly.

Ian
Jeffi Edward.J
2009-10-24 13:14:10 UTC
Permalink
The scenario is as follows... Actually I'm building a huge application using
Diab toolchain . The target RTOS (cant reveal name :-(... ) required kernel
services are also built along with the application. The image is loaded into
target device(powerpc machine) as a bootable image. But that RTOS doesn't
have pthread support., wheras the library used by Diab-c compiler has
pthread library. So it worked fine so far.

Now I'm porting this application to GCC compiler. I built the powerpc-eabi
cross tool chain with newlib. Since the pthread library is not part of
newlib library, I guess I would face problem which porting. :-(..
I can't use Glibc since there is no support for powerpc-eabi in Glibc! How
to over come this problem?

Thanks,
Jeffi
Post by Ian Lance Taylor
Post by Kai Ruottu
For a layman like me some things sound predestined like that Posix threads
being an additional feature in an Posix-compatible opsys meanwhile the
standard C library like newlib implements the base Posix C functions.
The
real priests will know more about these things. So...
What is the "operating system" on the target? Does it support Posix
threads?
At least Cygwin on Win32 uses newlib as the base C library and should
support
Posix threads. Also the RTEMS RTOS should use newlib and support Posix
http://www.rtems.com/wiki/index.php/RTEMSFeatures
So I would be really surprised if newlib should nowadays implement
some
"operating system" too...
newlib used not only on cygwin and RTEMS, but also on pure embedded
systems with no operating system. In that case newlib relies on
libgloss to provide some basic functionality. In that scenario, it
makes sense to ask whether the newlib/libgloss combination provides
POSIX threads for a specific target.
In general, as far as I know, the answer is "no." POSIX threads are
fairly difficult to implement correctly.
Ian
--
View this message in context: http://www.nabble.com/How-to-add-pthread-support-for-GCC-powerpc-eabi-cross-platform--tp26020930p26038926.html
Sent from the gcc - Help mailing list archive at Nabble.com.
Michael Eager
2009-10-24 16:19:15 UTC
Permalink
Post by Jeffi Edward.J
The scenario is as follows... Actually I'm building a huge application using
Diab toolchain . The target RTOS (cant reveal name :-(... ) required kernel
services are also built along with the application. The image is loaded into
target device(powerpc machine) as a bootable image. But that RTOS doesn't
have pthread support., wheras the library used by Diab-c compiler has
pthread library. So it worked fine so far.
Now I'm porting this application to GCC compiler. I built the powerpc-eabi
cross tool chain with newlib. Since the pthread library is not part of
newlib library, I guess I would face problem which porting. :-(..
Newlib only has support for pthreads when run on Linux
(see newlib/libc/sys/linux/linuxthreads).

To support pthreads with your unnamed RTOS in Newlib, you
would need to write all of the corresponding routines which
translate pthreads calls into whatever threading model
the RTOS supports. This is (presumably) what the Diab
tool chain does.

You may be able to link the pthread support from the Diab
tool chain by including the Diab library after Newlib.
Post by Jeffi Edward.J
I can't use Glibc since there is no support for powerpc-eabi in Glibc! How
to over come this problem?
Thanks,
Jeffi
Post by Ian Lance Taylor
Post by Kai Ruottu
For a layman like me some things sound predestined like that Posix threads
being an additional feature in an Posix-compatible opsys meanwhile the
standard C library like newlib implements the base Posix C functions.
The
real priests will know more about these things. So...
What is the "operating system" on the target? Does it support Posix
threads?
At least Cygwin on Win32 uses newlib as the base C library and should
support
Posix threads. Also the RTEMS RTOS should use newlib and support Posix
http://www.rtems.com/wiki/index.php/RTEMSFeatures
So I would be really surprised if newlib should nowadays implement
some
"operating system" too...
newlib used not only on cygwin and RTEMS, but also on pure embedded
systems with no operating system. In that case newlib relies on
libgloss to provide some basic functionality. In that scenario, it
makes sense to ask whether the newlib/libgloss combination provides
POSIX threads for a specific target.
In general, as far as I know, the answer is "no." POSIX threads are
fairly difficult to implement correctly.
Ian
--
Michael Eager ***@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
Jeffi Edward.J
2009-10-25 09:56:36 UTC
Permalink
Thank you for the suggestion. I'll look into my RTOS's threading model and
try to map pthread calls used in my application to native thread APIs! I may
query further in this topic :-)
Post by Michael Eager
Post by Jeffi Edward.J
The scenario is as follows... Actually I'm building a huge application using
Diab toolchain . The target RTOS (cant reveal name :-(... ) required kernel
services are also built along with the application. The image is loaded into
target device(powerpc machine) as a bootable image. But that RTOS doesn't
have pthread support., wheras the library used by Diab-c compiler has
pthread library. So it worked fine so far.
Now I'm porting this application to GCC compiler. I built the
powerpc-eabi
cross tool chain with newlib. Since the pthread library is not part of
newlib library, I guess I would face problem which porting. :-(..
Newlib only has support for pthreads when run on Linux
(see newlib/libc/sys/linux/linuxthreads).
To support pthreads with your unnamed RTOS in Newlib, you
would need to write all of the corresponding routines which
translate pthreads calls into whatever threading model
the RTOS supports. This is (presumably) what the Diab
tool chain does.
You may be able to link the pthread support from the Diab
tool chain by including the Diab library after Newlib.
Post by Jeffi Edward.J
I can't use Glibc since there is no support for powerpc-eabi in Glibc! How
to over come this problem?
Thanks,
Jeffi
Post by Ian Lance Taylor
Post by Kai Ruottu
For a layman like me some things sound predestined like that Posix threads
being an additional feature in an Posix-compatible opsys meanwhile
the
standard C library like newlib implements the base Posix C functions.
The
real priests will know more about these things. So...
What is the "operating system" on the target? Does it support Posix
threads?
At least Cygwin on Win32 uses newlib as the base C library and should
support
Posix threads. Also the RTEMS RTOS should use newlib and support Posix
http://www.rtems.com/wiki/index.php/RTEMSFeatures
So I would be really surprised if newlib should nowadays implement
some
"operating system" too...
newlib used not only on cygwin and RTEMS, but also on pure embedded
systems with no operating system. In that case newlib relies on
libgloss to provide some basic functionality. In that scenario, it
makes sense to ask whether the newlib/libgloss combination provides
POSIX threads for a specific target.
In general, as far as I know, the answer is "no." POSIX threads are
fairly difficult to implement correctly.
Ian
--
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
--
View this message in context: http://www.nabble.com/How-to-add-pthread-support-for-GCC-powerpc-eabi-cross-platform--tp26020930p26046457.html
Sent from the gcc - Help mailing list archive at Nabble.com.
Loading...