__builtin_thread_pointer

Brian Inglis Brian.Inglis@SystematicSW.ab.ca
Tue Feb 11 20:45:59 GMT 2025


On 2025-02-11 12:41, Dimitry Andric via Cygwin wrote:
>> On 11 Feb 2025, at 20:26, Ken Brown via Cygwin wrote:
>> Does Cygwin support __builtin_thread_pointer?  I'm guessing not, because
>> I'm getting a link error (undefined reference to
>> `__builtin_thread_pointer') when I try to build some software that uses
>> it.  Or is there something that would have to be added to the link command
>> line?  The full command line and error message are quoted below, in case
>> anyone spots something obvious.

> It's a gcc builtin function, not something implemented in an external 
> library. Therefore, there is no linker option that can fix this.
> Also, as far as I can see from gcc's documentation,
> __builtin_thread_pointer() is only supported for the RISCV and SH
> architectures. Then again, gcc's implementation seems to hinge this on
> whether the platform supports TLS or not.
> In any case, it is probably better to not use this function if your gcc does
> not support it.
Does `info gcc tls` help and do we know if that is supported by our gcc(s)?

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher  but when there is no more to cut
                                 -- Antoine de Saint-Exupéry


More information about the Cygwin mailing list