[PATCH 2/4] ARC: math emul: use existing lib versions of libgcc routines
From: Vineet Gupta
Date: Thu Nov 19 2026 - 01:00:28 EST
Use the existing lib/ emulation.
Divide/modulo need some mention: technically emulation is only needed
for hardware lacking the insns (ARCompact ISA or ARCv2 ISA based cores
configured w/o divider and/or those insns disabled in the
build (-mno-div-rem). But to be future-proof (thinking modules)
just add them unconditionally.
Suggested-by: Arnd Bergmann <arnd@xxxxxxxx>
Signed-off-by: Vineet Gupta <vgupta@xxxxxxxxxx>
---
arch/arc/Kconfig | 10 ++++++++++
arch/arc/kernel/arcksyms.c | 23 -----------------------
2 files changed, 10 insertions(+), 23 deletions(-)
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 80e61175bf52..9bf747882f2a 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -25,6 +25,16 @@ config ARC
select GENERIC_ATOMIC64 if !ISA_ARCV2 || !(ARC_HAS_LL64 && ARC_HAS_LLSC)
# for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
select GENERIC_IRQ_SHOW
+ select GENERIC_LIB_ASHLDI3
+ select GENERIC_LIB_ASHRDI3
+ select GENERIC_LIB_LSHRDI3
+ select GENERIC_LIB_MULDI3
+ select GENERIC_LIB_CMPDI2
+ select GENERIC_LIB_UCMPDI2
+ select GENERIC_LIB_MODSI3
+ select GENERIC_LIB_UMODSI3
+ select GENERIC_LIB_DIVSI3
+ select GENERIC_LIB_UDIVSI3
select GENERIC_PCI_IOMAP
select GENERIC_SCHED_CLOCK
select GENERIC_SMP_IDLE_THREAD
diff --git a/arch/arc/kernel/arcksyms.c b/arch/arc/kernel/arcksyms.c
index c22055e66cfe..bba133fdd1b6 100644
--- a/arch/arc/kernel/arcksyms.c
+++ b/arch/arc/kernel/arcksyms.c
@@ -7,29 +7,6 @@
#include <linux/module.h>
-/* libgcc functions, not part of kernel sources */
-extern void __ashldi3(void);
-extern void __ashrdi3(void);
-extern void __divsi3(void);
-extern void __lshrdi3(void);
-extern void __modsi3(void);
-extern void __muldi3(void);
-extern void __ucmpdi2(void);
-extern void __udivsi3(void);
-extern void __umodsi3(void);
-extern void __cmpdi2(void);
-
-EXPORT_SYMBOL(__ashldi3);
-EXPORT_SYMBOL(__ashrdi3);
-EXPORT_SYMBOL(__divsi3);
-EXPORT_SYMBOL(__lshrdi3);
-EXPORT_SYMBOL(__modsi3);
-EXPORT_SYMBOL(__muldi3);
-EXPORT_SYMBOL(__ucmpdi2);
-EXPORT_SYMBOL(__udivsi3);
-EXPORT_SYMBOL(__umodsi3);
-EXPORT_SYMBOL(__cmpdi2);
-
/* ARC optimised assembler routines */
EXPORT_SYMBOL(memset);
EXPORT_SYMBOL(memcpy);
--
2.53.0