Can't build libpthread for M3

Andrii bearrailgun at gmail.com
Thu Oct 23 22:50:27 UTC 2014


I tried to build a very simple app which just calls pthread_create() and
prints debugs. And I could say it works.
0.9.33.2 release + 2 patches from emcraft and 1 more fix for compilation.
So If someone needs uclibc with threads
for M3 - it could be downloaded here:
https://github.com/repu1sion/uclibc
(not an advertisement - just hope it will solve someone's problem).
It was built with
make ARCH_CFLAGS= 'CPU_CFLAGS=-mthumb -march=armv7 -mfix-cortex-m3-ldrd'
as Sergei said but I think its not about flags but about complicated app I
tried to run before and some issues with
mem allocations (not stack size. stack size was changed
with arm-uclinuxeabi-flthdr to 32Kb and was enough when running without
threads)

/opt # ./zpm_thread
00033 : pthread_initialize: initial thread stack bounds: bos=0x1,
tos=0xffffffff
app started. v1
00033 : __pthread_initialize_manager: manager stack: size=8160,
bos=0xa0018008, tos=0xa0019fe8
00033 : __pthread_initialize_manager: send REQ_DEBUG to manager thread
00034 : __pthread_manager: before poll
00033 : pthread_create: write REQ_CREATE to manager thread
00034 : __pthread_manager: after poll
00034 : __pthread_manager: before read
00034 : __pthread_manager: after read, n=28
00034 : __pthread_manager: got REQ_CREATE
00033 : pthread_create: before suspend(self)
00034 : pthread_allocate_stack: malloced chunk: base=0xa0278008, size=0x4000
00034 : pthread_allocate_stack: thread stack: bos=0xa0278008, tos=0xa027bea8
00034 : pthread_allocate_stack: initial stack: bos=0xa0019fe8,
tos=0xa0278008
00034 : pthread_handle_create: cloning new_thread = 0xa027bea8
00034 : pthread_handle_create: new thread pid = 35
00035 : pthread_start_thread:
new thread created
thread
00034 : __pthread_manager: restarting 0xa004ddd0
00033 : pthread_create: after suspend(self)
app
00034 : __pthread_manager: before poll
thread
app

Thanks for the help!


On Thu, Oct 23, 2014 at 6:25 PM, Bernhard Reutner-Fischer <
rep.dot.nop at gmail.com> wrote:

> On 22 October 2014 12:11:26 CEST, Sergei Poselenov <sposelenov at emcraft.com>
> wrote:
> >Hello,
> >
>
> >Uclibc (still) lacks pthreads support on Cortex-M3.
> >
> >I'm attaching two patches:
> > - implement testandset() for Cortex-M3.
> > - Fix a bug in implementation of clone() for Cortex-M3.
>
> Can you please send the two patches with appropriate signed-off-by lines?
>
> TIA,
>
>


More information about the uClibc mailing list