--- gc.h.orig	2020-09-02 08:55:09 +0000
+++ gc.h	2020-09-02 08:55:39 +0000
@@ -6,7 +6,7 @@
 #define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movq\t%%rsp, %0" : "=r" (*(p)))
 #elif defined(__i386) && defined(__GNUC__)
 #define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movl\t%%esp, %0" : "=r" (*(p)))
-#elif defined(__powerpc64__) && defined(__GNUC__)
+#elif defined(__powerpc64__) && defined(__GNUC__) && !defined(_AIX)
 #define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mr\t%0, %%r1" : "=r" (*(p)))
 #else
 NOINLINE(void rb_gc_set_stack_end(VALUE **stack_end_p));
--- file.c.orig	2020-09-10 02:08:01 +0000
+++ file.c	2020-09-10 02:08:47 +0000
@@ -4363,7 +4363,7 @@
            such as /dev/fd/5.
            Fallback to the emulated approach in either of those cases. */
         if (errno == ENOTDIR ||
-            (errno == ENOENT && rb_file_exist_p(0, unresolved_path))) {
+            (errno == ENOENT && rb_file_exist_p(0, unresolved_path)) || errno == EINVAL) {
             return rb_check_realpath_emulate(basedir, path, origenc, mode);
 
         }
