ruby-changes:51946
From: k0kubun <ko1@a...>
Date: Thu, 2 Aug 2018 22:41:31 +0900 (JST)
Subject: [ruby-changes:51946] k0kubun:r64161 (trunk): mjit.c: don't apply workaround if --enable-load-relative
k0kubun 2018-08-02 22:41:27 +0900 (Thu, 02 Aug 2018) New Revision: 64161 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64161 Log: 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. Modified files: trunk/mjit.c Index: mjit.c =================================================================== --- mjit.c (revision 64160) +++ mjit.c (revision 64161) @@ -1478,6 +1478,11 @@ init_header_filename(void) https://github.com/ruby/ruby/blob/trunk/mjit.c#L1478 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) https://github.com/ruby/ruby/blob/trunk/mjit.c#L1490 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/