Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759927AbbLCLcG (ORCPT ); Thu, 3 Dec 2015 06:32:06 -0500 Received: from foss.arm.com ([217.140.101.70]:48379 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752044AbbLCLcE (ORCPT ); Thu, 3 Dec 2015 06:32:04 -0500 Date: Thu, 3 Dec 2015 11:31:58 +0000 From: Catalin Marinas To: Yury Norov Cc: arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, pinskia@gmail.com, Prasun.Kapoor@caviumnetworks.com, schwab@suse.de, Nathan_Lynch@mentor.com, agraf@suse.de, klimov.linux@gmail.com, broonie@kernel.org, jan.dakinevich@gmail.com, ddaney.cavm@gmail.com, bamvor.zhangjian@huawei.com, philipp.tomsich@theobroma-systems.com, andrey.konovalov@linaro.org, joseph@codesourcery.com, christoph.muellner@theobroma-systems.com Subject: Re: [PATCH v6 05/19] arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64 Message-ID: <20151203113157.GI10747@e104818-lin.cambridge.arm.com> References: <1447795019-30176-1-git-send-email-ynorov@caviumnetworks.com> <1447795019-30176-6-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1447795019-30176-6-git-send-email-ynorov@caviumnetworks.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1198 Lines: 31 On Wed, Nov 18, 2015 at 12:16:45AM +0300, Yury Norov wrote: > diff --git a/arch/arm64/include/uapi/asm/bitsperlong.h b/arch/arm64/include/uapi/asm/bitsperlong.h > index fce9c29..4265243 100644 > --- a/arch/arm64/include/uapi/asm/bitsperlong.h > +++ b/arch/arm64/include/uapi/asm/bitsperlong.h > @@ -16,7 +16,14 @@ > #ifndef __ASM_BITSPERLONG_H > #define __ASM_BITSPERLONG_H > > -#define __BITS_PER_LONG 64 > +#if defined(__LP64__) > +/* Assuming __LP64__ will be defined for native ELF64's and not for ILP32. */ > +# define __BITS_PER_LONG 64 > +#elif defined(__ILP32__) > +# define __BITS_PER_LONG 32 > +#else > +# error "Neither LP64 nor ILP32: unsupported ABI in asm/bitsperlong.h" > +#endif Quick question: IIRC, earlier aarch64 gcc versions did not generate __ILP32__ when -mabi=ilp32, they only removed __LP64__. When did the change happen? Could we assume that all compiler versions used to generate ILP32 would define this? -- Catalin -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/