diff mbox

[PULL,1/5] linux-user: Use correct alignment for long long on i386 guests

Message ID d9fe91d8689b078acfd27bc7c4a4e1efd5bbcf65.1470319929.git.riku.voipio@linaro.org
State Accepted
Commit d9fe91d8689b078acfd27bc7c4a4e1efd5bbcf65
Headers show

Commit Message

Riku Voipio Aug. 4, 2016, 2:15 p.m. UTC
From: Peter Maydell <peter.maydell@linaro.org>


For i386, the ABI specifies that 'long long' (8 byte values)
need only be 4 aligned, but we were requiring them to be
8-aligned. This meant we were laying out the target_epoll_event
structure wrongly. Add a suitable ifdef to abitypes.h to
specify the i386-specific alignment requirement.

Reported-by: Icenowy Zheng <icenowy@aosc.xyz>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>

---
 include/exec/user/abitypes.h | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.1.4
diff mbox

Patch

diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes.h
index a09d6c6..ba18860 100644
--- a/include/exec/user/abitypes.h
+++ b/include/exec/user/abitypes.h
@@ -15,6 +15,10 @@ 
 #define ABI_LLONG_ALIGNMENT 2
 #endif
 
+#if defined(TARGET_I386) && !defined(TARGET_X86_64)
+#define ABI_LLONG_ALIGNMENT 4
+#endif
+
 #ifndef ABI_SHORT_ALIGNMENT
 #define ABI_SHORT_ALIGNMENT 2
 #endif