From patchwork Tue Jul 28 07:31:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 501055 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 292C814031D for ; Tue, 28 Jul 2015 17:31:41 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=mUOxwFHk; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=r7pHvfy17BhKiUzoujKEkHuBViZoq SlmnbpExMxPSEHRPj/PFtN36sK5hYGdkdB4AzNLCR7X2jtaDc1TZCpZcHhdfuUF7 uxSRx31sdrjTiuoW3/bVFad1DzzZJ1VoqEdtQfGpj97HTp8PLZ4alX2RG0WiP97m K8EmLOrWDMnoc4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:mime-version :content-type; s=default; bh=7JXR7xTGgUb9Xn/1KICQxeqnfvc=; b=mUO xwFHkKNUqqfFkLPIs0z29Jb+jB5iZsCPeu2cxNJYz9WFb2sstKKg9559KLWxd0bY ddCXQPBuyM2YEFTuxfc8NE275D4UNd8+R701WJlDqStL2d7G7CgFD7DuaBaABjHn Ls1zKNhh+AnkRkaQc6kfA1jspjVto0L4b59cY1R4= Received: (qmail 119254 invoked by alias); 28 Jul 2015 07:31:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 119243 invoked by uid 89); 28 Jul 2015 07:31:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: plane.gmane.org To: libc-alpha@sourceware.org From: Stefan Liebler Subject: [PATCH] Adjust _Unwind_Word in unwind.h to version in libgcc. Date: Tue, 28 Jul 2015 09:31:21 +0200 Lines: 89 Message-ID: Mime-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 Hi, I get the following warning while building glibc on s390-32 with gcc option -mzarch: In file included from unwind.c:26:0: unwind.c: In function 'unwind_stop': ../sysdeps/s390/jmpbuf-unwind.h:37:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] (void *) (_Unwind_GetCFA (_context) \ ^ ../sysdeps/s390/jmpbuf-unwind.h:51:17: note: in definition of macro '_JMPBUF_UNWINDS_ADJ' ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj)) ^ unwind.c:62:12: note: in expansion of macro '_JMPBUF_CFA_UNWINDS_ADJ' || ! _JMPBUF_CFA_UNWINDS_ADJ (buf->cancel_jmp_buf[0].jmp_buf, context, 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 (/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 Ok to commit? Bye Stefan 2015-07-28 Stefan Liebler * sysdeps/generic/unwind.h (_Unwind_Word): Use __mode__(__unwind_word__) instead of __mode__(__word__). (_Unwind_Sword): Likewise. diff --git a/sysdeps/generic/unwind.h b/sysdeps/generic/unwind.h index 41b6aec..75d3084 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