ruby-changes:53380
From: nobu <ko1@a...>
Date: Wed, 7 Nov 2018 16:21:04 +0900 (JST)
Subject: [ruby-changes:53380] nobu:r65596 (trunk): ruby-runner.c: enable MJIT_SEARCH_BUILD_DIR only if no relative loading
nobu 2018-11-07 16:21:00 +0900 (Wed, 07 Nov 2018) New Revision: 65596 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65596 Log: ruby-runner.c: enable MJIT_SEARCH_BUILD_DIR only if no relative loading Modified files: trunk/common.mk trunk/ruby-runner.c Index: common.mk =================================================================== --- common.mk (revision 65595) +++ common.mk (revision 65596) @@ -834,7 +834,7 @@ $(PLATFORM_D): https://github.com/ruby/ruby/blob/trunk/common.mk#L834 $(Q) $(MAKEDIRS) $(PLATFORM_DIR) $(@D) @exit > $@ -exe/$(PROGRAM): ruby-runner.c ruby-runner.h exe/.time miniruby$(EXEEXT) +exe/$(PROGRAM): ruby-runner.c ruby-runner.h exe/.time miniruby$(EXEEXT) {$(VPATH)}config.h $(Q) $(CC) $(CFLAGS) $(CPPFLAGS) -DRUBY_INSTALL_NAME=$(@F) $(COUTFLAG)ruby-runner.$(OBJEXT) -c $(CSRCFLAG)$(srcdir)/ruby-runner.c $(Q) $(PURIFY) $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(OUTFLAG)$@ ruby-runner.$(OBJEXT) $(LIBS) $(Q) $(POSTLINK) Index: ruby-runner.c =================================================================== --- ruby-runner.c (revision 65595) +++ ruby-runner.c (revision 65596) @@ -7,6 +7,7 @@ https://github.com/ruby/ruby/blob/trunk/ruby-runner.c#L7 #include <sys/stat.h> #include "ruby-runner.h" +#include "ruby/config.h" #define STRINGIZE(expr) STRINGIZE0(expr) #define STRINGIZE0(expr) #expr @@ -59,19 +60,23 @@ main(int argc, char **argv) https://github.com/ruby/ruby/blob/trunk/ruby-runner.c#L60 PATH_SEPARATOR EXTOUT_DIR"/"ARCH ; +#ifndef LOAD_RELATIVE static const char mjit_build_dir[] = BUILDDIR"/mjit_build_dir."SOEXT; + struct stat stbuf; +#endif const size_t dirsize = sizeof(builddir); const size_t namesize = sizeof(rubypath) - dirsize; const char *rubyname = rubypath + dirsize; char *arg0 = argv[0], *p; - struct stat stbuf; insert_env_path(LIBPATHENV, builddir, dirsize, 1); insert_env_path("RUBYLIB", rubylib, sizeof(rubylib), 0); +#ifndef LOAD_RELATIVE if (PRELOADENV[0] && stat(mjit_build_dir, &stbuf) == 0) { insert_env_path(PRELOADENV, mjit_build_dir, sizeof(mjit_build_dir), 1); setenv("MJIT_SEARCH_BUILD_DIR", "true", 0); } +#endif if (!(p = strrchr(arg0, '/'))) p = arg0; else p++; if (strlen(p) < namesize - 1) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/