about summary refs log tree commit diff
path: root/src/rt/rust_shape.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_shape.h')
-rw-r--r--src/rt/rust_shape.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/rt/rust_shape.h b/src/rt/rust_shape.h
index a181a881457..64b1cd2deb8 100644
--- a/src/rt/rust_shape.h
+++ b/src/rt/rust_shape.h
@@ -123,6 +123,18 @@ rust_alignof<double>() {
     return 4;
 }
 
+// Issue #2303
+// On 32-bit x86 the alignment of 64-bit ints in structures is 4 bytes
+// Which is different from the preferred 8-byte alignment reported
+// by __alignof__ (at least on gcc).
+#ifdef __i386__
+template<>
+inline size_t
+rust_alignof<uint64_t>() {
+    return 4;
+}
+#endif
+
 
 // Utility classes