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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44FAEC25B08 for ; Wed, 17 Aug 2022 14:41:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240266AbiHQOlF (ORCPT ); Wed, 17 Aug 2022 10:41:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240486AbiHQOkj (ORCPT ); Wed, 17 Aug 2022 10:40:39 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2D085FF68; Wed, 17 Aug 2022 07:40:15 -0700 (PDT) Received: from mail-ej1-f47.google.com ([209.85.218.47]) by mrelayeu.kundenserver.de (mreue012 [213.165.67.97]) with ESMTPSA (Nemesis) id 1N14xe-1nMpbb34jC-012VSC; Wed, 17 Aug 2022 16:40:13 +0200 Received: by mail-ej1-f47.google.com with SMTP id j8so24887380ejx.9; Wed, 17 Aug 2022 07:40:13 -0700 (PDT) X-Gm-Message-State: ACgBeo2gepU2aWElGKEdBcM0SZdXdmyYsWY+oqu1nmrwoclIrH8jdyL/ Uz8GkDdQaBuYHR87akMjfPLkwQmwsn2edCKzvAI= X-Google-Smtp-Source: AA6agR7iG7b/sKnfv3rtR0wMkiNVbuKu4gohq2MlJovs7t4zv9/h1/ech5e7m293ULb6jtgNsC4wsmH5KCjGWqjMolI= X-Received: by 2002:a17:907:6da8:b0:730:8ed5:2df8 with SMTP id sb40-20020a1709076da800b007308ed52df8mr16850681ejc.75.1660747213344; Wed, 17 Aug 2022 07:40:13 -0700 (PDT) MIME-Version: 1.0 References: <20220802015052.10452-1-ojeda@kernel.org> <20220802015052.10452-28-ojeda@kernel.org> In-Reply-To: <20220802015052.10452-28-ojeda@kernel.org> From: Arnd Bergmann Date: Wed, 17 Aug 2022 16:39:57 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 27/31] Kbuild: add Rust support To: Miguel Ojeda Cc: Linus Torvalds , Greg Kroah-Hartman , Sven Van Asbroeck , Catalin Marinas , Dave Hansen , Miguel Cano , Paul Mackerras , Gary Guo , Douglas Su , Borislav Petkov , linux-riscv@lists.infradead.org, Will Deacon , Martin Rodriguez Reboredo , Anton Ivanov , "H. Peter Anvin" , Masahiro Yamada , x86@kernel.org, Russell King , Ingo Molnar , Wedson Almeida Filho , Alex Gaynor , Antonio Terceiro , Adam Bratschi-Kaye , Albert Ou , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Boqun Feng , linux-um@lists.infradead.org, =?UTF-8?Q?Bj=C3=83B_6rn_Roy_Baron?= , Michal Marek , Daniel Xu , David Gow , Paul Walmsley , Dariusz Sosnowski , linux-arm-kernel@lists.infradead.org, Tiago Lam , Thomas Gleixner , Nick Desaulniers , linux-kernel@vger.kernel.org, Boris-Chengbiao Zhou , Jarkko Sakkinen , Palmer Dabbelt , Richard Weinberger , Finn Behrens , Johannes Berg , linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:tVzw5+z9RodDD21jtXQCFgO607eyohyIMOrWmsXL/aDjp4s+CRv l24azQbCM+GbjsQ0bt0M1q2TGktvETxpOKTJX8zIhUKMgmX6VjnNNvSMA+hLMZyXu2BOan1 rtuPt3KDtNuPQ2JniYUasS88+1me0zC+JupNCzFmC6SVN10BUJxX1LeK6U/dUR41BwA65XS P2zHHW5gySz9QBkAYfMRQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:IU4fUE6Y81o=:oiCN1TqVZ2a8Z2BGXy9GRK R62ORgAfkEIyHLXprrynxmcYh4c/bjPc9rpdD6YQ7s0KPASQxJzNGt739utispl1oBjFqWUVw TkdgqMXx4vDhhffWghclQH8KqNVhhOc1EdiFm/Arr8k1QxtjFXelHA4IJQwlr9KqLiiSoK1ij 7qryClrQ+9snGR7m41V4pRrBOKl2jUeZHyPe2zs0joXSYZoRoxKla3oxeArBsGOeWGBohQORG IIiuJMDc2HOMrzzGDHJQXYfX9WXFKTG7ikA257j92gYJIH1ZuGJtLlbQNSF1Gqdf0Jo5mYiQp KOGecopeE+f/5BBy5FAa+N02g7P7OZWJuFJ7oNFa2ONhwPbV5oZIRGbsyeEUqerYToiClj+A1 Y/mtJanJuhxL1anUSQ6bpULcGeFTK59+QEg6BxR1ap89SoOg/UrLU7mSOEOG+NUbRzAsh4zRo 7Qhi0LmIdv56N/Wi00RH+kmZYHyrdTNj/zYR0MsxlbgLNsoeB/t9SUX7tj4mjs/WrXegUvH5e DQpL0T8WOppt7pk0qoE9bmp4Hc8+aT2KR/hi0pdlHwSz0bn4b4yuwGCqwHCoIq6ta9IREMlp6 EI8ceFq7u8GLk5ZHwUT48rwGzlMTer8kDI0vGMPgCnYuc2l2bxGOdELMOX3fbqsHs6dgfq41a YouZHxBSk/Sa5w57oLGHBZYaqsilJzrHNfN3Ku6BkyITl4SE1Rd4yQTSlUawU2G6lT8gwD/k5 Rg/whtDaGEfix1wMHSt02+43d8VHQI0tpnDvKvcWJErmkhaJYSZ75rCEennjGLWUxl5VXInph 0fmFQVqt7Di1NQhWvwOOibofPnZk0GdHnk4EvjwzPLF7Zbu13GwV89QKvLTTHiAIFKfqe87il zL6uNyNmq5mXQC1F1TQA== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 2, 2022 at 3:50 AM Miguel Ojeda wrote: > > +# These flags apply to all Rust code in the tree, including the kernel and > +# host programs. > +export rust_common_flags := --edition=2021 \ > + -Zbinary_dep_depinfo=y \ > + -Dunsafe_op_in_unsafe_fn -Drust_2018_idioms \ > + -Dunreachable_pub -Dnon_ascii_idents \ > + -Wmissing_docs \ > + -Drustdoc::missing_crate_level_docs \ > + -Dclippy::correctness -Dclippy::style \ > + -Dclippy::suspicious -Dclippy::complexity \ > + -Dclippy::perf \ > + -Dclippy::let_unit_value -Dclippy::mut_mut \ > + -Dclippy::needless_bitwise_bool \ > + -Dclippy::needless_continue \ > + -Wclippy::dbg_macro Hi Miguel, I tried enabling rust support in the gcc builds I provide at https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/arm64/12.1.0/ to make this more accessible, but it appears that the command line options here are not portable: /home/arnd/cross/x86_64/gcc-12.1.0+rust-nolibc/x86_64-linux/bin/x86_64-linux-gccrs --edition=2021 -Zbinary_dep_depinfo=y -Dunsafe_op_in_unsafe_fn -Drust_2018_idioms -Dunreachable_pub -Dnon_ascii_idents -Wmissing_docs -Drustdoc::missing_crate_level_docs -Dclippy::correctness -Dclippy::style -Dclippy::suspicious -Dclippy::complexity -Dclippy::perf -Dclippy::let_unit_value -Dclippy::mut_mut -Dclippy::needless_bitwise_bool -Dclippy::needless_continue -Wclippy::dbg_macro -O -Cstrip=debuginfo -Zallow-features= --emit=dep-info,link --out-dir=scripts/ /git/arm-soc/scripts/generate_rust_target.rs; mv scripts/generate_rust_target.d scripts/.generate_rust_target.d; sed -i '/^#/d' scripts/.generate_rust_target.d x86_64-linux-gccrs: error: unrecognized command-line option '--edition=2021'; did you mean '-frust-edition=2021'? x86_64-linux-gccrs: error: unrecognized command-line option '-Zbinary_dep_depinfo=y' x86_64-linux-gccrs: error: unrecognized command-line option '-Wmissing_docs'; did you mean '-Wmissing-braces'? x86_64-linux-gccrs: error: unrecognized command-line option '-Wclippy::dbg_macro' x86_64-linux-gccrs: error: unrecognized command-line option '-Cstrip=debuginfo' x86_64-linux-gccrs: error: unrecognized command-line option '-Zallow-features=' x86_64-linux-gccrs: error: unrecognized command-line option '--emit=dep-info,link' x86_64-linux-gccrs: error: unrecognized command-line option '--out-dir=scripts/' make[3]: *** [/git/arm-soc/scripts/Makefile.host:157: scripts/generate_rust_target] Error 1 I guess nobody has tried this so far. Would you think that fixing this is only a matter for fixing the build system to pass the correct flags depending on the compiler, or is this broken in a more fundamental way? Arnd