Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildenv
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export ZOPEN_EXTRA_LIBS="-lffi" ## C,C++ libraries to append to LIBS (defaults t
#export ZOPEN_CLEAN_OPTS="" ## Options to pass to clean up program (defaults to 'clean')
#export ZOPEN_CONFIGURE_MINIMAL="" ## Configuration program will not be passed CFLAGS, LDFLAGS, CPPFLAGS options but will get them from env vars.
#export ZOPEN_CONFIGURE_OPTS="" ## Options to pass to configuration program (defaults to '--prefix=')
export ZOPEN_EXTRA_CONFIGURE_OPTS="--disable-shared --disable-dln --disable-yjit --disable-rjit --without-valgrind --with-static-linked-ext" ## Extra configure options to pass to configuration program. (defaults to '')
export ZOPEN_EXTRA_CONFIGURE_OPTS="--disable-shared --disable-dln --disable-yjit --disable-rjit --without-valgrind --with-static-linked-ext=yes --enable-load-relative" ## Extra configure options to pass to configuration program. (defaults to '')
#export ZOPEN_INSTALL_OPTS="" ## Options to pass to installation program (defaults to 'install')
export ZOPEN_MAKE_MINIMAL="yes" ## Build program will not be passed CFLAGS, LDFLAGS, CPPFLAGS options but will get them from env vars.
#export ZOPEN_MAKE_OPTS="" ## Options to pass to build program (defaults to '-j')
Expand Down
15 changes: 14 additions & 1 deletion patches/configure.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/configure b/configure
index 7a391a2..02c7c41 100755
index 7a391a2..cb427d0 100755
--- a/configure
+++ b/configure
@@ -26423,6 +26423,7 @@ if test "x$ac_cv_func_fork_works" = xcross; then
Expand Down Expand Up @@ -35,3 +35,16 @@ index 7a391a2..02c7c41 100755
dir=-1 ;; #(
hppa*) :
dir=+1 ;; #(
@@ -31665,6 +31668,12 @@ fi

SOEXT=dylib
DLEXT=bundle ;; #(
+ openedition*) :
+ if test "$load_relative" = yes; then
+ LOAD_RELATIVE=1
+ fi
+ SOEXT=so
+ DLEXT=so ;; #(
cygwin*|msys*|mingw*|*djgpp*) :

LOAD_RELATIVE=1
45 changes: 45 additions & 0 deletions patches/ruby.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff --git a/ruby.c b/ruby.c
index d2c168c..d097151 100644
--- a/ruby.c
+++ b/ruby.c
@@ -26,6 +26,10 @@
# include <dlfcn.h>
#endif

+#if defined(LOAD_RELATIVE) && defined(__MVS__)
+#include <sys/ps.h>
+#endif
+
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
@@ -656,6 +660,29 @@ runtime_libruby_path(void)
}
rb_str_resize(fname, 0);
return path;
+#elif defined(__MVS__)
+ int token = 0;
+ W_PSPROC buf;
+ char exe_path[PS_PATHBLEN];
+ pid_t pid = getpid();
+
+ memset(&buf, 0, sizeof(buf));
+ buf.ps_pathptr = exe_path;
+ buf.ps_pathlen = sizeof(exe_path);
+
+ while (1) {
+ if ((token = w_getpsent(token, &buf, sizeof(buf))) <= 0)
+ break;
+ if (buf.ps_pid != pid)
+ continue;
+ char real_path[PATH_MAX];
+ if (realpath(exe_path, real_path))
+ {
+ return rb_str_new_cstr(real_path);
+ }
+ break; // Found entry, but realpath failed.
+ }
+ rb_fatal("failed to get executable path on z/OS");
#else
# error relative load path is not supported on this platform.
#endif
11 changes: 10 additions & 1 deletion patches/thread_pthread.c.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/thread_pthread.c b/thread_pthread.c
index 423814c..42992d5 100644
index 423814c..e38c4bf 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -2022,7 +2022,7 @@ native_thread_init_stack(rb_thread_t *th, void *local_in_parent_frame)
Expand All @@ -11,3 +11,12 @@ index 423814c..42992d5 100644
/* This thread is the first thread, must be the main thread -
* configure the native_main_thread object */
native_thread_init_main_thread_stack(local_in_parent_frame);
@@ -2045,7 +2045,7 @@ native_thread_init_stack(rb_thread_t *th, void *local_in_parent_frame)
}
}
#else
- rb_raise(rb_eNotImpError, "ruby engine can initialize only in the main thread");
+ //rb_raise(rb_eNotImpError, "ruby engine can initialize only in the main thread");
#endif
}

Loading