lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <680bd06f-6a76-4a5c-b5d2-51dd172c8428@lunn.ch>
Date: Tue, 5 Nov 2024 01:37:12 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Alistair Francis <alistair23@...il.com>
Cc: linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	linux@...linux.org.uk, hkallweit1@...il.com,
	Alistair Francis <alistair.francis@....com>
Subject: Re: [PATCH] include: mdio: Guard inline function with CONFIG_MDIO

On Tue, Nov 05, 2024 at 10:21:15AM +1000, Alistair Francis wrote:
> On Mon, Nov 4, 2024 at 11:49 PM Andrew Lunn <andrew@...n.ch> wrote:
> >
> > On Mon, Nov 04, 2024 at 05:09:50PM +1000, Alistair Francis wrote:
> > > The static inline functions mdio45_ethtool_gset() and
> > > mdio45_ethtool_ksettings_get() call mdio45_ethtool_gset_npage() and
> > > mdio45_ethtool_ksettings_get_npage() which are both guarded by
> > > CONFIG_MDIO. So let's only expose mdio45_ethtool_gset() and
> > > mdio45_ethtool_ksettings_get() if CONFIG_MDIO is defined.
> >
> > Why? Are you fixing a linker error? A compiler error?
> 
> I'm investigating generating Rust bindings for static inline functions
> (like mdio45_ethtool_gset() for example). But it fails to build when
> there are functions defined in header files that call C functions that
> aren't built due to Kconfig options.

Since this does not appear to be an issue for C, i assume these
functions are not actually used in that configuration. And this is
probably not an issue specific to MDIO. It will probably appear all
over the kernel. Adding lots of #ifdef in header files will probably
not be liked.

Does Rust have the concept of inline functions? If it is never used,
it never gets compiled? Or at least, it gets optimised out before it
gets linked, which i think is your issue here.

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ