powerpccodesourcery

Pthread support for Power arch in Codesourcery toolchain on Windows


Codesourcery toolchain for powerpc on IA32 Windows used to have libc folder and support for pthreads among other things. Now Codesourcery from Mentor graphics uses newlibc and hence libc directory ( that has librt.a and libpthread.a) is omitted. To build my application for powerpc e500v2 core on windows I need to link it to -lrt and -lpthread. I have tried various options by using toolchain from Mentor graphics Codesourcery and adding libc liberaries ( libpthread, librt) from

1> Toolchain for Applied Micro Circuits ( AMCC) that has pthread support for e500 mc and other powerpc cores, but code built for e500mc can't be used for e500v2 as of now. So adding their libpthread.a in toolchain for e500v2 is giving error

TLS reference in ../../..\libpthread.a(pthread_create.o) mismatches non-TLS reference in powerpc-eabi/lib\libc.a(lib_a-reent.o)

2> Toolchain for e500v2 for linux from Codesourcery, ELDK etc has pthread support for linux, using those libpthread.a and librt.a will also produce above mentioned error. It is mentioned non TLS reference errors can be removed in below link, but I couldn't find any success after following these

http://www.linuxquestions.org/questions/linux-general-1/ld-errno-tbss-mismatches-non-tls-reference-588894/

The Red Hat newlib C liberary, that is being used in all codesourcery toolchains for Windows doesn't have support of pthread for powerpc-eabi platform ( but for linux, ELDK toolchain has pthread support for e500V2).

I'm trying to build for freescale P1010-RDB eval board.

What could be done to get pthread support for powerpc e500v2 core using Codesourcery EABI hosted on IA32 Windows?


Solution

  • If you want pthreads then @ams is probably right and you mixed up bare metal and Linux platforms. You probably want the Windows host Power GNU/Linux toolchain: https://sourcery.mentor.com/GNUToolchain/release1785

    newlib is used only on the bare-metal toolchain variants and since the EABI variant is intended for bare-metal applications there is not a pthread implementation.