[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240902190226.GL23170@kernel.org>
Date: Mon, 2 Sep 2024 20:02:26 +0100
From: Simon Horman <horms@...nel.org>
To: Breno Leitao <leitao@...ian.org>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
leit@...a.com, kernel test robot <lkp@...el.com>,
Johannes Berg <johannes.berg@...el.com>,
Jamie Bainbridge <jamie.bainbridge@...il.com>,
"open list:NETWORKING [GENERAL]" <netdev@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net] net: dqs: Do not use extern for unused dql_group
On Mon, Sep 02, 2024 at 03:17:30AM -0700, Breno Leitao wrote:
> When CONFIG_DQL is not enabled, dql_group should be treated as a dead
> declaration. However, its current extern declaration assumes the linker
> will ignore it, which is generally true across most compiler and
> architecture combinations.
>
> But in certain cases, the linker still attempts to resolve the extern
> struct, even when the associated code is dead, resulting in a linking
> error. For instance the following error in loongarch64:
>
> >> loongarch64-linux-ld: net-sysfs.c:(.text+0x589c): undefined reference to `dql_group'
>
> Modify the declaration of the dead object to be an empty declaration
> instead of an extern. This change will prevent the linker from
> attempting to resolve an undefined reference.
>
> Reported-by: kernel test robot <lkp@...el.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202409012047.eCaOdfQJ-lkp@intel.com/
> Fixes: 74293ea1c4db ("net: sysfs: Do not create sysfs for non BQL device")
> Signed-off-by: Breno Leitao <leitao@...ian.org>
Thanks,
I see this with gcc-13.2.0 but, curiously, not 14.2.0.
Reviewed-by: Simon Horman <horms@...nel.org>
Tested-by: Simon Horman <horms@...nel.org> # build-tested
Powered by blists - more mailing lists