Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp4972221rwb; Wed, 17 Aug 2022 08:55:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR4xGo1cI5CK+jhzvG6mCSPH7TlF1YDRtoOJGiI8IRYwqKHj9jubbuKkfYeIqnmWmAUamLCM X-Received: by 2002:a17:907:6d16:b0:731:17b5:699 with SMTP id sa22-20020a1709076d1600b0073117b50699mr18320105ejc.23.1660751700010; Wed, 17 Aug 2022 08:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660751700; cv=none; d=google.com; s=arc-20160816; b=Sxb82RcuJ6NEEcOyP7eYtV2u11WG7D69aDIN1yUN2XB5Ld2eAhJ6KOSeB6YFJvSooc WkGW/pey6VEHu33nm8EIOeul/LyN++STF2/3uthl/++/uQvjI+kfLx4L6xg7/d3LxU95 3dkTVjRTvCeONKIedr04wxIEO5fbry7iP/lNpJMVrGwoll3pzS/jmWBdXwB6MO4jHg3k AGElaSld/hz9EAiDl6JHiCWwxIVMsF4KnGSZ4suZjWJ1G5jsR3P8q+Lcxy7IVBA6TBmw SHlPsOUg9oEPz5Jr6mWtU1dMwtaPNI/opj13zHmFSTIqY/LLeh81a8nLPgr7nbyp9m7e b6Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=mVW3S128TP65leXbu/hB4hu2J5mg3T8+IAUSuB0Ip2Q=; b=0lZ8GCidL24aQ5oWsnJ3WkazlaQSVvJT9IBBvqCo0APWk7apy5kj3ylBunUnP28NjU lRmV7jmdpFEcnBNT99kJHm/bMITwjEBvvoyKLGR4tXrlS5+HuN8ef4tAE0bS0fphmWuk cZwBvw6q0xuFMCCFq0D96V5jbjppKJfvgwbjOhBMwDgKjqvDTT3jyUjjMR2b1YhEcVey GU8rjKsvDyLswmrgx1nfvzu313QYXi2edjfQ4HxRmUcd4PFzjP3NrqYPyQN67xTVMdSV U4cEITlhOAzHDZecp0kvmrepVFfU2yBSxSl+GdNijxE13qlTRtT1mZetcF5dx7Oh3+8V l6kQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b8-20020a056402278800b0043dd6d38021si13773641ede.243.2022.08.17.08.54.34; Wed, 17 Aug 2022 08:54:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240342AbiHQPlk (ORCPT + 99 others); Wed, 17 Aug 2022 11:41:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237920AbiHQPli (ORCPT ); Wed, 17 Aug 2022 11:41:38 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9C9D93524; Wed, 17 Aug 2022 08:41:36 -0700 (PDT) Received: from mail-ej1-f52.google.com ([209.85.218.52]) by mrelayeu.kundenserver.de (mreue106 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MF418-1o8z5i3rIW-00FQkz; Wed, 17 Aug 2022 17:41:34 +0200 Received: by mail-ej1-f52.google.com with SMTP id qn6so25179890ejc.11; Wed, 17 Aug 2022 08:41:34 -0700 (PDT) X-Gm-Message-State: ACgBeo1Rgp6LovAz0JAkiWVLzs+8zSZO/OQDR9sB7wiFQaeCs/bqe8Mk TwgH0h2L6YkNgkAE6nbMBOmI9f2tvbgX4INyi1k= X-Received: by 2002:a05:6402:520e:b0:43d:df14:fbed with SMTP id s14-20020a056402520e00b0043ddf14fbedmr23980070edd.16.1660749886667; Wed, 17 Aug 2022 08:24:46 -0700 (PDT) MIME-Version: 1.0 References: <20220802015052.10452-1-ojeda@kernel.org> <20220802015052.10452-28-ojeda@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Wed, 17 Aug 2022 17:24:30 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 27/31] Kbuild: add Rust support To: Miguel Ojeda Cc: Arnd Bergmann , Miguel Ojeda , 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, Philip Herron , Arthur Cohen Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:eXbnbKGaDunZKIWkmyxhB8JjF42zkxbqO9DQpNxilCxkOdDGvEC IOo0sFmv3vXHvATdT3zHtfXTdV/h7zmvQF+I4NwGfJruHC6KiDLGiQ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Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 17, 2022 at 5:13 PM Miguel Ojeda wrote: > On Wed, Aug 17, 2022 at 4:40 PM Arnd Bergmann wrote: > > > > 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/ > > Thanks for giving it a go! > > > 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 > > So you mean with GCC Rust, right? (i.e. we have "GCC builds" working, > via compiling the Rust side with LLVM and linking with the GCC C side, > but it is not intended for production or to be supported, even if we > cover it in our CI, test it boots and loads modules etc.). Yes, I meant GCC rust, with the contents of https://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/heads/devel/rust/master merged into the gcc-12.1.0 release tag. > > 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? > > If you meant GCC Rust, then it is a bit too early for the compiler. As > far as I now, they are working on compiling the `core` crate and > supporting more stable language features. They are also researching > the integration of the borrow checker, though we wouldn't need that > for "only" compiling the kernel. > > Now, if they decided to focus on supporting Rust for Linux early on > (which would be great), they would still need to work on the delta > between what what they target now and what we use (which includes both > stable and some unstable features), plus I assume infrastructure bits > like the platform (target spec) support, the flags / `rustc` driver > (though I would be happy to do as much as possible on our side to > help), etc. > > (We privately talked about possible timelines for all that if they > were to focus on Rust for Linux etc., but I let them comment or not on > that... Cc'ing them! :) Thanks for the explanation. My hope was that building the kernel would actually be easier here than building the more complicated rust user space. The gcc cross-compilers on kernel.org are similarly easy to build for all architectures the kernel supports because the complexity is usually in picking a working libc for the more obscure architectures, so I was naively thinking that this would work for building the rust support across all architectures in Linux. I tried one more step and just removed the unsupported command line flags to see what would happen, but that did not get me any further: /home/arnd/cross/x86_64/gcc-12.1.0+rust-nolibc/x86_64-linux/bin/x86_64-linux-gccrs -frust-edition=2021 -Dunsafe_op_in_unsafe_fn -Drust_2018_idioms -Dunreachable_pub -Dnon_ascii_idents -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 -O /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 rust1: internal compiler error: Segmentation fault 0x7f37ee04b51f ??? ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 0x7f37ee032fcf __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 0x7f37ee03307c __libc_start_main_impl ../csu/libc-start.c:409 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. Arnd