This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
MACH-O can't support C11 thread local in shared objects, so disable it.
authorNicholas Clark <nick@ccl4.org>
Mon, 21 Jun 2021 08:01:29 +0000 (02:01 -0600)
committerTony Cook <tony@develop-help.com>
Tue, 7 Sep 2021 05:46:16 +0000 (15:46 +1000)
commitb1015292fcc64eae2ffdfbaffbfb27d5f4303369
tree99e82817ea0f9d7d02e1a91cf41e1b6c2b7cc0e0
parent3683a9ee5ad61f8cb5eac30e61b4936bd0445bdb
MACH-O can't support C11 thread local in shared objects, so disable it.

Apple's clang happily passes the probe and compiles _Thread_local no problem,
but building extensions fails with
    ld: illegal thread local variable reference to regular symbol _PL_current_context for architecture arm64

The Internet suggests that the MACH-O format fundamentally can't support
what is needed to implement C11 thread local storage in shared objects.
It's frustrating that the error message is "Less Than Awesome" at explaining
that this is the real problem here.

Hence disable the use of C11 thread local storage in the hints file, and
hence keep using pthreads.
hints/darwin.sh
makedef.pl