summaryrefslogtreecommitdiff
path: root/mjit.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-02 13:41:27 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-02 13:41:27 +0000
commit2aea3deddd129a9693644e17ed3069535971efb5 (patch)
tree4b549cfb07cdbdb0ad06455b022a3b492efc9b93 /mjit.c
parent57369c1c70e4f48fefc1d11a14f30f22c4e0e877 (diff)
mjit.c: don't apply workaround if --enable-load-relative
is specified. This is needed for MinGW because MJIT_BUILD_DIR doesn't prefix path like "C:\msys64", so it can't be read without msys2's conversion. The workaround is not needed for Windows (LOAD_RELATIVE looks defined by default) anyway. So removed it for such environment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mjit.c b/mjit.c
index efe281fb22..e292c27017 100644
--- a/mjit.c
+++ b/mjit.c
@@ -1478,6 +1478,11 @@ init_header_filename(void)
const size_t libpathflag_len = sizeof(libpathflag) - 1;
#endif
+ basedir_val = ruby_prefix_path;
+ basedir = StringValuePtr(basedir_val);
+ baselen = RSTRING_LEN(basedir_val);
+
+#ifndef LOAD_RELATIVE
if (getenv("MJIT_SEARCH_BUILD_DIR")) {
/* This path is not intended to be used on production, but using build directory's
header file here because people want to run `make test-all` without running
@@ -1485,11 +1490,7 @@ init_header_filename(void)
basedir = MJIT_BUILD_DIR;
baselen = strlen(basedir);
}
- else {
- basedir_val = ruby_prefix_path;
- basedir = StringValuePtr(basedir_val);
- baselen = RSTRING_LEN(basedir_val);
- }
+#endif
header_file = xmalloc(baselen + header_name_len + 1);
p = append_str2(header_file, basedir, baselen);