public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Building on Mac with --enable-tls
@ 2020-03-18 19:14 Tom N
  2020-03-18 23:05 ` Jonathan Wakely
  0 siblings, 1 reply; 6+ messages in thread
From: Tom N @ 2020-03-18 19:14 UTC (permalink / raw)
  To: gcc-help

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

(Incidentally I've been building GCC for many years on Linux without issue so I'm not new to building GCC.)

I've tried on "fresh" (new system) Mac Yosemite (10.10), Sierra (10.12), and Catalina (10.15) (all having only XCode CLT, none have XCode itself), and GCC 4.9, 8.3, and 8.4.   All fail the same.   I've gleaned as much as I can from reading the Homebrew script that builds the same but still no luck.

I was hoping to find a build log from either GCC's own verification builds or Homebrew in order to compare against my own to find the problem but can't find it.

Here's the configure line from GCC 8.4 on Catalina (some of it may be unnecessary/redundant, it comes from my build toolchain):


cd ./build && CC=gcc CXX=g++ CFLAGS="" CXXFLAGS="" CPPFLAGS="" LDFLAGS="" BOOT_CFLAGS="-iframework /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -mmacosx-version-min=10.15" CFLAGS_FOR_TARGET="-iframework /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Lib
rary/Frameworks -mmacosx-version-min=10.15" CXXFLAGS_FOR_TARGET="-iframework /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -mmacosx-version-min=10.15" BOOT_LDFLAGS="-Wl,-headerpad_max_install_names" PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin /Users/me/gcc/gcc-8.4.0/configure --prefix=/Users/me/gcc_build --enable-languages=c,c++ --enable-threads=posix --enable-tls --disable-nls --enable-checking=release --disable-multilib --with-native-system-header-dir="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"


Happy to provide anything else that will help.

This has been beating me for a long time, appreciate anything.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-21 17:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18 19:14 Building on Mac with --enable-tls Tom N
2020-03-18 23:05 ` Jonathan Wakely
2020-03-18 23:53   ` Iain Sandoe
2020-03-19 13:54     ` Tom N
2020-03-19 14:07       ` Jonathan Wakely
2020-03-21 17:26         ` Tom N

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).