Hi,
I'm experiencing problems with uClibc-ng when creating static binaries
that uses threads. I originally reported this to the buildroot mailing
list but got redirected here instead.
The problem is when using a combination of stack protection, threads and
static binaries. The program will during start up get a sigsegv in
__pthread_initialize_minimal_internal(), and gdb says the instruction is
a
mov %fs:0x28,%rax
where %fs is 0x00. The reason for that is that the pthread library is
compiled with stack protection but __pthread_initialize_minimal_internal
is called before __libc_setup_tls in static binaries.
I have created an ugly patch to verify my hypothesis (attached). With
that patch the test program works, but what is the proper way to solve
this issue?
With uClibc 0.9.33.x the same thing happens. With glibc the program
works.
Best regards,
Daniel Fahlgren