I need to build GCC 8 from source on my Mac, ultimately without brew. I tried gleaning the relevant portions from the brew formula but the build always fails with the following when --enable-tls is enabled:
/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: *** [alloc_cpp.lo] Error 1
I’ve tried multiple versions of GCC (4.9, 5,5, 8.3, and 8.4) and Mac (10.10, 10.12 and 10.15)–all behave the same.
All systems have only XCode CLT, none have XCode. All systems are fresh installs with very minimal adjustment additions.
If I build without --enable-tls or with --disable-tls then 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).
Anyway I’m looking for the exact environment & commands that brew uses to build GCC on Mac. Any chance there’s some nightly/weekly automated build that captures such info that I can look at to see where I’m going wrong? If not, is there a way I can get such info if I use brew to build GCC on my system? And if so, can I tell brew to leave GCC only in the prefix and not try to tie it into the main system (/usr/… )?