Re: [PATCH] nios2: ksyms: Declare __mulsi3 export

From: Vineet Gupta

Date: Sat Oct 31 2026 - 20:27:02 EST


On 10/31/26 16:57, Vineet Gupta wrote:
* no generic implementation in kernel, need to copy from
libgcc/lib1funcs.S code:

=== __divsi3 ===
arch/arc/kernel/arcksyms.c
arch/nios2/kernel/nios2_ksyms.c
arch/openrisc/kernel/or32_ksyms.c
-> arch/arm/lib/lib1funcs.S
arch/m68k/lib/divsi3.S
arch/microblaze/lib/divsi3.S
arch/xtensa/lib/divsi3.S
=== __modsi3 ===
arch/arc/kernel/arcksyms.c
arch/nios2/kernel/nios2_ksyms.c
arch/openrisc/kernel/or32_ksyms.c
-> arch/m68k/lib/modsi3.S
arch/microblaze/lib/modsi3.S
arch/xtensa/lib/modsi3.S
=== __udivsi3 ===
arch/arc/kernel/arcksyms.c
arch/nios2/kernel/nios2_ksyms.c
arch/openrisc/kernel/or32_ksyms.c
-> arch/arm/lib/lib1funcs.S
arch/m68k/lib/udivsi3.S
arch/microblaze/lib/udivsi3.S
arch/sh/lib/udivsi3.S
arch/xtensa/lib/udivsi3.S
=== __umodsi3 ===
arch/arc/kernel/arcksyms.c
arch/nios2/kernel/nios2_ksyms.c
arch/openrisc/kernel/or32_ksyms.c
-> arch/arm/lib/lib1funcs.S
arch/m68k/lib/umodsi3.S
arch/microblaze/lib/umodsi3.S
arch/xtensa/lib/umodsi3.S
ARCv2 has hardware divide so these are not needed, but ARC700 doesn't
and there's a ton of calls for those.

┌───────────┬───────┬───────────┐
│  routine  │ calls │ functions │
├───────────┼───────┼───────────┤
│ __udivsi3 │ 415   │ 238       │
├───────────┼───────┼───────────┤
│ __umodsi3 │ 203   │ 131       │
├───────────┼───────┼───────────┤
│ __divsi3  │ 77    │ 57        │
├───────────┼───────┼───────────┤
│ __modsi3  │ 41    │ 33        │
└───────────┴───────┴───────────┘

I can take a stab at providing the generic libgcc implementation in
lib/* but I only expect the arches using libgcc version to switch.

It seems there 4 are always needed together or not at all.
Do we want 4 Kconfig gates or just one will suffice ?

Thx,
-Vineet