aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-05 16:51:12 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-05 16:51:12 +0000
commit1fd0a7a6608ed0a0514d59e40f3a149f289ea537 (patch)
treeb76763feaf092ba71c265e2a39abe4f73bb5f467 /ruby.c
parent68baf9551e5d7bb43d1a7cce8e80ecb5f06e8724 (diff)
downloadruby-1fd0a7a6608ed0a0514d59e40f3a149f289ea537.tar.gz
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 <lars@greiz-reinsdorf.de> [Bug #14445] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c8
1 files changed, 5 insertions, 3 deletions
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);