about summary refs log tree commit diff
path: root/ports/sysdeps/unix
diff options
context:
space:
mode:
authorChung-Lin Tang <cltang@codesourcery.com>2013-11-20 16:12:18 -0500
committerChris Metcalf <cmetcalf@tilera.com>2013-11-20 16:12:18 -0500
commit7cf8ac4c3179540c63865f7133617684169928c9 (patch)
tree58164760e4e1d6ecbbbaabcb2e90e581a226f28e /ports/sysdeps/unix
parent4b98b2dcdd89cbef1d2681a8cf0f16a7b3b649af (diff)
downloadglibc-7cf8ac4c3179540c63865f7133617684169928c9.tar.gz
glibc-7cf8ac4c3179540c63865f7133617684169928c9.tar.xz
glibc-7cf8ac4c3179540c63865f7133617684169928c9.zip
linux-generic: fix alignment of struct stat/statfs for nios2
The hard alignment of 8 was appropriate for most platforms for
which 8-byte values are 8-byte aligned, but this is not true
for the nios2 platform, so only align to the alignment of the
8-byte type on the platform.

Remove the explicit alignment of struct statfs as it's redundant.
Diffstat (limited to 'ports/sysdeps/unix')
-rw-r--r--ports/sysdeps/unix/sysv/linux/generic/bits/stat.h4
-rw-r--r--ports/sysdeps/unix/sysv/linux/generic/bits/statfs.h8
2 files changed, 6 insertions, 6 deletions
diff --git a/ports/sysdeps/unix/sysv/linux/generic/bits/stat.h b/ports/sysdeps/unix/sysv/linux/generic/bits/stat.h
index 6e74cec283..feb5f2b1cf 100644
--- a/ports/sysdeps/unix/sysv/linux/generic/bits/stat.h
+++ b/ports/sysdeps/unix/sysv/linux/generic/bits/stat.h
@@ -46,10 +46,10 @@
 # define __field64(type, type64, name) type name
 #elif __BYTE_ORDER == __LITTLE_ENDIAN
 # define __field64(type, type64, name) \
-  type name __attribute__((__aligned__(8))); int __##name##_pad
+  type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
 #else
 # define __field64(type, type64, name) \
-  int __##name##_pad __attribute__((__aligned__(8))); type name
+  int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
 #endif
 
 struct stat
diff --git a/ports/sysdeps/unix/sysv/linux/generic/bits/statfs.h b/ports/sysdeps/unix/sysv/linux/generic/bits/statfs.h
index 7063c7a242..8aecb042b0 100644
--- a/ports/sysdeps/unix/sysv/linux/generic/bits/statfs.h
+++ b/ports/sysdeps/unix/sysv/linux/generic/bits/statfs.h
@@ -38,10 +38,10 @@
 # define __field64(type, type64, name) type name
 #elif __BYTE_ORDER == __LITTLE_ENDIAN
 # define __field64(type, type64, name) \
-  type name __attribute__((__aligned__(8))); int __##name##_pad
+  type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
 #else
 # define __field64(type, type64, name) \
-  int __##name##_pad __attribute__((__aligned__(8))); type name
+  int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
 #endif
 
 struct statfs
@@ -58,7 +58,7 @@ struct statfs
     __SWORD_TYPE f_frsize;
     __SWORD_TYPE f_flags;
     __SWORD_TYPE f_spare[4];
-  } __attribute__((__aligned__(8)));
+  };
 
 #undef __field64
 
@@ -77,7 +77,7 @@ struct statfs64
     __SWORD_TYPE f_frsize;
     __SWORD_TYPE f_flags;
     __SWORD_TYPE f_spare[4];
-  } __attribute__((__aligned__(8)));
+  };
 #endif
 
 /* Tell code we have these members.  */