about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStefan Liebler <stli@linux.vnet.ibm.com>2015-08-26 10:26:26 +0200
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2015-08-26 10:26:26 +0200
commitb022830bebc23456fc40825c6b5507bc0f52381f (patch)
treeeb9bddf2fa0cec578a166653f3d67a7fd09a1759
parent808d70228891ab4d4795ab3dd1e015bf63ba18d6 (diff)
downloadglibc-b022830bebc23456fc40825c6b5507bc0f52381f.tar.gz
glibc-b022830bebc23456fc40825c6b5507bc0f52381f.tar.xz
glibc-b022830bebc23456fc40825c6b5507bc0f52381f.zip
Adjust _Unwind_Word in unwind.h to version in libgcc.
Building glibc on s390-32 with gcc option -mzarch produces the error due to
sysdeps/s390/jmpbuf-unwind.h:37:10: (void *) (_Unwind_GetCFA  (_context):
cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

Building on s390-32 in esa-mode or s390-64 is fine.

_Unwind_GetCFA returns an _Unwind_Word which is an unsigned
with a size of 4 bytes on s390-32 (esa-mode) and 8 bytes on s390-64.
On s390-32 (zarch-mode), _Unwind_Word has a size of 8 bytes, too.

_Unwind_Word is defined in sysdeps/generic/unwind.h as
typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));

In libgcc unwind header (<gcc-src>/libgcc/unwind-generic.h) this typedef has
changed to "typedef unsigned _Unwind_Word __attribute__((__mode__(__unwind_word__)));"
in June 2008.

With this mode, _Unwind_Word has a size of 4 bytes on s390-32 (zarch-mode).
The same change applies to _Unwind_Sword.
Thus this patch updates the unwind header according to these changes.

Afterwards, the int-to-pointer-cast-warning is gone away on s390-32 (zarch-mode)
and the testsuite runs with the same test-failures as s390-32 (esa-mode)
plus FAIL: c++-types-check. Here register_t is expected to has a size of 4 bytes,
but it has a size of 8 bytes due to:
posix/sys/types.h:205:typedef int register_t __attribute__ ((__mode__ (__word__)));

The libgcc-patch for gcc 4.4 can be found here:
"[PATCH, spu, unwind] Remove attribute ((mode (word))) from unwind.h"
https://gcc.gnu.org/ml/gcc-patches/2008-06/msg00969.html

ChangeLog:

	* sysdeps/generic/unwind.h
	(_Unwind_Word): Use __mode__(__unwind_word__)
	instead of __mode__(__word__).
	(_Unwind_Sword): Likewise.
-rw-r--r--ChangeLog7
-rw-r--r--sysdeps/generic/unwind.h4
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ea5367ca90..72255512a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2015-08-26  Stefan Liebler  <stli@linux.vnet.ibm.com>
 
+	* sysdeps/generic/unwind.h
+	(_Unwind_Word): Use __mode__(__unwind_word__)
+	instead of __mode__(__word__).
+	(_Unwind_Sword): Likewise.
+
+2015-08-26  Stefan Liebler  <stli@linux.vnet.ibm.com>
+
 	* sysdeps/s390/s390-64/utf8-utf16-z9.c
 	(MAX_NEEDED_INPUT): New define.
 	(MAX_NEEDED_OUTPUT): New define.
diff --git a/sysdeps/generic/unwind.h b/sysdeps/generic/unwind.h
index 41b6aecd62..75d3084aca 100644
--- a/sysdeps/generic/unwind.h
+++ b/sysdeps/generic/unwind.h
@@ -31,8 +31,8 @@ extern "C" {
 
 /* @@@ The IA-64 ABI uses uint64 throughout.  Most places this is
    inefficient for 32-bit and smaller machines.  */
-typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));
-typedef signed _Unwind_Sword __attribute__((__mode__(__word__)));
+typedef unsigned _Unwind_Word __attribute__((__mode__(__unwind_word__)));
+typedef signed _Unwind_Sword __attribute__((__mode__(__unwind_word__)));
 #if defined(__ia64__) && defined(__hpux__)
 typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__)));
 #else