From patchwork Thu Oct 27 18:45:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 79778 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp785939qge; Thu, 27 Oct 2016 11:45:52 -0700 (PDT) X-Received: by 10.98.154.10 with SMTP id o10mr17016195pfe.79.1477593952159; Thu, 27 Oct 2016 11:45:52 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u83si9103504pfk.205.2016.10.27.11.45.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Oct 2016 11:45:52 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-74133-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-74133-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74133-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:mime-version; q=dns; s=default; b=WaKns MdTLmhs+9kWwjulPk4dtDso6oWMxneXTklqbKeq+ONzWAgcYO4acxB6Nx8Fzx+ZI lagsc4dFwhJ7dS+oOWXwBghzl4JumkndNDzwdfOK2vadrTotIUqD7jHsWpRU0u3Z CEbv5sJH4qaFLLdaMQWNWM3XR0ehGCTr2Xj6LA= 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:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:mime-version; s=default; bh=8jWQQAn14h4 R9SL7YzFPQ+TAfQc=; b=uCnagZHZDbyFsUcsu1e4ZSYetvKLfhYeZvtCnvM/ShG jbA16UgVTp6G+3i+ctaC63DC8cmd54tGMxLRRUhPC460xEwCFxvqtL7gC9yHi0Gb G/M6rdake86Uv3ts/EHuaDDOkql9bXLnIvRNtitZUDkK/HFCZkavh/JgoHs+ujw8 = Received: (qmail 103974 invoked by alias); 27 Oct 2016 18:45:39 -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 103952 invoked by uid 89); 27 Oct 2016 18:45:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=64-bits, 64bits, 410, HX-HELO:sk:NAM03-D X-HELO: NAM03-DM3-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Steve.Ellcey@cavium.com; Message-ID: <1477593917.15823.1.camel@caviumnetworks.com> Subject: Re: [PATCH] Define wordsize.h macros everywhere From: Steve Ellcey To: Joseph Myers CC: , Date: Thu, 27 Oct 2016 11:45:17 -0700 In-Reply-To: References: <1477506839.26691.5.camel@caviumnetworks.com> MIME-Version: 1.0 X-ClientProxiedBy: CY1PR18CA0034.namprd18.prod.outlook.com (10.163.31.44) To BLUPR0701MB1057.namprd07.prod.outlook.com (10.160.34.154) X-MS-Office365-Filtering-Correlation-Id: 5295941d-72fa-49b1-58ee-08d3fe9969db X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1057; 2:G4PZYPa4uv3dbg83W6jUQOCj6fCkF8sO1rSfp+/rOO71fzi9mbU9O2qSOQcymFMLWf4rYKzV40/90XZ8pP4xHq4uIMWUCT/tAnhoUpZokW32J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ZKwBLH1VrdbnoqfPHIlZccReoAamsUN63gcsUNYJG5/gbdt3Pe6sYLybd35fYM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415321)(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:BLUPR0701MB1057; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1057; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1057; 4:7FnW917lOzg7tsLKxsbm/OI7+itVKaghJct0w0IeoYMrgdCV5hOMIOXhfsvwraA2ZyO2rH+XSlBhqktEER9e8XhKZSoASkMNvGolpOJw+u+UC2ULIwtgBY1gmg3h5V/zAXava02eRhw3TxDN47gi+TYYpeEus69A8FkEjpMsVhbiGz9UD7AkC4k0YAlBaeW4HorQg0tAR6EaUMr05BaYKhb9I/WAaSvn8+n0QQmMQx55zil0ZsuXvNpXDb1rSug8wHC6rGVriuVpYTwLGmoMg4xqPz83omtjnnJW/XnMB40zUNdlbQf2h6KaAWHQBanJQxryMcSPB8CLFCAqBHUJTNJpag4hdsD5gSH/2XKDNyExt2yBbhlD0UMClPP8z9GgFeHlNE+NKs72iD98GMM0SCpe6E2CLpoHpS7ZonU/xrA= X-Forefront-PRVS: 0108A997B2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(199003)(189002)(377424004)(7736002)(305945005)(7846002)(50226002)(8676002)(92566002)(76176999)(69596002)(50986999)(84326002)(19580395003)(110136003)(4610100001)(5890100001)(42186005)(36756003)(105586002)(42882006)(106356001)(81166006)(68736007)(2950100002)(6916009)(81156014)(53416004)(19580405001)(5660300001)(3846002)(6116002)(101416001)(4001430100002)(189998001)(586003)(568964002)(97736004)(107886002)(4001150100001)(33646002)(2906002)(4326007)(2476003)(103116003)(6666003)(512874002)(77096005)(66066001)(99106002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1057; H:sellcey-lt.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1057; 23:JZqs4dSsJNR0qPah0JX71NIVgp4b21UDY+ejatZ?= =?us-ascii?Q?W0lMFQZmdi1MAtH44HzhfiqnBbU+/Tsd9KeW6vmkyRqsmJ6mA1cktOWfULH7?= =?us-ascii?Q?0UIBySPrAlRb+Bbod5eRA3IuqEC4Jx5QU8A1sxWWd9oLrTYKMJQPVZ1yhCFl?= =?us-ascii?Q?5xfNXxD6N+5VyJTKJSPeYz+wwH8iL7emAHKI6irI230ucWdVXG//Djbfs0p9?= =?us-ascii?Q?4tGlEuccx/E7oyrh+93PT0G1P3cTmNEhTLOTrsYmp1RaClEx/DEtOCPJaXhS?= =?us-ascii?Q?Z0IixiibMB9J2+Co+g6TtUQW//eNHkevctMczH8VkQyqEc/RYz/uWR6+3sek?= =?us-ascii?Q?oyl4exbsE2S6mFSUoFZfkuaIjwh+L90TlxQWHjKW36mKsQuKat0JkUj2e1B8?= =?us-ascii?Q?6EFjWCvj5ZwZcHvrMthNEzEatUxFZBwUrqOx6TTQ/TtIVT/jRlH0Fdh+dewE?= =?us-ascii?Q?WHrNTGjG4M2NOSxcqhJ0w76ETCv8MtZksjWR9fFX1IWIStyijptKTQyfWOHe?= =?us-ascii?Q?4tdBwwuUBNHDIM+irDHA1sn/h0b+SLqzhdl7+uBVRbR3q4ujePItJ0VtrHF8?= =?us-ascii?Q?dxl8dZglkOP9k8r8OSGQnYXAOwt2hcQ0dxn7NqL5hERR5COaN/PDusFKfDcI?= =?us-ascii?Q?d5+z9e4XHZaKLxOm8IqlSsWcSRZS5/oGmORgYAHN6gsY96kjuJEg64d1/z/L?= =?us-ascii?Q?CXlJ/J8Mfq6i2A+kSgpVCMKJsZi9i0p0bBO9nKM7iqxX2eAGEE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DUzC7sPKP/jq35wKAcN31; 5:WYMNcp7lPBrPgsDhkgdv6C5wWITb1JrgCL4HyJj2+7TqMNqMiLT48FqtWXYPSJTR1/RyfQi7Mt41E1/ixIsdtpbdPIS5WwdOjYcEYyAu/lzovUEZTix8sjEyqeNoixNUoXUZg/vrVxhE29Gb5ze5omgKQMWQmiKB7JZmoN4xk4Q=; 24:FCBfSA+zGuC7ua3ay5lN2wNQSWBTS8Z0ZTDTfoxl7LuV018XJrUSmAVgKBC3Vt4ln2ePp6jaXaDJSDdRwfuWvvZR6/NOBE4zVZUla1Kw3XQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1057; 7:cfFuHKj9H1DG47s8lBdpwzZlviPggQQdxHiMV68ytPr2XPqc1R06XgWXicTo7Cz6aZxMV/ovlyD4487kJkvnqU37Z5wZsMRZqKh+uX8GvEQX93YvPWxFHskmRzhIHDulWmdDEljJECBBidz684JEgP2XlPvhRWtJjg3kwXSZMMkcWwNMHfdLurB1la8VsYaTTBVTBu1tkVMSKuZ9Oc0/ePHVLXD6opxoNp9ZHAXu8RKPBGgwJ6PeL3pucFsN9H1smNXm8+/UYxG5am1QFSKE044qlqhmnjN/CQJDWvh4gn/pH5/yfkXJymxwI1UVupjd/LWeKjk78Efjwu4rP95iJrTJuHhOJVvDg6fHD8LrHh0= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2016 18:45:24.3622 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1057 Here is an update of my earlier wordsize.h patch.  I removed the __SYSCALL_WORDSIZE changes.  That macro definition is still in the x86 wordsize.h header but nothing in this patch changes it  anymore. I updated the description of __WORDSIZE and the __WORDSIZE32_* macros and I only define the __WORDSIZE32_* macros when __WORDSIZE is 32. I also fixed the __WORDSIZE32_SIZE_ULONG description to refer to  size_t instead of ssize_t since size_t is the type for SIZE_MAX. I retested on x86 and aarch64 to ensure that everything still built and ran with no regressions. Steve Ellcey sellcey@caviumnetworks.com 2016-10-27  Yury Norov       Steve Ellcey * bits/wordsize.h: Add documentation. * sysdeps/aarch64/bits/wordsize.h : New file * sysdeps/generic/stdint.h (PTRDIFF_MIN, PTRDIFF_MAX): Update definitions. (SIZE_MAX): Change ifdef to if in __WORDSIZE32_SIZE_ULONG check. * sysdeps/gnu/bits/utmp.h (__WORDSIZE_TIME64_COMPAT32): Check with #if instead of #ifdef. * sysdeps/gnu/bits/utmpx.h (__WORDSIZE_TIME64_COMPAT32): Ditto. * sysdeps/mips/bits/wordsize.h (__WORDSIZE32_SIZE_ULONG, __WORDSIZE32_PTRDIFF_LONG, __WORDSIZE_TIME64_COMPAT32): Add or change defines. * sysdeps/powerpc/powerpc32/bits/wordsize.h: Likewise. * sysdeps/powerpc/powerpc64/bits/wordsize.h: Likewise. * sysdeps/s390/s390-32/bits/wordsize.h: Likewise. * sysdeps/s390/s390-64/bits/wordsize.h: Likewise. * sysdeps/sparc/sparc32/bits/wordsize.h: Likewise. * sysdeps/sparc/sparc64/bits/wordsize.h: Likewise. * sysdeps/tile/tilegx/bits/wordsize.h: Likewise. * sysdeps/tile/tilepro/bits/wordsize.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/wordsize.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/wordsize.h: Likewise. * sysdeps/wordsize-32/bits/wordsize.h: Likewise. * sysdeps/wordsize-64/bits/wordsize.h: Likewise. * sysdeps/x86/bits/wordsize.h: Likewise. diff --git a/bits/wordsize.h b/bits/wordsize.h index 9ef0e85..14edae3 100644 --- a/bits/wordsize.h +++ b/bits/wordsize.h @@ -1 +1,27 @@ #error "This file must be written based on the data type sizes of the target" + +/* The following entries are a template for what defines should be in the + wordsize.h header file for a target. */ + +/* Size in bits of the 'long int' and pointer types. */ +#define __WORDSIZE + +/* This should be set to 1 if __WORDSIZE is 32 and size_t is type + 'unsigned long' instead of type 'unsigned int'. This will ensure + that SIZE_MAX is defined as an unsigned long constant instead of an + unsigned int constant. Set to 0 if __WORDSIZE is 32 and size_t is + 'unsigned int' and leave undefined if __WORDSIZE is 64. */ +#define __WORDSIZE32_SIZE_ULONG + +/* This should be set to 1 if __WORDSIZE is 32 and ptrdiff_t is type 'long' + instead of type 'int'. This will ensure that PTRDIFF_MIN and PTRDIFF_MAX + are defined as long constants instead of int constants. Set to 0 if + __WORDSIZE is 32 and ptrdiff_t is type 'int' and leave undefined if + __WORDSIZE is 64. */ +#define __WORDSIZE32_PTRDIFF_LONG + +/* Set to 1 in order to force time types to be 32 bits instead of 64 bits in + struct lastlog and struct utmp{,x} on 64-bit ports. This may be done in + order to make 64-bit ports compatible with 32-bit ports. Set to 0 for + 64-bit ports where the time types are 64-bits or for any 32-bit ports. */ +#define __WORDSIZE_TIME64_COMPAT32 diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h index e69de29..6f0a958 100644 --- a/sysdeps/aarch64/bits/wordsize.h +++ b/sysdeps/aarch64/bits/wordsize.h @@ -0,0 +1,28 @@ +/* Determine the wordsize from the preprocessor defines. + + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef __LP64__ +# define __WORDSIZE 64 +#else +# define __WORDSIZE 32 +# define __WORDSIZE32_SIZE_ULONG 1 +# define __WORDSIZE32_PTRDIFF_LONG 1 +#endif + +#define __WORDSIZE_TIME64_COMPAT32 0 diff --git a/sysdeps/generic/stdint.h b/sysdeps/generic/stdint.h index 5428dbc..8e4347c 100644 --- a/sysdeps/generic/stdint.h +++ b/sysdeps/generic/stdint.h @@ -249,8 +249,13 @@ typedef unsigned long long int uintmax_t; # define PTRDIFF_MIN (-9223372036854775807L-1) # define PTRDIFF_MAX (9223372036854775807L) # else -# define PTRDIFF_MIN (-2147483647-1) -# define PTRDIFF_MAX (2147483647) +# if __WORDSIZE32_PTRDIFF_LONG +# define PTRDIFF_MIN (-2147483647L-1) +# define PTRDIFF_MAX (2147483647L) +# else +# define PTRDIFF_MIN (-2147483647-1) +# define PTRDIFF_MAX (2147483647) +# endif # endif /* Limits of `sig_atomic_t'. */ @@ -261,7 +266,7 @@ typedef unsigned long long int uintmax_t; # if __WORDSIZE == 64 # define SIZE_MAX (18446744073709551615UL) # else -# ifdef __WORDSIZE32_SIZE_ULONG +# if __WORDSIZE32_SIZE_ULONG # define SIZE_MAX (4294967295UL) # else # define SIZE_MAX (4294967295U) diff --git a/sysdeps/gnu/bits/utmp.h b/sysdeps/gnu/bits/utmp.h index 2a1ffcb..bce1a7b 100644 --- a/sysdeps/gnu/bits/utmp.h +++ b/sysdeps/gnu/bits/utmp.h @@ -35,7 +35,7 @@ previous logins. */ struct lastlog { -#ifdef __WORDSIZE_TIME64_COMPAT32 +#if __WORDSIZE_TIME64_COMPAT32 int32_t ll_time; #else __time_t ll_time; @@ -68,7 +68,7 @@ struct utmp /* The ut_session and ut_tv fields must be the same size when compiled 32- and 64-bit. This allows data files and shared memory to be shared between 32- and 64-bit applications. */ -#ifdef __WORDSIZE_TIME64_COMPAT32 +#if __WORDSIZE_TIME64_COMPAT32 int32_t ut_session; /* Session ID, used for windowing. */ struct { diff --git a/sysdeps/gnu/bits/utmpx.h b/sysdeps/gnu/bits/utmpx.h index b41548b..a438660 100644 --- a/sysdeps/gnu/bits/utmpx.h +++ b/sysdeps/gnu/bits/utmpx.h @@ -66,7 +66,7 @@ struct utmpx /* The fields ut_session and ut_tv must be the same size when compiled 32- and 64-bit. This allows files and shared memory to be shared between 32- and 64-bit applications. */ -#ifdef __WORDSIZE_TIME64_COMPAT32 +#if __WORDSIZE_TIME64_COMPAT32 __int32_t ut_session; /* Session ID, used for windowing. */ struct { diff --git a/sysdeps/mips/bits/wordsize.h b/sysdeps/mips/bits/wordsize.h index bc90435..7a3546b 100644 --- a/sysdeps/mips/bits/wordsize.h +++ b/sysdeps/mips/bits/wordsize.h @@ -17,7 +17,15 @@ #include -#define __WORDSIZE _MIPS_SZPTR +#define __WORDSIZE _MIPS_SZPTR + #if _MIPS_SIM == _ABI64 # define __WORDSIZE_TIME64_COMPAT32 1 +#else +# define __WORDSIZE_TIME64_COMPAT32 0 +#endif + +#if __WORDSIZE == 32 +#define __WORDSIZE32_SIZE_ULONG 0 +#define __WORDSIZE32_PTRDIFF_LONG 0 #endif diff --git a/sysdeps/powerpc/powerpc32/bits/wordsize.h b/sysdeps/powerpc/powerpc32/bits/wordsize.h index f31ac9a..04ca9de 100644 --- a/sysdeps/powerpc/powerpc32/bits/wordsize.h +++ b/sysdeps/powerpc/powerpc32/bits/wordsize.h @@ -5,4 +5,7 @@ # define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 +# define __WORDSIZE_TIME64_COMPAT32 0 +# define __WORDSIZE32_SIZE_ULONG 0 +# define __WORDSIZE32_PTRDIFF_LONG 0 #endif diff --git a/sysdeps/powerpc/powerpc64/bits/wordsize.h b/sysdeps/powerpc/powerpc64/bits/wordsize.h index f31ac9a..04ca9de 100644 --- a/sysdeps/powerpc/powerpc64/bits/wordsize.h +++ b/sysdeps/powerpc/powerpc64/bits/wordsize.h @@ -5,4 +5,7 @@ # define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 +# define __WORDSIZE_TIME64_COMPAT32 0 +# define __WORDSIZE32_SIZE_ULONG 0 +# define __WORDSIZE32_PTRDIFF_LONG 0 #endif diff --git a/sysdeps/s390/s390-32/bits/wordsize.h b/sysdeps/s390/s390-32/bits/wordsize.h index da791fa..c7a5fbf 100644 --- a/sysdeps/s390/s390-32/bits/wordsize.h +++ b/sysdeps/s390/s390-32/bits/wordsize.h @@ -5,8 +5,11 @@ #else # define __WORDSIZE 32 # define __WORDSIZE32_SIZE_ULONG 1 +# define __WORDSIZE32_PTRDIFF_LONG 0 #endif +#define __WORDSIZE_TIME64_COMPAT32 0 + #if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL /* Signal that we didn't used to have a `long double'. The changes all diff --git a/sysdeps/s390/s390-64/bits/wordsize.h b/sysdeps/s390/s390-64/bits/wordsize.h index da791fa..31e0ec6 100644 --- a/sysdeps/s390/s390-64/bits/wordsize.h +++ b/sysdeps/s390/s390-64/bits/wordsize.h @@ -5,8 +5,11 @@ #else # define __WORDSIZE 32 # define __WORDSIZE32_SIZE_ULONG 1 +# define __WORDSIZE32_PTRDIFF_LONG 0 #endif +#define __WORDSIZE_TIME64_COMPAT32 0 + #if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL /* Signal that we didn't used to have a `long double'. The changes all diff --git a/sysdeps/sparc/sparc32/bits/wordsize.h b/sysdeps/sparc/sparc32/bits/wordsize.h index d8fd1a5..2f66f10 100644 --- a/sysdeps/sparc/sparc32/bits/wordsize.h +++ b/sysdeps/sparc/sparc32/bits/wordsize.h @@ -5,4 +5,7 @@ # define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 +# define __WORDSIZE_TIME64_COMPAT32 0 +# define __WORDSIZE32_SIZE_ULONG 0 +# define __WORDSIZE32_PTRDIFF_LONG 0 #endif diff --git a/sysdeps/sparc/sparc64/bits/wordsize.h b/sysdeps/sparc/sparc64/bits/wordsize.h index d8fd1a5..2f66f10 100644 --- a/sysdeps/sparc/sparc64/bits/wordsize.h +++ b/sysdeps/sparc/sparc64/bits/wordsize.h @@ -5,4 +5,7 @@ # define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 +# define __WORDSIZE_TIME64_COMPAT32 0 +# define __WORDSIZE32_SIZE_ULONG 0 +# define __WORDSIZE32_PTRDIFF_LONG 0 #endif diff --git a/sysdeps/tile/tilegx/bits/wordsize.h b/sysdeps/tile/tilegx/bits/wordsize.h index 5d4e4b4..9dc4da5 100644 --- a/sysdeps/tile/tilegx/bits/wordsize.h +++ b/sysdeps/tile/tilegx/bits/wordsize.h @@ -5,4 +5,7 @@ # define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 +# define __WORDSIZE_TIME64_COMPAT32 0 +# define __WORDSIZE32_SIZE_ULONG 0 +# define __WORDSIZE32_PTRDIFF_LONG 0 #endif diff --git a/sysdeps/tile/tilepro/bits/wordsize.h b/sysdeps/tile/tilepro/bits/wordsize.h index da587a2..8281538 100644 --- a/sysdeps/tile/tilepro/bits/wordsize.h +++ b/sysdeps/tile/tilepro/bits/wordsize.h @@ -1,3 +1,4 @@ /* Determine the wordsize from the preprocessor defines. */ -#define __WORDSIZE 32 +#define __WORDSIZE 32 +#define __WORDSIZE_TIME64_COMPAT32 0 diff --git a/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h b/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h index 51fc433..f0961f6 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h @@ -16,6 +16,7 @@ . */ #define __WORDSIZE 64 +#define __WORDSIZE_TIME64_COMPAT32 0 #if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h index 3e8a1e0..109f08c 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h @@ -5,6 +5,9 @@ # define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 +# define __WORDSIZE_TIME64_COMPAT32 0 +# define __WORDSIZE32_SIZE_ULONG 0 +# define __WORDSIZE32_PTRDIFF_LONG 0 #endif #if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL diff --git a/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h b/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h index 2d958d2..76d6579 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h @@ -4,6 +4,8 @@ # define __WORDSIZE 64 #else # define __WORDSIZE 32 +# define __WORDSIZE32_SIZE_ULONG 0 +# define __WORDSIZE32_PTRDIFF_LONG 0 #endif #if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL diff --git a/sysdeps/wordsize-32/bits/wordsize.h b/sysdeps/wordsize-32/bits/wordsize.h index 2aa16bc..a251f3a 100644 --- a/sysdeps/wordsize-32/bits/wordsize.h +++ b/sysdeps/wordsize-32/bits/wordsize.h @@ -15,4 +15,7 @@ License along with the GNU C Library; if not, see . */ -#define __WORDSIZE 32 +#define __WORDSIZE 32 +#define __WORDSIZE_TIME64_COMPAT32 0 +#define __WORDSIZE32_SIZE_ULONG 0 +#define __WORDSIZE32_PTRDIFF_LONG 0 diff --git a/sysdeps/wordsize-64/bits/wordsize.h b/sysdeps/wordsize-64/bits/wordsize.h index 0944f9e..8b5c502 100644 --- a/sysdeps/wordsize-64/bits/wordsize.h +++ b/sysdeps/wordsize-64/bits/wordsize.h @@ -15,4 +15,5 @@ License along with the GNU C Library; if not, see . */ -#define __WORDSIZE 64 +#define __WORDSIZE 64 +#define __WORDSIZE_TIME64_COMPAT32 0 diff --git a/sysdeps/x86/bits/wordsize.h b/sysdeps/x86/bits/wordsize.h index e25af28..70f652b 100644 --- a/sysdeps/x86/bits/wordsize.h +++ b/sysdeps/x86/bits/wordsize.h @@ -4,10 +4,14 @@ # define __WORDSIZE 64 #else # define __WORDSIZE 32 +#define __WORDSIZE32_SIZE_ULONG 0 +#define __WORDSIZE32_PTRDIFF_LONG 0 #endif #ifdef __x86_64__ # define __WORDSIZE_TIME64_COMPAT32 1 /* Both x86-64 and x32 use the 64-bit system call interface. */ # define __SYSCALL_WORDSIZE 64 +#else +# define __WORDSIZE_TIME64_COMPAT32 0 #endif