summaryrefslogtreecommitdiff
path: root/makedef.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2021-06-21 02:01:29 -0600
committerTony Cook <tony@develop-help.com>2021-09-07 15:46:16 +1000
commitb1015292fcc64eae2ffdfbaffbfb27d5f4303369 (patch)
tree99e82817ea0f9d7d02e1a91cf41e1b6c2b7cc0e0 /makedef.pl
parent3683a9ee5ad61f8cb5eac30e61b4936bd0445bdb (diff)
downloadperl-b1015292fcc64eae2ffdfbaffbfb27d5f4303369.tar.gz
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.
Diffstat (limited to 'makedef.pl')
-rw-r--r--makedef.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/makedef.pl b/makedef.pl
index f13573171e..6f570588b3 100644
--- a/makedef.pl
+++ b/makedef.pl
@@ -189,8 +189,9 @@ my %skip;
# All platforms export boot_DynaLoader unconditionally.
my %export = ( boot_DynaLoader => 1 );
+# d_thread_local not perl_thread_local - see hints/darwin.sh
++$export{PL_current_context}
- if defined $Config{perl_thread_local} && $define{USE_ITHREADS};
+ if defined $Config{d_thread_local} && $define{USE_ITHREADS};
sub try_symbols {
foreach my $symbol (@_) {