Building on Mac with --enable-tls
Jonathan Wakely
jwakely.gcc@gmail.com
Thu Mar 19 14:07:22 GMT 2020
On Thu, 19 Mar 2020 at 13:54, Tom N <nospam@codesniffer.com> wrote:
>
> > On March 18, 2020 at 7:53 PM Iain Sandoe <idsandoe@googlemail.com> wrote:
> >
> > Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> > >
> > > I would expect the default to be correct for the target i.e.--disable-tls. If enabling it worked correctly, it would be the default.
> > > That makes no sense, neither std::mutex nor std::unique_lock uses TLS.
> >
> > Darwin uses emulated TLS on all versions (powerpc, i686, x86_64) the correct default (to use emulatedTLS) is selected without requiring any additional configure options. Selecting --enable-tls will undoubtedly produce an invalid configuration.
> >
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52268 is an enhancement PR to add native TLS for 10.7+ (but that would still not work on earlier versions, of course).
>
> Thank you both for the quick responses! Knowing that lack of --enable-tls is normal on Mac set me in the right direction. The synchronization problem was due to an equally bad assumption. All working as expected now.
Accidentally creating a temporary unique_lock that immediately goes
out of scope? :-)
http://kayari.org/cxx/antipatterns.html#locking-mutex
More information about the Gcc-help
mailing list