It's currently not possible to compile PulseAudio master on macOS 10.12 with the compiler shipped with Xcode 8, which does not support thread-local storage. CC pulsecore/libpulsecore_9.0_la-thread-mq.lo pulsecore/thread-mq.c:35:1: error: thread-local storage is not supported for the current target PA_STATIC_TLS_DECLARE_NO_FREE(thread_mq); ^ ./pulsecore/thread.h:100:12: note: expanded from macro 'PA_STATIC_TLS_DECLARE_NO_FREE' static __thread void *name##_tls = NULL; \ ^ 1 error generated. Is it possible to use a portable substitute if one exists? I know Boost has one, though that doesn't help since this is C.
It seems that we already use an alternative TLS mechanism in case __thread isn't supported. Apparently the TLS support detection doesn't work correctly with Xcode. configure.ac uses the AX_TLS macro, which I believe is supposed to do the detection. The macro is implemented in m4/ax_tls.m4, and it originates from autoconf-archive. It seems that the upstream version of ax_tls.m4 has changed since we imported it in PulseAudio, but the changes seem mostly cosmetic. In any case, it's worth a try to replace m4/ax_tls.m4 with the current upstream version[1]. The macro looks like it tries to compile a program with the __thread keyword, and apparently that succeeds when you run configure? That suggests that the compiler that the configure script uses is different from what Xcode uses. If that's the case, you need to somehow fix that. [1] http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_tls.m4
Got it. I looked in my config.log and compared the arguments that the configure test was compiled with, versus the arguments that were used for actually compiling PA. It's -mmacosx-version-min=10.5 that causes the problem. If you configure with --with-mac-version-min=10.7, it builds. I suggest making 10.7 the default value for that configure flag, or otherwise making sure that the configure flag is added to the CFLAGS before doing the AX_TLS test. I could make a patch for whichever one of those is preferable.
A patch would be lovely. I'm not familiar with the Apple ecosystem. If we require 10.7, does that leave a significant chunk of users out? If not, requiring 10.7 is fine.
Created attachment 127889 [details] [review] Patch OK, here's the patch. I expect very few people still use 10.5 and 10.6 but if it's trivial anyway to keep supporting them, then why not. I don't have a 10.5 system to test on, but this compiles correctly with -mmacosx-version-min=10.5 on my 10.12 system.
Thanks! I applied the patch to the "next" branch.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.