From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755015AbbJAAkw (ORCPT ); Wed, 30 Sep 2015 20:40:52 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:51517 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754509AbbJAAku (ORCPT ); Wed, 30 Sep 2015 20:40:50 -0400 Message-ID: <1443660043.2730.15.camel@decadent.org.uk> Subject: [PATCH] x86: uapi: Fix __BITS_PER_LONG for x32 From: Ben Hutchings To: x86@kernel.org Cc: LKML Date: Thu, 01 Oct 2015 01:40:43 +0100 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-TdYQ0GMOjjZmLaaaJfPC" X-Mailer: Evolution 3.16.5-1 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 192.168.4.247 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-TdYQ0GMOjjZmLaaaJfPC Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On x32, gcc predefines __x86_64__ but long is only 32-bit. Use __ILP32__ to distinguish x32. Fixes this compiler error in perf: /=C2=ABPKGBUILDDIR=C2=BB/tools/include/asm-generic/bitops/__ffs.h: In funct= ion '__ffs': /=C2=ABPKGBUILDDIR=C2=BB/tools/include/asm-generic/bitops/__ffs.h:19:8: err= or: right shift count >=3D width of type [-Werror=3Dshift-count-overflow] word >>=3D 32; ^ This isn't sufficient to build perf for x32, though. Signed-off-by: Ben Hutchings --- arch/x86/include/uapi/asm/bitsperlong.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/uapi/asm/bitsperlong.h b/arch/x86/include/uap= i/asm/bitsperlong.h index b0ae1c4..217909b 100644 --- a/arch/x86/include/uapi/asm/bitsperlong.h +++ b/arch/x86/include/uapi/asm/bitsperlong.h @@ -1,7 +1,7 @@ #ifndef __ASM_X86_BITSPERLONG_H #define __ASM_X86_BITSPERLONG_H =20 -#ifdef __x86_64__ +#if defined(__x86_64__) && !defined(__ILP32__) # define __BITS_PER_LONG 64 #else # define __BITS_PER_LONG 32 --=20 Ben Hutchings Knowledge is power. France is bacon. --=-TdYQ0GMOjjZmLaaaJfPC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIVAwUAVgyBC+e/yOyVhhEJAQroCw//TsFKdlKd3Gh8nXRG44SAwIxJDjkm1Rza ME/4Pmh7L6SrEELhF43+YxxLQ7Fmd9k+CFgW8LCRzht68kuB/MUYW/jCL6N7mVuk jFnvTN5OKLWbI/76TgTOe9lFYXxZWac/E2/grawVgZnsJObhuNnl+Ru8Yxia0kEM SAAxlWrHGr8S5ukdi7hlYB+VqRHK5yxq0/h1PbIxzXgLBxuWRGy0Yu3/WWw81trr F2QCRVbxQt7hLPYYbvVOKLuIr+clL84+n2soKRYUweyequFM9s2y2DpBxUp6pXRj KvWdYJH9rn7XESAJzNo/OFTWugxMQPg+wxT8VpsVtEQZahEIlT6972LN58dZUOT8 Twz1AfJhpS43usJhmalLN8B/O/bhRy+EleQ9pzApC4eLxjyiDIn4a7v8rnUEPxeo Jvp6kUO+bIhL/NbcX6ubSWyBe4b9FCm7yDOBjYMuEoV2TUagq+wwy9Kqb6D54EiR hm8pPWPwBtbjLkG68FipSJBN9qOrOdjhH6hONaIRcyS5NguJjiBIherYh2Cl0Hrj Uugmz6rbDTJ9dT0Vh+5uCjZS/9dAuYZ1h200cfInbfcEgfe9cPN253WHToGUlfZw t70UqJi/zAETD2foCvedqRYe0X7n7oVf72HiC4U/SRYkbGfuyoq+I89U9C9LJjps TjhOOg5nUO8= =D2tv -----END PGP SIGNATURE----- --=-TdYQ0GMOjjZmLaaaJfPC--