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