[ruby-core:104483] [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
From:
mickul@...
Date:
2021-07-03 08:08:11 UTC
List:
ruby-core #104483
Issue #18019 has been updated by mic-kul (Michal Kulesza).
File full-error.log added
Thanks @xtkoba.
I've tried this and now it fails on compiling bigdecimal:
```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
./bigdecimal.h:122:1: error: redefinition of 'rb_array_const_ptr'
rb_array_const_ptr(VALUE a)
^
../.././include/ruby/internal/core/rarray.h:184:1: note: previous definition is here
rb_array_const_ptr(VALUE a)
^
In file included from bigdecimal.c:13:
./bigdecimal.h:139:1: error: static declaration of 'rb_sym2str' follows non-static declaration
rb_sym2str(VALUE sym)
^
../.././include/ruby/internal/symbol.h:63:7: note: previous declaration is here
VALUE rb_sym2str(VALUE);
^
bigdecimal.c:108:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:39:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
^
bigdecimal.c:120:1: error: static declaration of 'rb_rational_den' follows non-static declaration
rb_rational_den(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:40:7: note: previous declaration is here
VALUE rb_rational_den(VALUE rat);
^
bigdecimal.c:132:1: error: static declaration of 'rb_complex_real' follows non-static declaration
rb_complex_real(VALUE cmp)
^
../.././include/ruby/internal/intern/complex.h:38:7: note: previous declaration is here
VALUE rb_complex_real(VALUE z);
^
bigdecimal.c:144:1: error: static declaration of 'rb_complex_imag' follows non-static declaration
rb_complex_imag(VALUE cmp)
^
../.././include/ruby/internal/intern/complex.h:39:7: note: previous declaration is here
VALUE rb_complex_imag(VALUE z);
^
6 errors generated.
make[2]: *** [bigdecimal.o] Error 1
make[1]: *** [ext/bigdecimal/all] Error 2
make: *** [build-ext] Error 2
```
----------------------------------------
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-92744
* 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: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>