[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <B4D07104-0A10-4B04-88CC-3F138A783811@collabora.com>
Date: Tue, 23 Sep 2025 14:34:27 +0200
From: Daniel Almeida <daniel.almeida@...labora.com>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>,
Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>,
linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org,
linux-usb@...r.kernel.org
Subject: Re: [PATCH 0/2] rust: usb: add initial USB abstractions
[…]
>>
>> I tried to apply these, but I get the following build error when adding
>> to the char-misc-testing tree:
>>
>> ld.lld: error: undefined symbol: usb_get_intf
>>>>> referenced by kernel.1a949e63ee2acc6a-cgu.0
>>>>> rust/kernel.o:(<kernel::usb::Interface as kernel::sync::aref::AlwaysRefCounted>::inc_ref) in archive vmlinux.a
>>>>> referenced by kernel.1a949e63ee2acc6a-cgu.0
>>>>> rust/kernel.o:(<kernel::sync::aref::ARef<kernel::usb::Interface> as core::convert::From<&kernel::usb::Interface<kernel::device::CoreInternal>>>::from) in archive vmlinux.a
>>
>> ld.lld: error: undefined symbol: usb_put_intf
>>>>> referenced by kernel.1a949e63ee2acc6a-cgu.0
>>>>> rust/kernel.o:(<kernel::usb::Interface as kernel::sync::aref::AlwaysRefCounted>::dec_ref) in archive vmlinux.a
>>
>> ld.lld: error: undefined symbol: usb_get_dev
>>>>> referenced by kernel.1a949e63ee2acc6a-cgu.0
>>>>> rust/kernel.o:(<kernel::usb::Device as kernel::sync::aref::AlwaysRefCounted>::inc_ref) in archive vmlinux.a
>>>>> referenced by kernel.1a949e63ee2acc6a-cgu.0
>>>>> rust/kernel.o:(<kernel::sync::aref::ARef<kernel::usb::Device> as core::convert::From<&kernel::usb::Device<kernel::device::CoreInternal>>>::from) in archive vmlinux.a
>>
>> ld.lld: error: undefined symbol: usb_put_dev
>>>>> referenced by kernel.1a949e63ee2acc6a-cgu.0
>>>>> rust/kernel.o:(<kernel::usb::Device as kernel::sync::aref::AlwaysRefCounted>::dec_ref) in archive vmlinux.a
>>
>>
>> Any hints?
>
> Did you enable CONFIG_USB?
>
> Alice
+#[cfg(CONFIG_USB)]
+pub mod usb;
Hmm, but the USB module is gated by #[cfg(CONFIG_USB) in lib.rs, so not having
CONFIG_USB enabled should not return any errors and instead skip the USB
bindings completely.
I wonder if this has to be CONFIG_USB=y?
— Daniel
Powered by blists - more mailing lists