This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: glibc 2.21 - Machine maintainers, please test your machines.
- From: Chris Metcalf <cmetcalf at ezchip dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, Torvald Riegel <triegel at redhat dot com>, Carlos O'Donell <carlos at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>, David Miller <davem at davemloft dot net>, Richard Henderson <rth at redhat dot com>, Mike Frysinger <vapier at gentoo dot org>, Andreas Schwab <schwab at suse dot de>, "Joseph S. Myers" <joseph at codesourcery dot com>, Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>, Thomas Schwinge <thomas at codesourcery dot com>, Marcus Shawcroft <marcus dot shawcroft at linaro dot org>, Chung-Lin Tang <chunglin_tang at mentor dot com>, Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>, Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Date: Sun, 25 Jan 2015 17:10:45 -0500
- Subject: Re: glibc 2.21 - Machine maintainers, please test your machines.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: linux.vnet.ibm.com; dkim=none (message not signed) header.d=none;linux.vnet.ibm.com; dmarc=none action=none header.from=ezchip.com;
- References: <54C2BDD7 dot 7000304 at redhat dot com> <54C3B6D5 dot 3090308 at ezchip dot com> <1422119595 dot 29655 dot 42 dot camel at triegel dot csb> <54C5094A dot 8060300 at ezchip dot com> <54C51D94 dot 6030007 at ezchip dot com> <CAMe9rOpOuuC_Bf1eHs9iaiUY6V-fVMHUCKZPAwje_NemBy84wA at mail dot gmail dot com> <20150125215150 dot GA15033 at gmail dot com>
On 1/25/2015 4:51 PM, H.J. Lu wrote:
This is for x86. Each target can do something like it if needed.
This does change the ABI for existing code, however, which may legitimately
have sem_t objects that are only aligned to 4-byte boundaries. Your change
is a good idea for new platforms. I suppose we could also do something
with symbol versioning to use it for existing 32-bit platforms with
64-bit atomics, too. So there seem to be multiple fixes we can consider.
H.J.
---
diff --git a/sysdeps/x86/bits/semaphore.h b/sysdeps/x86/bits/semaphore.h
index 18b2b3c..4890e0d 100644
--- a/sysdeps/x86/bits/semaphore.h
+++ b/sysdeps/x86/bits/semaphore.h
@@ -28,6 +28,11 @@
# define __SIZEOF_SEM_T 16
#endif
+#ifdef __x86_64__
+# define __SEM_ALIGN_T long long int
+#else
+# define __SEM_ALIGN_T long int
+#endif
/* Value returned if `sem_open' failed. */
#define SEM_FAILED ((sem_t *) 0)
@@ -36,5 +41,5 @@
typedef union
{
char __size[__SIZEOF_SEM_T];
- long int __align;
+ __SEM_ALIGN_T __align;
} sem_t;
--
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com