Re: Building on Mac with --enable-tls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:

On Wed, 18 Mar 2020 at 19:15, Tom N <nospam@xxxxxxxxxxxxxxx> wrote:
I'm trying to build GCC from source on Mac (darwin) and keep getting this error when --enable-tls is specified:


/var/folders/cq/wx4ff_gd0xncqh9qnbzmt2w40000gp/T//ccS0vBm1.s:9:2: error: unsupported symbol modifier
in relocation
leaq __ZN3GTM12_gtm_thr_tlsE@tlsgd(%rip), %rdi
^
make[5]: *** [alloc_cpp.lo] Error 1


If I either omit --enable-tls or specify --disable-tls the build succeeds,

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.

but then I get synchronization problems in my code which uses std::unique_lock<std::mutex> (namely it seems the synchronization isn't performed).

That makes no sense, neither std::mutex nor std::unique_lock uses TLS.

Darwin uses emulatedTLS 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).

thanks
Iain




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux