Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust: samples: fix init argument #335

Open
wants to merge 1 commit into
base: asahi
Choose a base branch
from

Conversation

Bruno-Eduardo
Copy link

I was trying to compile the rust_minimal for arm64 using asahi rust/kernel and found the following error:

$ make CROSS_COMPILE="aarch64-linux-gnu-" ARCH=arm64 LLVM=1 ./samples/rust/rust_minimal.o
  CALL    scripts/checksyscalls.sh
  RUSTC [M] samples/rust/rust_minimal.o
error[E0050]: method `init` has 1 parameter but the declaration in trait `kernel::Module::init` has 2
  --> /largeFiles/linux_asahi/samples/rust/rust_minimal.rs:20:22
   |
20 |     fn init(_module: &'static ThisModule) -> Result<Self> {
   |                      ^^^^^^^^^^^^^^^^^^^ expected 2 parameters, found 1
   |
   = note: `init` from trait: `fn(&'static kernel::prelude::CStr, &'static kernel::ThisModule) -> core::result::Result<Self, kernel::error::Error>`

error: aborting due to 1 previous error

And an equivalent error for ./samples/rust/rust_print.o

After commit c96b547:
rust: Addname argument to Module::init()
init needs a name argument. Since both rust samples were made
before that, they fail to compile.

After fix:

$ make CROSS_COMPILE="aarch64-linux-gnu-" ARCH=arm64 LLVM=1 ./samples/rust/rust_minimal.o
  CALL    scripts/checksyscalls.sh
  RUSTC [M] samples/rust/rust_minimal.o
$ make CROSS_COMPILE="aarch64-linux-gnu-" ARCH=arm64 LLVM=1 ./samples/rust/rust_print.o
  CALL    scripts/checksyscalls.sh
  RUSTC [M] samples/rust/rust_print.o

After commit c96b547:
    rust: Add `name` argument to Module::init()
init needs a name argument. Since both rust samples were made
    before that, they fail to compile.

Signed-off-by: Bruno Oliveira <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant