Question: Does uclibc support NPTL TLS ?

Sheng Yong shengyong1 at huawei.com
Thu May 28 01:13:42 UTC 2015


Hi,

On 5/28/2015 2:24 AM, Waldemar Brodkorb wrote:
> Hi,
> Sheng Yong wrote,
> 
>> Hi,
>>
>> I encountered a problem when I test thread local storage
>> on my arm board (kernel 3.10.77 and uclibc 0.99.3.2).
>>
>> Please let me know if I am doing something wrong for
>> debugging TLS.
> 
> You mean 0.9.33.2?
> Sure it has NPTL/TLS support, but it depends if it is
> configured in or not. uClibc support linuxthreads, linuxthreads-new
> and NPTL for ARM. So it depends how it got configured.
Yes, I think configures about TLS are enabled. We try to use NPTL/TLS.

UCLIBC_HAS_THREADS_NATIVE=y
UCLIBC_HAS_THREADS=y
UCLIBC_HAS_TLS=y

But I don't know if there is anything we missed?

Thanks,
Sheng

>  
>> on my x86 host machine:
>> root at kernel-host:~> cat tls.c
>> __thread int i =5;
>>
>> int
>> main (int argc, char **argv)
>> {
>>   return 0;
>> }
>>
>> root at kernel-host:~> arm-linux-uclibceabi-gcc -o tls tls.c -g -lpthread
>>
>> on my arm board:
>> -bash-4.2# gdb ./tls
>> GNU gdb (GDB) 7.6
>> Copyright (C) 2013 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
>> This is free software: you are free to change and redistribute it.
>> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
>> and "show warranty" for details.
>> This GDB was configured as "arm-euler-linux-uclibceabi".
>> For bug reporting instructions, please see:
>> <http://www.gnu.org/software/gdb/bugs/>...
>> Reading symbols from /tmp/zz/tls...done.
>> (gdb) b main
>> Breakpoint 1 at 0x8518: file tls.c, line 6.
>> (gdb) r
>> Starting program: /tmp/zz/tls
>> [Thread debugging using libthread_db enabled]
>> Using host libthread_db library "/lib/libthread_db.so.1".
>>
>> Breakpoint 1, main (argc=1, argv=0xbefffd84) at tls.c:6
>> 6	tls.c: No such file or directory.
>> (gdb) whatis i
>> type = int
>> (gdb) p i
>> Cannot find thread-local storage for Thread 0xb6ffb000 (LWP 538), executable file /tmp/zz/tls:
>> *capability not available*
>> (gdb)
> 
> Strange error. 
> 
> best regards
>  Waldemar
> 
> .
> 



More information about the uClibc mailing list