Description
Description
"New Clang" means Apple Clang >= 6.1 or open source Clang >= 3.6
"Old Clang" means Apple Clang < 6.1 or open source Clang < 3.6
If you build perl with Old Clang such that PERL_TSA_ACTIVE
is not defined, then functions perl_tsa_mutex_lock
and perl_tsa_mutex_unlock
do not get compiled and included in perl. If you later build a perl module with New Clang such that PERL_TSA_ACTIVE
is defined, the module tries to use the nonexistent perl_tsa_mutex_lock
and perl_tsa_mutex_unlock
which fails at link time with an undefined symbol error. See https://trac.macports.org/ticket/57648 where this issue was reported to MacPorts; there have been other tickets as well.
In MacPorts it is not practical to guarantee that perl and all modules are compiled with the same compiler. (See also #18939.) For example, between the time that perl and a perl module are built, the version of compiler might have changed due to an Xcode upgrade, or a user may have installed perl from a binary built on another computer with another version of Xcode.
I wonder what a good workaround would be. Would it suffice for us to force the use of New Clang when building just perl? If a perl module is later built with New Clang it would use perl_pthread_mutex_lock
which was built into perl and if building a perl module with Old Clang it would use pthread_mutex_lock
which is a standard function which should always be available.
Steps to Reproduce
Build perl with Old Clang. Then build a module that uses perl_pthread_mutex_lock
with New Clang.
Relevant code appears to be here:
Lines 3237 to 3259 in 415da10
Lines 201 to 207 in 3e25f6d
Lines 6741 to 6761 in 6e512bc
Expected behavior
Successful build
Perl configuration
n/a