From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E66A0ECAAD8 for ; Tue, 20 Sep 2022 15:49:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gqggEqoml/Nz3MrnB4nEif+3ogcPFOL06qhX08WynOc=; b=JH0P5X9hlhII0J TcwHGdIbshV4UbLg3UsCZ/4US36O5kpAfJYE7KcQDkbGxVYYrkzaCM2YI+aXZMyJKb2+EJ+ursENG daYBrrd/DZfk2O07FeF8AeWxFLWmq9r5P2V7x+HQZ3k5OI06Iosm4N/cuK9DI1+VvI5hg0kI3ivNu /g5vwWiPuQfbGYqmewtvspDE5aKdFBXVUO9WqYUqVMoCn72BihXwcoXRX+6EfASqJHEdM7MFADugi BkPPiT0awlh62Prs8jTNMEF1I3NJVkErjZmb/7SjdYZuZX/u/yYkwMoXqFUF9Qj4I9vEYjCd9EwMW Izv58ZbBZA3P7JckMcDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oafU7-004z0A-Sb; Tue, 20 Sep 2022 15:48:32 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oafU3-004yyY-Eu for linux-arm-kernel@lists.infradead.org; Tue, 20 Sep 2022 15:48:30 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8407D61F98; Tue, 20 Sep 2022 15:48:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD816C433D6; Tue, 20 Sep 2022 15:48:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663688905; bh=zgE08dYoxlBRJ3bwjem0tKNWcm9v7waS4wBknSrNttc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GFF8GcWz0+Xo68S3ocapYQBMDDbKOu7WPfXVp1VM2DyFrizA+q0dLo2nN+WEDfMr9 XrQ0CbtuNVzWPXySE02mJ8MFb6DfGK5AjuytpJJQfJv0iEdbNv0TKsqcYg6+ytMzRA uUSh6a39S6rsSeBHu5ZQL5lGgMbHpG7FlszabUwDFCvX9headKJbhYTSQLEYQc+B/5 8WMWzFLX+TWIsk5RoHxdhLdT5RQsGb8TKvUIAvsP7wKU3azcDTAOGMprljB0kzj1ro FyLvqK4iwLIg4DD4rhy2pbPF03h3JVQ1Nbv8AI5nBVcxtKDHIeWy4yMoi4Cyxq3Zxo BGEWQMGPjnvtQ== Received: from 185-176-101-241.host.sccbroadband.ie ([185.176.101.241] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oafTz-00BRZ9-Jd; Tue, 20 Sep 2022 16:48:23 +0100 Date: Tue, 20 Sep 2022 16:48:20 +0100 Message-ID: <875yhikpx7.wl-maz@kernel.org> From: Marc Zyngier To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, Catalin Marinas , ardb@kernel.org, james.morse@arm.com, joey.gouly@arm.com, nathan@kernel.org, will@kernel.org Subject: Re: [PATCH] arm64: avoid BUILD_BUG_ON() in alternative-macros In-Reply-To: <20220920140044.1709073-1-mark.rutland@arm.com> References: <20220920140044.1709073-1-mark.rutland@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.176.101.241 X-SA-Exim-Rcpt-To: mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, ardb@kernel.org, james.morse@arm.com, joey.gouly@arm.com, nathan@kernel.org, will@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220920_084828_889235_69C275F3 X-CRM114-Status: GOOD ( 22.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 20 Sep 2022 15:00:44 +0100, Mark Rutland wrote: > > Nathan reports that the build fails when using clang and LTO: > > | In file included from kernel/bounds.c:10: > | In file included from ./include/linux/page-flags.h:10: > | In file included from ./include/linux/bug.h:5: > | In file included from ./arch/arm64/include/asm/bug.h:26: > | In file included from ./include/asm-generic/bug.h:5: > | In file included from ./include/linux/compiler.h:248: > | In file included from ./arch/arm64/include/asm/rwonce.h:11: > | ./arch/arm64/include/asm/alternative-macros.h:224:2: error: call to undeclared function 'BUILD_BUG_ON'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] > | BUILD_BUG_ON(feature >= ARM64_NCAPS); > | ^ > | ./arch/arm64/include/asm/alternative-macros.h:241:2: error: call to undeclared function 'BUILD_BUG_ON'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] > | BUILD_BUG_ON(feature >= ARM64_NCAPS); > | ^ > | 2 errors generated. > > ... the problem being that when LTO is enabled, includes > , and causes a circular include dependency > through . This manifests as BUILD_BUG_ON() not being > defined when used within . > > This patch avoids the problem and simplifies the include dependencies by > using compiletime_assert() instead of BUILD_BUG_ON(). > > Signed-off-by: Mark Rutland > Fixes: 21fb26bfb01ffe0d ("arm64: alternatives: add alternative_has_feature_*()") > Reported-by: Nathan Chancellor > Tested-by: Nathan Chancellor > Link: http://lore.kernel.org/r/YyigTrxhE3IRPzjs@dev-arch.thelio-3990X > Cc: Ard Biesheuvel > Cc: Catalin Marinas > Cc: James Morse > Cc: Joey Gouly > Cc: Marc Zyngier > Cc: Will Deacon > --- > arch/arm64/include/asm/alternative-macros.h | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel