From patchwork Fri Apr 7 10:27:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 13204648 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE478C76196 for ; Fri, 7 Apr 2023 10:27:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240612AbjDGK1k (ORCPT ); Fri, 7 Apr 2023 06:27:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232920AbjDGK1e (ORCPT ); Fri, 7 Apr 2023 06:27:34 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 439C8A5E8 for ; Fri, 7 Apr 2023 03:27:31 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 6DC215C02F9; Fri, 7 Apr 2023 06:27:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 07 Apr 2023 06:27:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1680863250; x= 1680949650; bh=aLVbYlG34KPVa/4L/3BosMypUfUvY6Vppxlepog/hIQ=; b=q vUqrek4jrhtk/d0d7sesS0v/EFPnlKX8TI3NBKJaP3ZRUQDeN3VOpga4E4UUzNlT Iu0PhR+q5gSlh/yjDK4lQ9LJIS5PdFz51aU92WcPPRcG2dSq/srb524aP6RuE7Ok 2vdmtF7cXaANcJcy/6J3jyY8PMSNLdTVfPp3N7Aq6qNY57I5hnSbsIdkeUYtK96t WCkSwpTCtpeKBkxHXPw6QPIHRMLQhvYeudypO624XiQJ3WYEl/ue7ubCwKa0lmR3 Tfov+Sob4Z+wIevz5RvrPEGnVbYlY928h/pPdqJxtpQFaccI/NbghuY43jPUHFrL 3fIZpNe8Oj1XbL8gbZwgQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1680863250; x= 1680949650; bh=aLVbYlG34KPVa/4L/3BosMypUfUvY6Vppxlepog/hIQ=; b=F yU7MITTL3GD295ghGR8ze4OES4E8IMWYyux9Xk6flRgP9r4+uKVNat2QICQgQFFk 6k5qFPufBDLv/vNY23L/KzsU97XOkPx0DnnSdAWj/UcyTYc2+6SheHz2lVhOyLOV 5K0aTHwHQ/iGFMJjw++MUDAgYwFYMSm0Y9eLPqmDXrihelC4yDch5oy67XS0Mwhq mzCqbPLUTT40uo/xnwjiJslPnY0ulvRCG5ht8f84SErlaHlhGcTJruz3rL7owGMO BS+HrrgLnAnoccvNzLiSNbX4kkNJJBzifzTNoN7nYnTDdq53OIJYG197WrfnlD/O HM7ZRoDUZWiK3PjrM+b1g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejhedgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghn ghesfhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnhepfeeludefheegvdeuvd dvgeekgfdvtdettdelieeihfegtedugeekhfdvhfejfedtnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhi hgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 7 Apr 2023 06:27:29 -0400 (EDT) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: llvm@lists.linux.dev, tsbogend@alpha.franken.de, ndesaulniers@google.com, nathan@kernel.org, Jiaxun Yang Subject: [PATCH 4/5] MIPS: Detect toolchain support of o32 ABI with 64 bit CPU Date: Fri, 7 Apr 2023 11:27:20 +0100 Message-Id: <20230407102721.14814-5-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20230407102721.14814-1-jiaxun.yang@flygoat.com> References: <20230407102721.14814-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org LLVM is not happy with using o32 ABI on 64 bit CPU, thus build 32 bit kernel is unsupported. Detect this in Kconfig to prevent user select 32 bit kernel with unsupported toolchain. Reported-by: Nathan Chancellor Signed-off-by: Jiaxun Yang --- arch/mips/Kconfig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index d896af492da6..5e399a5ac3b3 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -2016,6 +2016,7 @@ choice config 32BIT bool "32-bit kernel" depends on CPU_SUPPORTS_32BIT_KERNEL && SYS_SUPPORTS_32BIT_KERNEL + depends on CC_HAS_O32_ABI select TRAD_SIGNALS help Select this option if you want to build a 32-bit kernel. @@ -3136,7 +3137,7 @@ config COMPAT config MIPS32_O32 bool "Kernel support for o32 binaries" - depends on 64BIT + depends on 64BIT && CC_HAS_O32_ABI select ARCH_WANT_OLD_COMPAT_IPC select COMPAT select MIPS32_COMPAT @@ -3184,6 +3185,10 @@ config CC_HAS_DADDI_WORKAROUNDS config CC_HAS_BROKEN_INLINE_COMPAT_BRANCH def_bool y if CC_IS_CLANG +config CC_HAS_O32_ABI + def_bool y + depends on !CPU_SUPPORTS_64BIT_KERNEL || $(cc-option,-march=mips3 -mabi=32) + config AS_HAS_MSA def_bool $(cc-option,-Wa$(comma)-mmsa)