From 00dc8c024616d0cb495de5ef71e38b34e18cf79b Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Thu, 12 Mar 2020 15:45:03 -0700 Subject: [PATCH] Correctly detect whether strict alignment is needed on OpenBSD From Stefan Sperling --- compile.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/compile.c b/compile.c index b5c84a80c8..9c8f4ddbc7 100644 --- a/compile.c +++ b/compile.c @@ -841,6 +841,16 @@ rb_iseq_original_iseq(const rb_iseq_t *iseq) /* cold path */ #define STRICT_ALIGNMENT #endif +/* + * Some OpenBSD platforms (including sparc64) require strict alignment. + */ +#if defined(__OpenBSD__) + #include + #ifdef __STRICT_ALIGNMENT + #define STRICT_ALIGNMENT + #endif +#endif + #ifdef STRICT_ALIGNMENT #if defined(HAVE_TRUE_LONG_LONG) && SIZEOF_LONG_LONG > SIZEOF_VALUE #define ALIGNMENT_SIZE SIZEOF_LONG_LONG