linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: ojeda@kernel.org, alex.gaynor@gmail.com,
	rust-for-linux@vger.kernel.org,
	kernel list <linux-kernel@vger.kernel.org>
Subject: Getting Rust to work
Date: Sun, 21 Mar 2021 20:37:05 +0100	[thread overview]
Message-ID: <20210321193705.GA13699@duo.ucw.cz> (raw)

[-- Attachment #1: Type: text/plain, Size: 2735 bytes --]

Hi!

First try was on x86-32. It took me a whlie to figure out the problem,
hence the diff below.

Next I was not sure what to do with rustup. I'm not sure if advice
below is good.

Then I got failure because libclang (?) was not installed. I installed
it. But I guess that should be mentioned in docs as dependency.

With CONFIG_RUST unset, kernel builds for me. With CONFIG_RUST=y +
RUST_EXAMPLE=y... I get errors:

  RUSTC L rust/core.o
  BINDGEN rust/bindings_generated.rs
error: unknown argument: '-fmacro-prefix-map=./='
error: unknown warning option '-Wno-frame-address'; did you mean '-Wno-address'? [-Wunknown-warning-option]
./arch/x86/include/asm/bitops.h:138:9: error: 'asm goto' constructs are not supported yet
./arch/x86/include/asm/bitops.h:162:9: error: 'asm goto' constructs are not supported yet
./arch/x86/include/asm/bitops.h:201:9: error: 'asm goto' constructs are not supported yet
./include/linux/list.h:282:9: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
./include/linux/list.h:318:27: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
./include/linux/list.h:821:10: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
./include/linux/list.h:830:10: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
./arch/x86/include/asm/atomic.h:83:9: error: 'asm goto' constructs are not supported yet
./arch/x86/include/asm/atomic.h:123:9: error: 'asm goto' constructs are not supported yet
./arch/x86/include/asm/atomic.h:137:9: error: 'asm goto' constructs are not supported yet
./arch/x86/include/asm/atomic.h:152:9: error: 'asm goto' constructs are not supported yet

$ gcc --version
gcc (Debian 8.3.0-6) 8.3.0
$ rustc --version
rustc 1.52.0-nightly (61edfd591 2021-03-20)

Ideas?

Best regards,
								Pavel



diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-start.rst
index 33b5cd33ecc5..d034369b3d43 100644
--- a/Documentation/rust/quick-start.rst
+++ b/Documentation/rust/quick-start.rst
@@ -16,6 +16,8 @@ Some of these requirements might be available from your Linux distribution
 under names like ``rustc``, ``rust-src``, ``rust-bindgen``, etc. However,
 at the time of writing, they are likely to not be recent enough.
 
+You need to have x86-64 or arm64 system.
+
 
 rustc
 *****
@@ -32,6 +34,8 @@ Otherwise, fetch a standalone installer or install ``rustup`` from:
 
     https://www.rust-lang.org
 
+    (if you have multiple toolchains, do rustup default nightly-i686-unknown-linux-gnu )
+
 
 Rust standard library source
 ****************************

-- 
http://www.livejournal.com/~pavelmachek

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

             reply	other threads:[~2021-03-21 19:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-21 19:37 Pavel Machek [this message]
2021-03-21 20:03 ` Getting Rust to work Miguel Ojeda
2021-03-21 20:56   ` Pavel Machek
2021-03-21 21:26     ` Miguel Ojeda
2021-03-21 21:58     ` Miguel Ojeda
2021-03-21 22:05       ` Miguel Ojeda
2021-03-22  2:34   ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210321193705.GA13699@duo.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=alex.gaynor@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).