rbenv / ruby-build

A tool to download, compile, and install Ruby on Unix-like systems.
https://rbenv.org/man/ruby-build.1
MIT License
3.89k stars 785 forks source link

Enable YJIT Seems to not support arm64 #2423

Closed Howler4695 closed 4 months ago

Howler4695 commented 4 months ago

Steps to reproduce the behavior

First reinstall rust

Then, try to enable YJIT with the following command: ruby-build 3.3.3 /opt/rubies/ruby-3.3.3 -- --enable-yjit got from here

Expected vs. actual behavior

Expected it to enable YJIT

Currently crashes

Logs

Log Output:

touch yjit/target/release/libyjit.a
partial linking yjit/target/release/libyjit.a into yjit/target/release/libyjit.o
ld: warning: ignoring file yjit/target/release/libyjit.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
  "_rb_yjit_before_ractor_spawn", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_bop_redefined", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_call_threshold", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_cme_invalidate", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_code_gc", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_cold_threshold", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_collect_binding_alloc", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_collect_binding_set", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_constant_ic_update", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_constant_state_changed", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_count_side_exit_op", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_disasm_iseq", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_enable", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_enabled_p", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_get_exit_locations", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_get_stats", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_incr_counter", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_init", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_insns_compiled", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_iseq_free", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_iseq_gen_entry_point", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_iseq_mark", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_iseq_update_references", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_live_iseq_count", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_option_disable", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_parse_option", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_print_stats_p", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_record_exit_stack", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_reset_stats_bang", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_root_mark", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_show_usage", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_simulate_oom_bang", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_stats_enabled_p", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_trace_exit_locations_enabled_p", referenced from:
     -exported_symbol[s_list] command line option
  "_rb_yjit_tracing_invalidate_all", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_eh_personality", referenced from:
     -exported_symbol[s_list] command line option
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [yjit/target/release/libyjit.o] Error 1
external command failed with status 2
Howler4695 commented 4 months ago

I ran ruby-build 3.3.3 /opt/rubies/ruby-3.3.3 and got the following error:

*** Following extensions are not compiled:
openssl:
        Could not be configured. It will not be installed.
        /Users/bespin-starter/src/ruby-3.3.3/ext/openssl/extconf.rb:122: OpenSSL library could not be found. You might want to use --with-openssl-dir=<dir> option to specify the prefix where OpenSSL is installed.
        Check ext/openssl/mkmf.log for more details.
psych:
        Could not be configured. It will not be installed.
        Check ext/psych/mkmf.log for more details.
*** Fix the problems, then remove these directories and try again if you want.

I already have openssl and libyaml installed so there's clearly another error happening here, but probably nothing wrong with ruby-build other than obfuscating the original error.