Files
Fred Wright 8f164f90e9 ruby23-25: Fix build on 10.4, 10.5 (#8550)
* ruby23: Fix build on 10.4 i386.

The build was failing on 10.4 i386 due to attempts to access undefined
context fields in the signal handler context struct.  This isn't
supported on PPC, so the build succeeded.  The relevant fields weren't
defined until 10.5, so the fix is to add an OS version check to the
__APPLE__ case.

This happened in two places - one in check_stack_overflow(), and one
in rb_dump_machine_register().

Using __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ avoids the need to
include AvailabilityMacros.h.

The OS version conditional in dln.c is comparing an undefined macro to
a sometimes undefined (and essentially useless) macro.  However, the
relevant code doesn't seem to be built for any OS version, making the
bug irrelevant.  This is left alone.

Also corrects a small typo in the description.

Since this only fixes broken builds, there is no need for a revbump.

TESTED:
Built on 10.4-10.5 ppc, 10.4-10.6 i386, and 10.6-10.15 x86_64.

* ruby24: Fix builds on 10.4, 10.5.

The build was failing on 10.4 i386 due to attempts to access undefined
context fields in the signal handler context struct.  This isn't
supported on PPC, so the build succeeded.  The relevant fields weren't
defined until 10.5, so the fix is to add an OS version check to the
__APPLE__ case.

This happened in two places - one in check_stack_overflow(), and one
in rb_dump_machine_register().

Using __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ avoids the need to
include AvailabilityMacros.h.

The OS version conditional in dln.c is comparing an undefined macro to
a sometimes undefined (and essentially useless) macro.  However, the
relevant code doesn't seem to be built for any OS version, making the
bug irrelevant.  Nevertheless, it's now fixed, since another, similar
fix was needed, anyway, and it might become relevant if something else
changes.

The OS version conditionals in error.c were using another useless
macro for the comparison, this time with a real effect, though only in
a couple of messages related to crash reports on < 10.6.  This is now
fixed.

Also corrects a small typo in the description.

Since this affects the installed code for < 10.6, it includes a
revbump.

TESTED:
Built on 10.4-10.5 ppc,	10.4-10.6 i386,	and 10.6-10.15 x86_64.

* ruby25: Fix builds on 10.4, 10.5.

The build was failing on 10.4 i386 due to attempts to access undefined
context fields in the signal handler context struct.  This isn't
supported on PPC, so the build succeeded.  The relevant fields weren't
defined until 10.5, so the fix is to add an OS version check to the
__APPLE__ case.

This happened in two places - one in check_stack_overflow(), and one
in rb_dump_machine_register().

Using __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ avoids the need to
include AvailabilityMacros.h.

The OS version conditional in dln.c is comparing an undefined macro to
a sometimes undefined (and essentially useless) macro.  However, the
relevant code doesn't seem to be built for any OS version, making the
bug irrelevant.  Nevertheless, it's now fixed, since another, similar
fix was needed, anyway, and it might become relevant if something else
changes.

The OS version conditionals in error.c were using another useless
macro for the comparison, this time with a real effect, though only in
a couple of messages related to crash reports on < 10.6.  This is now
fixed.

Also corrects a small typo in the description.

Since this affects the installed code for < 10.6, it includes a
revbump.

TESTED:
Built on 10.4-10.5 ppc, 10.4-10.6 i386, and 10.6-10.15 x86_64.
2020-09-28 21:46:18 +09:00

23 lines
931 B
Diff

--- ./signal.c.orig 2020-03-31 05:15:56.000000000 -0700
+++ ./signal.c 2020-08-27 15:31:23.000000000 -0700
@@ -765,7 +765,7 @@ NORETURN(void rb_ec_stack_overflow(rb_ex
# elif !(defined(HAVE_UCONTEXT_H) && (defined __i386__ || defined __x86_64__ || defined __amd64__))
# elif defined __linux__
# define USE_UCONTEXT_REG 1
-# elif defined __APPLE__
+# elif defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
# define USE_UCONTEXT_REG 1
# elif defined __FreeBSD__
# define USE_UCONTEXT_REG 1
--- ./vm_dump.c.orig 2020-03-31 05:15:56.000000000 -0700
+++ ./vm_dump.c 2020-08-27 15:31:23.000000000 -0700
@@ -898,7 +898,7 @@ rb_dump_machine_register(const ucontext_
dump_machine_register(SS);
# endif
}
-# elif defined __APPLE__
+# elif defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
{
const mcontext_t mctx = ctx->uc_mcontext;
# if defined __x86_64__