From: xtkoba+ruby@... Date: 2021-07-03T11:16:22+00:00 Subject: [ruby-core:104485] [Ruby master Bug#18019] 3.0.X fails to link on Mac OS X 10.15.7 due to linker error related to _coroutine_transfer Issue #18019 has been updated by xtkoba (Tee KOBAYASHI). The content of `ext/bigdecimal/mkmf.log` in the build directory might help. But before seeing it I guess that something is wrong with your binutils (`gnm`, `gar`, ...) as I see the following message in the attached log: ``` linking static-library libruby.3.0-static.a gar: dln.o: unknown load command 0x32 ``` Googling with "unknown load command 0x32" I found an issue in binutils Bugzilla [1] which implies that this issue should be fixed in newer versions. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=23728 Note that the configure script by default prefers `g`-prefixed version of binutils tools, and so `gnm` and `gar` are used when they are available instead of `nm` and `ar` which should come with Apple's Xcode distribution. To use non `g`-prefixed version you can specify `NM` and `AR` (and other tools if necessary) such as: ``` ./configure NM=nm AR=ar ``` ---------------------------------------- Bug #18019: 3.0.X fails to link on Mac OS X 10.15.7 due to linker error related to _coroutine_transfer https://bugs.ruby-lang.org/issues/18019#change-92746 * Author: mic-kul (Michal Kulesza) * Status: Open * Priority: Normal * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- I'm struggling with building ruby 3.0.X on my Mac Catalina (Intel based). Please note all 2.X versions are compiling correctly. I've already tried to use gnugcc but getting same error: ``` ��� gcc --version Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/c++/4.2.1 Apple clang version 12.0.0 (clang-1200.0.32.29) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin ��� g++ --version Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/c++/4.2.1 Apple clang version 12.0.0 (clang-1200.0.32.29) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin ``` Linker command fails on (full log attached): ``` + clang -fdeclspec -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -std=gnu99 -pipe -L. -fstack-protector-strong -L/usr/local/lib -fstack-protector-strong -Wl,-pie -framework Security -framework Foundation main.o dmydln.o miniinit.o dmyext.o array.o ast.o bignum.o class.o compar.o compile.o complex.o cont.o debug.o debug_counter.o dir.o dln_find.o encoding.o enum.o enumerator.o error.o eval.o file.o gc.o hash.o inits.o io.o iseq.o load.o marshal.o math.o memory_view.o mjit.o mjit_compile.o node.o numeric.o object.o pack.o parse.o proc.o process.o ractor.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o scheduler.o signal.o sprintf.o st.o strftime.o string.o struct.o symbol.o thread.o time.o transcode.o transient_heap.o util.o variable.o version.o vm.o vm_backtrace.o vm_dump.o vm_sync.o vm_trace.o coroutine/amd64/Context.o enc/ascii.o enc/us_ascii.o enc/unicode.o enc/utf_8.o enc/trans/newline.o explicit_bzero.o setproctitle.o addr2line.o -lpthread -lgmp -ldl -lobjc -o miniruby Undefined symbols for architecture x86_64: "_coroutine_transfer", referenced from: _fiber_setcontext in cont.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [miniruby] Error 1 ``` Some people reported the same issue with Catalina and Big Sur: https://github.com/rbenv/ruby-build/issues/1723#issuecomment-872548168 Command Line Tools SDKs: ``` ��� ls /Library/Developer/CommandLineTools/SDKs/ 14 13 Feb 13:12 MacOSX.sdk -> MacOSX11.1.sdk 9 Jul 2020 MacOSX10.15.sdk 30 Nov 2020 MacOSX11.1.sdk ``` I have very basic understanding of C and I'm suspecting that removal of this macro can be causing this behaviour: https://git.ruby-lang.org/ruby.git/commit/?id=e0f0ab959e , but I'm more than happy to be proven wrong ---Files-------------------------------- full_log.txt (32.5 KB) full-error.log (50.8 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: