From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C696320380; Tue, 23 Sep 2025 12:55:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758632119; cv=none; b=l7vej3Z5agljAPn/ud4JGTZhKnBc65EIF0xfTb3d7qCCEtNErwcUNdxBqWfVnkXA//XlrYyUGYebAwuYLsUpN7zUCHjeEMwdow07b5/jsItc40dgdCA16fRIKRX3rdVqjr/kD1DcmbvM3p++E/M98v9Qi/pl48byWGWxMebVF8U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758632119; c=relaxed/simple; bh=ME3qBbegNDpQuw1mbSTRNM6utlqztErhmAOvHV8ivf0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PF2xO5hPsSA/q9BjrceaLRgW+LHzyxyMBC/SaJSqcjNdl4gsoAHsaqcd3LHXi73Jh/FGEif6+PtivPccG0MJNJ/dtbWI0O7M2SvSAigz5+WmlmPBFL+uMCVa1YlVLCJ4CjhaK7wQsTg33pCS2G5QzfE5r46Ox+fqOnkTBhroMFQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FW2I1bxo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="FW2I1bxo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62632C113CF; Tue, 23 Sep 2025 12:55:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758632119; bh=ME3qBbegNDpQuw1mbSTRNM6utlqztErhmAOvHV8ivf0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FW2I1bxo+4X+7TyFN3n0zWaVEr5KpqFYnZdAVnJVaXmixF0PbegK7/OoEkC9/Fv3P Ei6xWxPLAfNvdCnvdNUDo5SRgWqnfMlMajX9kCS+zVLwZbolM3JbcR8ygl8zdIkFVQ w4tLxJDaJQkkJTnv6CUGPiv6FctfuBn6RaAhokv4= Date: Tue, 23 Sep 2025 14:41:03 +0200 From: Greg Kroah-Hartman To: Daniel Almeida Cc: Alice Ryhl , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH 0/2] rust: usb: add initial USB abstractions Message-ID: <2025092333-happening-eggnog-66ce@gregkh> References: <20250825-b4-usb-v1-0-7aa024de7ae8@collabora.com> <2025092338-elbow-dash-373d@gregkh> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Sep 23, 2025 at 02:34:27PM +0200, Daniel Almeida wrote: > […] > > >> > >> 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:(::inc_ref) in archive vmlinux.a > >>>>> referenced by kernel.1a949e63ee2acc6a-cgu.0 > >>>>> rust/kernel.o:( as core::convert::From<&kernel::usb::Interface>>::from) in archive vmlinux.a > >> > >> ld.lld: error: undefined symbol: usb_put_intf > >>>>> referenced by kernel.1a949e63ee2acc6a-cgu.0 > >>>>> rust/kernel.o:(::dec_ref) in archive vmlinux.a > >> > >> ld.lld: error: undefined symbol: usb_get_dev > >>>>> referenced by kernel.1a949e63ee2acc6a-cgu.0 > >>>>> rust/kernel.o:(::inc_ref) in archive vmlinux.a > >>>>> referenced by kernel.1a949e63ee2acc6a-cgu.0 > >>>>> rust/kernel.o:( as core::convert::From<&kernel::usb::Device>>::from) in archive vmlinux.a > >> > >> ld.lld: error: undefined symbol: usb_put_dev > >>>>> referenced by kernel.1a949e63ee2acc6a-cgu.0 > >>>>> rust/kernel.o:(::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? It passes if CONFIG_USB=y, but it is good to keep the USB subsystem as a module if at all possible :) thanks, greg k-h