Failed to activate YJIT for 3.2.0-dev on macOS Ventura (M1: Apple Silicon) #2094
-
Unable to activate YJIT for the latest 3.2.0-dev in the following:
I also checked https://github.com/rbenv/ruby-build/wiki#macos and #1961 (comment) for the setup. Regarding 3.2.0-dev ( But without specifying The following is one of the case:
$ rbenv install 3.2.0-dev --verbose
...
generating table from enc/trans/big5.c
generating table from enc/trans/cesu_8.c
generating table from enc/trans/chinese.c
generating table from enc/trans/ebcdic.c
generating table from enc/trans/emoji.c
generating table from enc/trans/emoji_iso2022_kddi.c
generating table from enc/trans/emoji_sjis_docomo.c
generating table from enc/trans/emoji_sjis_kddi.c
generating enc/trans/cesu_8.c ...
generating table from enc/trans/emoji_sjis_softbank.c
generating enc/trans/ebcdic.c ...
linking miniruby
generating enc/trans/emoji.c ...
generating table from enc/trans/escape.c
generating enc/trans/emoji_sjis_docomo.c ...
ld: warning: ignoring file yjit/target/release/libyjit.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
generating enc/trans/chinese.c ...
Undefined symbols for architecture arm64:
"_rb_yjit_before_ractor_spawn", referenced from:
_ractor_create in ractor.o
"_rb_yjit_bop_redefined", referenced from:
_rb_vm_check_redefinition_opt_method in vm.o
"_rb_yjit_call_threshold", referenced from:
_rb_vm_exec in vm.o
_vm_sendish in vm.o
"_rb_yjit_cme_invalidate", referenced from:
_clear_method_cache_by_id_in_class in vm.o
"_rb_yjit_code_gc", referenced from:
_mjit_compile_invokebuiltin_for_rb_yjit_code_gc in yjit.o
_Init_builtin_yjit.yjit_table in yjit.o
"_rb_yjit_constant_ic_update", referenced from:
_vm_exec_core in vm.o
"_rb_yjit_constant_state_changed", referenced from:
_rb_clear_constant_cache_for_id in vm.o
"_rb_yjit_disasm_iseq", referenced from:
_mjit_compile_invokebuiltin_for_rb_yjit_disasm_iseq in yjit.o
_Init_builtin_yjit.yjit_table in yjit.o
"_rb_yjit_enabled_p", referenced from:
_rb_jit_cont_finish in cont.o
_rb_jit_cont_init in cont.o
_fiber_initialize in cont.o
_rb_threadptr_root_fiber_setup in cont.o
_cont_free in cont.o
_cont_capture in cont.o
_clear_method_cache_by_id_in_class in vm.o
...
"_rb_yjit_get_exit_locations", referenced from:
_mjit_compile_invokebuiltin_for_rb_yjit_get_exit_locations in yjit.o
_Init_builtin_yjit.yjit_table in yjit.o
"_rb_yjit_get_stats", referenced from:
_mjit_compile_invokebuiltin_for_rb_yjit_get_stats in yjit.o
_Init_builtin_yjit.yjit_table in yjit.o
"_rb_yjit_init_rust", referenced from:
_rb_yjit_init in yjit.o
"_rb_yjit_insns_compiled", referenced from:
_mjit_compile_invokebuiltin_for_rb_yjit_insns_compiled in yjit.o
_Init_builtin_yjit.yjit_table in yjit.o
"_rb_yjit_iseq_free", referenced from:
_rb_iseq_free in iseq.o
"_rb_yjit_iseq_gen_entry_point", referenced from:
_rb_yjit_compile_iseq in yjit.o
"_rb_yjit_iseq_mark", referenced from:
_rb_iseq_mark in iseq.o
"_rb_yjit_iseq_update_references", referenced from:
_rb_iseq_update_references in iseq.o
"_rb_yjit_parse_option", referenced from:
_proc_options in ruby.o
"_rb_yjit_reset_stats_bang", referenced from:
_mjit_compile_invokebuiltin_for_rb_yjit_reset_stats_bang in yjit.o
_Init_builtin_yjit.yjit_table in yjit.o
"_rb_yjit_root_mark", referenced from:
_yjit_root_type in yjit.o
"_rb_yjit_simulate_oom_bang", referenced from:
_mjit_compile_invokebuiltin_for_rb_yjit_simulate_oom_bang in yjit.o
_Init_builtin_yjit.yjit_table in yjit.o
"_rb_yjit_stats_enabled_p", referenced from:
_mjit_compile_invokebuiltin_for_rb_yjit_stats_enabled_p in yjit.o
_Init_builtin_yjit.yjit_table in yjit.o
"_rb_yjit_trace_exit_locations_enabled_p", referenced from:
_mjit_compile_invokebuiltin_for_rb_yjit_trace_exit_locations_enabled_p in yjit.o
_Init_builtin_yjit.yjit_table in yjit.o
"_rb_yjit_tracing_invalidate_all", referenced from:
_tracepoint_enable_m in vm_trace.o
_update_global_event_hook in vm_trace.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [miniruby] Error 1
make: *** Waiting for unfinished jobs....
generating enc/trans/emoji_iso2022_kddi.c ...
generating table from enc/trans/gb18030.c
generating table from enc/trans/gbk.c
generating table from enc/trans/iso2022.c
generating enc/trans/emoji_sjis_kddi.c ...
generating table from enc/trans/japanese.c
generating table from enc/trans/japanese_euc.c
generating enc/trans/emoji_sjis_softbank.c ...
generating enc/trans/big5.c ...
generating table from enc/trans/japanese_sjis.c
generating table from enc/trans/korean.c
generating enc/trans/escape.c ...
generating table from enc/trans/single_byte.c
generating enc/trans/iso2022.c ...
generating enc/trans/japanese.c ...
generating table from enc/trans/utf8_mac.c
generating enc/trans/gbk.c ...
generating table from enc/trans/utf_16_32.c
generating enc/trans/gb18030.c ...
generating enc/trans/japanese_sjis.c ...
generating enc/trans/japanese_euc.c ...
generating enc/trans/utf_16_32.c ...
generating enc/trans/korean.c ...
generating enc/trans/single_byte.c ...
generating enc/trans/utf8_mac.c ... |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
Configuration summary from the log:
|
Beta Was this translation helpful? Give feedback.
-
FYI: Thanks to maximecb, building from source was successful! https://bugs.ruby-lang.org/issues/19146 |
Beta Was this translation helpful? Give feedback.
-
FYI: After that, I found that building 3.2.0-dev with rbenv+ruby-build still fails, while source build is now certainly successful: # successful via source build:
$ ./autogen.sh;mkdir build && cd build;mkdir ~/.rubies;../configure --prefix="${HOME}/.rubies/ruby-master" --disable-install-doc --disable-install-rdoc;make install
.
.
.
$ RUBYOPT='--yjit' ~/.rubies/ruby-master/bin/ruby -v
ruby 3.2.0dev (2022-11-26T06:45:33Z master 26794b95cf) +YJIT [arm64-darwin22.1.0] I also confirmed that rbenv+ruby-build and # successful unless specifying --enable-yjit
$ export RUBY_CONFIGURE_OPTS="--disable-install-doc --disable-install-rdoc"
$ rbenv install 3.2.0-dev --verbose
.
.
.
# RUBYOPT='--yjit' ruby -v
ruby: warning: Ruby was built without YJIT support
ruby 3.2.0dev (2022-11-26T06:45:33Z master 26794b95cf) [arm64-darwin22] But if specifying # fails if specifying --enable-yjit
$ export RUBY_CONFIGURE_OPTS="--enable-yjit --disable-install-doc --disable-install-rdoc"
$ rbenv install 3.2.0-dev --verbose
.
.
.
ld: warning: ignoring file yjit/target/release/libyjit.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
generating enc/trans/chinese.c ...
Undefined symbols for architecture arm64:
"_rb_yjit_before_ractor_spawn", referenced from:
_ractor_create in ractor.o
.
.
. (Note that Rosetta 2 has been installed in my environment and the following rustup toolchain setup is needed, as maximecb suggested above) $ rustup toolchain list
stable-aarch64-apple-darwin (override)
stable-x86_64-apple-darwin (default) Attached the comparison the configuration summaries between source build and rbenv+ruby-build:
I noticed:
I recognize that 3.2.0-dev is just for a preview, and I'm not sure this might be fixed in the final release or some other adjustments are needed. |
Beta Was this translation helpful? Give feedback.
-
FYI: I finally found the cause of the failure: I incorrectly performed the following two types of installations:
That was my failure. By running $ rbenv install 3.2.0-dev
$ ruby -v --yjit
ruby 3.2.0dev (2022-11-30T08:20:38Z master c8bfbbc25e) +YJIT [arm64-darwin22] Sorry for disturbing you🙏 |
Beta Was this translation helpful? Give feedback.
FYI: I finally found the cause of the failure: I incorrectly performed the following two types of installations:
brew install rustup-init; rustup-init
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
(via https://www.rust-lang.org/ja/tools/install)That was my failure.
By running
rustup self uninstall
to uninstall the second one, I got successful with building 3.2.0-dev with rbenv+ruby-build.Sorry for disturbing you🙏