Remove rb_libruby_selfpath for MJIT

This commit is contained in:
Nobuyoshi Nakada 2023-12-04 10:32:21 +09:00
parent 3e07e04d4a
commit 2e8a4470ae
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465

23
ruby.c
View File

@ -22,7 +22,7 @@
# include <sys/cygwin.h> # include <sys/cygwin.h>
#endif #endif
#if (defined(LOAD_RELATIVE) || defined(__MACH__)) && defined(HAVE_DLADDR) #if defined(LOAD_RELATIVE) && defined(HAVE_DLADDR)
# include <dlfcn.h> # include <dlfcn.h>
#endif #endif
@ -598,7 +598,7 @@ str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to)
void ruby_init_loadpath(void); void ruby_init_loadpath(void);
#if defined(LOAD_RELATIVE) || defined(__MACH__) #if defined(LOAD_RELATIVE)
static VALUE static VALUE
runtime_libruby_path(void) runtime_libruby_path(void)
{ {
@ -675,10 +675,6 @@ runtime_libruby_path(void)
#define INITIAL_LOAD_PATH_MARK rb_intern_const("@gem_prelude_index") #define INITIAL_LOAD_PATH_MARK rb_intern_const("@gem_prelude_index")
VALUE ruby_archlibdir_path, ruby_prefix_path; VALUE ruby_archlibdir_path, ruby_prefix_path;
#if defined(__MACH__)
// A path to libruby.dylib itself or where it's statically linked to.
VALUE rb_libruby_selfpath;
#endif
void void
ruby_init_loadpath(void) ruby_init_loadpath(void)
@ -686,19 +682,6 @@ ruby_init_loadpath(void)
VALUE load_path, archlibdir = 0; VALUE load_path, archlibdir = 0;
ID id_initial_load_path_mark; ID id_initial_load_path_mark;
const char *paths = ruby_initial_load_paths; const char *paths = ruby_initial_load_paths;
#if defined(LOAD_RELATIVE) || defined(__MACH__)
VALUE libruby_path = runtime_libruby_path();
# if defined(__MACH__)
VALUE selfpath = libruby_path;
# if defined(LOAD_RELATIVE)
selfpath = rb_str_dup(selfpath);
# endif
rb_obj_hide(selfpath);
OBJ_FREEZE_RAW(selfpath);
rb_gc_register_address(&rb_libruby_selfpath);
rb_libruby_selfpath = selfpath;
# endif
#endif
#if defined LOAD_RELATIVE #if defined LOAD_RELATIVE
#if !defined ENABLE_MULTIARCH #if !defined ENABLE_MULTIARCH
@ -713,7 +696,7 @@ ruby_init_loadpath(void)
size_t baselen; size_t baselen;
const char *p; const char *p;
sopath = libruby_path; sopath = runtime_libruby_path();
libpath = RSTRING_PTR(sopath); libpath = RSTRING_PTR(sopath);
p = strrchr(libpath, '/'); p = strrchr(libpath, '/');