Files
macports-ports/lang/ruby24/files/patch-osversions.diff
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

33 lines
1.3 KiB
Diff

--- ./dln.c.orig 2020-03-31 04:42:18.000000000 -0700
+++ ./dln.c 2020-08-29 16:46:40.000000000 -0700
@@ -1334,8 +1334,7 @@ dln_load(const char *file)
if (ex && ex != ruby_xmalloc) {
# if defined __APPLE__ && \
- defined(MAC_OS_X_VERSION_MIN_REQUIRED) && \
- (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11)
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101100
/* dlclose() segfaults */
rb_fatal("%s - %s", incompatible, file);
# else
--- ./error.c.orig 2020-03-31 04:42:18.000000000 -0700
+++ ./error.c 2020-08-29 16:48:42.000000000 -0700
@@ -379,7 +379,7 @@ preface_dump(FILE *out)
"-- Crash Report log information "
"--------------------------------------------\n"
" See Crash Report log file under the one of following:\n"
-# if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
+# if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
" * ~/Library/Logs/CrashReporter\n"
" * /Library/Logs/CrashReporter\n"
# endif
@@ -404,7 +404,7 @@ postscript_dump(FILE *out)
"[IMPORTANT]"
/*" ------------------------------------------------"*/
"\n""Don't forget to include the Crash Report log file under\n"
-# if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
+# if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
"CrashReporter or "
# endif
"DiagnosticReports directory in bug reports.\n"