Commit
Configure probes the C compiler to find out whether it supports C11 thread local storage, and if found uses this for PERL_SET_CONTEXT/PERL_GET_CONTEXT, in preference to the pthread_setspecific()/pthread_getspecific() approach. However, we can come unstuck with XS extensions written in C++, as on some platforms the C++ compiler can use different syntax for thread local storage. As Configure doesn't have a way to probe for C++ dialects, we just take the safe option and do the same as 5.34.0 and earlier - use pthreads on C++. This commit is minimal because the implementation of PERL_SET_CONTEXT for C11 thread local storage was already defensively written to *also* call pthread_setspecific().
- Loading branch information
There are no files selected for viewing
4 comments
on commit ec238e5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are getting the below error with perl 5.36.0 :
bash-4.4$ CC -mt -xildoff -zdefs -g -L lib -L /scratch/mkothari/perl-5.36.0/12.0/solaris/lib/5.36.0/sun4-solaris-thread-multi-64int-ld/CORE -G -z nocompstrtab -o pcmif.so -L . pcmif.o -lportal -lpinsys -lpcmext -lCrun -lperl -lnsl -lsocket -lposix4 -lthread -lCrun -lm -lc || ( rm -f pcmif.so; exit 1 )
ld: warning: symbol 'PL_current_context' has differing types:
(file pcmif.o type=OBJT; file /scratch/mkothari/perl-5.36.0/12.0/solaris/lib/5.36.0/sun4-solaris-thread-multi-64int-ld/CORE/libperl.so type=TLS );
ld: fatal: relocation error: R_SPARC_GOTDATA_OP_HIX22: file pcmif.o: symbol PL_current_context: relocation illegal for TLS symbol
Command Used :
sh Configure -des -Dcc="cc" -Dusethreads -Dusemorebits -Dprefix=/scratch/mkothari/perl/perl-5.36.0/12.0/solaris && make && make test && make install
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get some help on this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please open a ticket with the details of your perl build (the perl -V output) and whatever you're trying to build against.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think saying it's a problem with some C++ compilers is incorrect - it's a basic incompatibility between the languages.
Your commit message points out that the commit is minimal because we already set the context using pthreads, updating the comment:
to indicate that the value is actually being used might help anyone reading the code in the future.