rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Stanner <pstanner@redhat.com>
To: rust-for-linux@vger.kernel.org
Subject: RfL currently does not integrate very well with some Kconfigs
Date: Thu, 15 Feb 2024 16:21:53 +0100	[thread overview]
Message-ID: <803d666dcd5b1f927590719c10bdd90ce2ba6dd0.camel@redhat.com> (raw)

Recently, I've been trying to accomplish some work on the rust-pci
branch in RfL.

I like to base my configs on an allnoconfig to get only the stuff I
really need.

Doing
make LLVM=1 allnoconfig && make LLVM=1 menuconfig
activating only 64-Bit and Rust already generates build-errors, for
example:

error[E0412]: cannot find type `dma_pool` in crate `bindings`
  --> rust/kernel/dma.rs:74:25
   |
74 |     ptr: *mut bindings::dma_pool,
   |                         ^^^^^^^^ not found in `bindings`

error[E0425]: cannot find function `dma_pool_create` in crate
`bindings`
  --> rust/kernel/dma.rs:92:23
   |
92 |             bindings::dma_pool_create(name.as_char_ptr(),
dev.raw_device(), size, align, boundary)
   |                       ^^^^^^^^^^^^^^^ not found in `bindings`

error[E0425]: cannot find function `dma_pool_alloc` in crate `bindings`
   --> rust/kernel/dma.rs:116:38
    |
116 |         let ptr = unsafe { bindings::dma_pool_alloc(self.ptr,
flags, &mut dma_handle) };
    |                                      ^^^^^^^^^^^^^^ not found in
`bindings`

error[E0412]: cannot find type `dma_pool` in crate `bindings`
   --> rust/kernel/dma.rs:136:42
    |
136 |     type AllocationData = *mut bindings::dma_pool;
    |                                          ^^^^^^^^ not found in
`bindings`



Switching on PCI, but not PCI's MSI, causes other errors, such as:

  RUSTC L rust/uapi.o
  EXPORTS rust/exports_alloc_generated.h
  EXPORTS rust/exports_bindings_generated.h
  RUSTC L rust/kernel.o
error[E0425]: cannot find function `pci_alloc_irq_vectors_affinity` in
crate `bindings`
   --> rust/kernel/pci.rs:289:23
    |
289 |             bindings::pci_alloc_irq_vectors_affinity(
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in
`bindings`

Strong suspect for the cause is that this function is defined as part
of MSI, so just activating PCI doesn't suffice.

I verified that this is indeed a config problem. The entire toolchain
is installed according to the official documentation, selecting that
one compiler version that currently works etc.

Setting PCI + MSI (and, in Hacking, Rust Hacking -> Allow unoptimized
build-time assertations) results in a valid build.


So, it would seem there are some "deponds on" entries missing
somewhere.
Is this problem known? Any plans or suggestions how to deal with it?

My instinct tells me that there could be many potentially broken
configs out there.


Regards,
P.


             reply	other threads:[~2024-02-15 15:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 15:21 Philipp Stanner [this message]
2024-02-15 16:22 ` RfL currently does not integrate very well with some Kconfigs Miguel Ojeda
2024-02-15 17:29   ` Andreas Hindborg (Samsung)
2024-02-16 19:25 ` Andreas Hindborg (Samsung)

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=803d666dcd5b1f927590719c10bdd90ce2ba6dd0.camel@redhat.com \
    --to=pstanner@redhat.com \
    --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).