[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a0jqhGY9E85VC9gNem5q6-dWeq0H6-7bhJopinMnLtOKQ@mail.gmail.com>
Date: Wed, 17 Aug 2022 16:39:57 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Miguel Ojeda <ojeda@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sven Van Asbroeck <thesven73@...il.com>,
Catalin Marinas <catalin.marinas@....com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Miguel Cano <macanroj@...il.com>,
Paul Mackerras <paulus@...ba.org>, Gary Guo <gary@...yguo.net>,
Douglas Su <d0u9.su@...look.com>,
Borislav Petkov <bp@...en8.de>,
linux-riscv@...ts.infradead.org, Will Deacon <will@...nel.org>,
Martin Rodriguez Reboredo <yakoyoku@...il.com>,
Anton Ivanov <anton.ivanov@...bridgegreys.com>,
"H. Peter Anvin" <hpa@...or.com>,
Masahiro Yamada <masahiroy@...nel.org>, x86@...nel.org,
Russell King <linux@...linux.org.uk>,
Ingo Molnar <mingo@...hat.com>,
Wedson Almeida Filho <wedsonaf@...gle.com>,
Alex Gaynor <alex.gaynor@...il.com>,
Antonio Terceiro <antonio.terceiro@...aro.org>,
Adam Bratschi-Kaye <ark.email@...il.com>,
Albert Ou <aou@...s.berkeley.edu>,
rust-for-linux@...r.kernel.org, linux-kbuild@...r.kernel.org,
Boqun Feng <boqun.feng@...il.com>,
linux-um@...ts.infradead.org,
BjÃB 6rn Roy Baron <bjorn3_gh@...tonmail.com>,
Michal Marek <michal.lkml@...kovi.net>,
Daniel Xu <dxu@...uu.xyz>, David Gow <davidgow@...gle.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Dariusz Sosnowski <dsosnowski@...snowski.pl>,
linux-arm-kernel@...ts.infradead.org,
Tiago Lam <tiagolam@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Nick Desaulniers <ndesaulniers@...gle.com>,
linux-kernel@...r.kernel.org,
Boris-Chengbiao Zhou <bobo1239@....de>,
Jarkko Sakkinen <jarkko@...nel.org>,
Palmer Dabbelt <palmer@...belt.com>,
Richard Weinberger <richard@....at>,
Finn Behrens <me@...enk.de>,
Johannes Berg <johannes@...solutions.net>,
linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v8 27/31] Kbuild: add Rust support
On Tue, Aug 2, 2022 at 3:50 AM Miguel Ojeda <ojeda@...nel.org> 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
Powered by blists - more mailing lists