This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: pthread_cancel and static libgcc libgcc_eh without libc bits
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-help at sourceware dot org
- Date: Thu, 13 Oct 2016 17:20:40 -0300
- Subject: Re: pthread_cancel and static libgcc libgcc_eh without libc bits
- Authentication-results: sourceware.org; auth=none
- References: <20161013121931.GD427@freedom> <20161013194407.GD21808@waldemar-brodkorb.de>
On 13/10/2016 16:44, Waldemar Brodkorb wrote:
> Hi,
> sylvain.bertrand@gmail.com wrote,
>
>> Hi,
>>
>> Correct me if I'm wrong: pthread_cancel does work properly when linking a shared nptl lib with
>> static libgcc and libgcc_eh, which where compiled without their libc bits?
>>
>> Or the shared libgcc_s is _mandatory_ for pthread_cancel to work in a shared nptl lib?
>
> I asked a similar question once. See the archives.
> libgcc_s is mandatory and is used via dlopen.
If you build pthread_cancel.c as a shared library it will call
'pthread_cancel_init' which in in the end dlopen libgcc_s.so.
I think it would be feasible to add support for static libcgcc
on pthread_cancel_init by first trying to get unwind symbol
using __libc_dlsym (RTLD_DEFAULT, ...) and trying to dlopen
just if it is not found.