summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonghyun Park <parjong@gmail.com>2017-03-21 13:36:27 +0900
committerJan Kotas <jkotas@microsoft.com>2017-03-20 21:36:27 -0700
commitbe9896c8c27f1ef6ac6df46031bb69d56195712e (patch)
treede0bca76ddecee582fcf83c4d064096ffc059dc3
parentbeeaf0926c7eccf0a5f86b95ad5b3ed186438dc1 (diff)
downloadcoreclr-be9896c8c27f1ef6ac6df46031bb69d56195712e.tar.gz
coreclr-be9896c8c27f1ef6ac6df46031bb69d56195712e.tar.bz2
coreclr-be9896c8c27f1ef6ac6df46031bb69d56195712e.zip
[x86/Linux] Use 4-byte align for double in struct (#10340)
-rw-r--r--src/vm/fieldmarshaler.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vm/fieldmarshaler.h b/src/vm/fieldmarshaler.h
index 9ec7e87610..287da41a5b 100644
--- a/src/vm/fieldmarshaler.h
+++ b/src/vm/fieldmarshaler.h
@@ -85,7 +85,12 @@ enum NStructFieldType
//=======================================================================
// Magic number for default struct packing size.
//=======================================================================
+#if defined(_TARGET_X86_) && defined(UNIX_X86_ABI)
+// A double is 4-byte aligned on GCC (without -malign-dobule)
+#define DEFAULT_PACKING_SIZE 4
+#else // _TARGET_X86_ && UNIX_X86_ABI
#define DEFAULT_PACKING_SIZE 8
+#endif // !_TARGET_X86_ || !UNIX_X86_ABI
//=======================================================================