Re: [PATCH] nios2: ksyms: Declare __mulsi3 export
From: David Laight
Date: Tue Oct 20 2026 - 05:48:42 EST
On Mon, 19 Oct 2026 09:34:42 -0500
Dinh Nguyen <dinguyen@xxxxxxxxxx> wrote:
> On 10/19/26 06:16, Arnd Bergmann wrote:
> > On Mon, Oct 19, 2026, at 11:49, Thomas Weißschuh wrote:
> >> GCC may emit libcalls to __mulsi3(). As modpost is not aware that this
> >> function is provided through the linked in libgcc, it fails:
> >>
> >> ERROR: modpost: kernel/locking/test-ww_mutex.ko: symbol '__mulsi3' undefined!
> >> ERROR: modpost: kernel/time/test_udelay.ko: symbol '__mulsi3' undefined!
> >> ERROR: modpost: kernel/resource_kunit.ko: symbol '__mulsi3' undefined!
> >> ERROR: modpost: fs/fuse/virtiofs.ko: symbol '__mulsi3' undefined!
> >> etc.
> >>
> >> Make sure modpost can see the symbol from libgcc.
> >>
> >> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> >> Closes:
> >> https://lore.kernel.org/oe-kbuild-all/202610171933.J4bFOfL8-lkp@xxxxxxxxx/
> >> Fixes: 2fc8483fdcde ("nios2: Build infrastructure")
> >> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
> >
> > Acked-by: Arnd Bergmann <arnd@xxxxxxxx>
> >
> > The patch looks correct to me, but it would also be nice to not use
> > libgcc at all. What I see is that only arc, nios2, openrisc and
> > parisc still link against the toolchain-provided libgcc, everything
> > else uses the kernel's own runtime.
> >
> > It's probably not even that hard to do right, here is what I found
> > is imported from libgcc.
> >
> Patch applied!
>
> Thanks for the suggestion Arnd, I'll work to on the NIOS2.
Does the kernel support nios2 that don't have the optional multiply
instructions? (including the ones that generate the high 32 bits).
If the compiler knows they exist (it isn't the default) then it should
just use them.
The fpga almost certainly have plenty of 18x18 DSP multiplier blocks
than can be used - so the resources are there.
(The slow part of the multiply is actually the ripple adder that
generates the high 46 bits.)
David
>
> Dinh
>