From 1fd0a7a6608ed0a0514d59e40f3a149f289ea537 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Mon, 5 Feb 2018 16:51:12 +0000 Subject: mjit.c: determine prefix of MJIT header at runtime so that MJIT can work if Ruby is distributed as prebuilt binary. Now mjit_init() depends on the internal const TMP_RUBY_PREFIX which is only available after ruby_init_loadpath_safe() (L1608) and before ruby_init_prelude() (L1681). So the place of mjit_init() is moved. Makefile.in: Removed static prefix from MJIT_HEADER_ISNTALL_DIR macro. And this removes the unused LIBRUBY_LIBDIR macro as well. win32/Makefile.sub: ditto. Patch by: Lars Kanis [Bug #14445] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index 925e4cd956..b185b98a18 100644 --- a/ruby.c +++ b/ruby.c @@ -1551,9 +1551,6 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt) opt->intern.enc.name = int_enc_name; } - if (opt->mjit.on) - mjit_init(&opt->mjit); - if (opt->src.enc.name) rb_warning("-K is specified; it is for 1.8 compatibility and may cause odd behavior"); @@ -1609,6 +1606,11 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt) ruby_gc_set_params(opt->safe_level); ruby_init_loadpath_safe(opt->safe_level); + + if (opt->mjit.on) + /* Using TMP_RUBY_PREFIX created by ruby_init_loadpath_safe(). */ + mjit_init(&opt->mjit); + Init_enc(); lenc = rb_locale_encoding(); rb_enc_associate(rb_progname, lenc); -- cgit v1.2.3