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 35B531061B37 for ; Tue, 31 Mar 2026 11:44:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:Subject:References:In-Reply-To:Message-Id:Cc:To:From:Date: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=45JgVcq0EgVfNtDgS04MgTxf5U+SjaNRaHQGB6s03l8=; b=LrCyV5qftL2s8U3G+vskf2G9Al RAbFbxEYNT5Zd61i3aUCkAumPwfOPyGy7OK12FwYs5CSligdeakAQEJVWf9Y2XHbWY4zw6Djeq5ad qumulom6BxPlL8l4jAasOZa1rG+tmenQASthtKBNNSDq8SUxXkVzWx+GNPMrCMD03BTWx3ai4QqUi 6qC6NDLjdoITlC5DWBtfNJTsgi3sL6+I23Dm0gRhBrD5Ur1WIKKdN6s9p24u3AApaZX1kJ5BhSGap nKNAzcL8MkNn4E5xwS0aypoupIjHBWZCSL7AXVNuN0kCSBcnDyRCX9ir5dJuCRm9636Dh1+vqB/Y1 oVlNKHpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w7XWJ-0000000Ctik-1Oc1; Tue, 31 Mar 2026 11:44:31 +0000 Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1w7XWG-0000000CtiJ-3ygK; Tue, 31 Mar 2026 11:44:30 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 062CAEC0235; Tue, 31 Mar 2026 07:44:27 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Tue, 31 Mar 2026 07:44:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1774957467; x=1775043867; bh=45JgVcq0EgVfNtDgS04MgTxf5U+SjaNRaHQGB6s03l8=; b= Jxap8/9S4qYqMwrKvG6LkL4qmDzEcuGMGDJ3Cz2bZ0vxUUfbPt7c1qTw+rKEDpy+ H96GkWp6u3KcKGr2qct0JUN/2X9EmZCHETETy4o/MQnOwTCKCxywAKErWV01t/tS AoB2WNCyADBh/I9ydKmyNcfSk8ifT5ztBoh/vqUAviwELJGFfA0crVeDB4mK11WL ahkiAwGQbh1GkVlIRlDvp2kBiECEdrZZ9pCtAZL7MoOKBwYlnwTHGMo5EVr3xqyk bkBC7R4FFB5K20KVin1XLG6iOgUZ4X6ut43zPKpdCsTq4lcYKZLpTsWfI9o1mQ45 GxMWe28tebPtm8H9rPSwPQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1774957467; x= 1775043867; bh=45JgVcq0EgVfNtDgS04MgTxf5U+SjaNRaHQGB6s03l8=; b=k uLyiPMoH1o8hur4JjSJuRWTEfIETsH7xtk6oTrvGkWtl/WpnqWZdsuVd4dFow7CJ t+EYzO1ktwqkE+meCgWhVgE0SUn45Sx6RnyYx7a5iqlTvHIrhneDetOw102WDFrn tHoOlJFw1F4AQROF04cLDYAraPS84KvCc3xdral9L9YKzdr540GQnAUdmYLN9qMU smmRyd0iv77Vr4+N8sj8wYfQMhws9jKeyqvdga6in+0k1BsP5d042X5ThI3t95oK 2SeiZr3KvLiL1X8b8C/UbrsQoECRWzBT0Au56Ghgdk8zvRuOf+vArZ4A2c0rdx8k ITZ0Aq5KQmVCecXlXCtyw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegrihhl ohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpe foggffhffvvefkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdetrhhnugcuuegv rhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtthgvrhhnpe dvhfdvkeeuudevfffftefgvdevfedvleehvddvgeejvdefhedtgeegveehfeeljeenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrhhnugesrg hrnhgusgdruggvpdhnsggprhgtphhtthhopeefledpmhhouggvpehsmhhtphhouhhtpdhr tghpthhtohepjhgrmhhivgdrtghunhhlihhffhgvsegrrhhmrdgtohhmpdhrtghpthhtoh eptggrthgrlhhinhdrmhgrrhhinhgrshesrghrmhdrtghomhdprhgtphhtthhopehmrghr khdrrhhuthhlrghnugesrghrmhdrtghomhdprhgtphhtthhopehlihhnuhigsegrrhhmlh hinhhugidrohhrghdruhhkpdhrtghpthhtoheprghnthhonhdrihhvrghnohhvsegtrghm sghrihgughgvghhrvgihshdrtghomhdprhgtphhtthhopegurghvihgusegurghvihgugh hofidrnhgvthdprhgtphhtthhopehgrghrhiesghgrrhihghhuohdrnhgvthdprhgtphht thhopegsohhquhhnrdhfvghnghesghhmrghilhdrtghomhdprhgtphhtthhopegthhhrih hsihdrshgthhhrvghflhesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 31988700065; Tue, 31 Mar 2026 07:44:25 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: AUJnWW6OA6Vc Date: Tue, 31 Mar 2026 13:44:04 +0200 From: "Arnd Bergmann" To: "Christian Schrefl" , "Miguel Ojeda" , "Russell King" , "Alice Ryhl" Cc: "Ard Biesheuvel" , "Jamie Cunliffe" , "Will Deacon" , "Catalin Marinas" , "Miguel Ojeda" , "Andreas Hindborg" , acourbot@nvidia.com, "Andrew Morton" , "Anton Ivanov" , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , "Boqun Feng" , "Danilo Krummrich" , "David Gow" , "Gary Guo" , "Johannes Berg" , "Justin Stitt" , linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-um@lists.infradead.org, llvm@lists.linux.dev, "Benno Lossin" , "Mark Rutland" , mmaurer@google.com, "Bill Wendling" , "Nathan Chancellor" , "Nick Desaulniers" , "Nicolas Schier" , "Nicolas Schier" , "Peter Zijlstra" , "Richard Weinberger" , rust-for-linux@vger.kernel.org, "Trevor Gross" , "Uladzislau Rezki (Sony)" Message-Id: In-Reply-To: References: <20260322192159.88138-1-ojeda@kernel.org> <20260323000327.111235-1-ojeda@kernel.org> <9cf5a94c-0f37-446c-b63d-ddac5674d220@gmail.com> Subject: Re: [PATCH v2 0/3] Inline helpers into Rust without full LTO Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260331_044429_289206_1FB01C60 X-CRM114-Status: GOOD ( 14.17 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Mar 30, 2026, at 23:09, Christian Schrefl wrote: > On 3/26/26 6:30 PM, Miguel Ojeda wrote: >> On Thu, Mar 26, 2026 at 4:18=E2=80=AFPM Russell King (Oracle) >> wrote: >>> >>> I'm not sure if this is still true, but I believe it used to be the = case >>> that the -linux-gnueabi target has one behaviour for enums (fixed si= ze) >>> whereas -none-eabi, the size of the type depends on the range of val= ues >>> included in the enum. >>> >>> Certianly, when Arm Ltd were proposing EABI, EABI had the latter >>> behaviour, and I think there were cases where Linux used "enum" in >>> its UAPI. >>=20 >> Short enums? I see `c-enum-min-bits` in the armv7a-none-eabi built-in >> `rustc` target, and indeed: >>=20 >> #![no_std] >>=20 >> #[repr(C)] >> enum T { >> A, >> B, >> } >>=20 >> pub static S: usize =3D core::mem::size_of::(); >>=20 >> is 1 for that one, and 4 for the other. > > I guess we could use a custom target spec, but I'm not > sure if that is worth the hassle of adding another one. The kernel Makefile forces the Linux enum behavior using arch/arm/Makefile:CFLAGS_ABI :=3D-mabi=3Daapcs-linux -mfpu=3Dvfp ifeq ($(CONFIG_CC_IS_CLANG),y) CFLAGS_ABI +=3D -meabi gnu endif KBUILD_RUSTFLAGS +=3D --target=3Darm-unknown-linux-gnueabi regardless of the compiler. I think this should be safe for any combination of C and rust compilers. Arnd