summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-03-12 15:45:03 -0700
committerJeremy Evans <code@jeremyevans.net>2020-03-12 15:45:03 -0700
commit00dc8c024616d0cb495de5ef71e38b34e18cf79b (patch)
treebdfd1ea62485b45872b82b0984514617849c6388
parent768bd6e533c7a01eaa41dca808ce56dae4af8f2a (diff)
Correctly detect whether strict alignment is needed on OpenBSD
From Stefan Sperling <stsp@apache.org>
-rw-r--r--compile.c10
1 files changed, 10 insertions, 0 deletions
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 <sys/endian.h>
+ #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