Skip to contentSkip to conversation

openrisc: stop using libgcc

PATCH In review Arnd Bergmann 3 participants 3 messages Nov 18 – Nov 19 Openrisc architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 openrisc: stop using libgcc

From: Arnd Bergmann <[email protected]>

Based on the work for nios2 and arc, remove the inclusion of libgcc and instead use the kernel's own copy of the required functions.

Cc Jonas Bonn <[email protected]>
Cc Stefan Kristiansson <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Simon Schuster <[email protected]>
Cc Vineet Gupta <[email protected]>

---
Hi Stafford,

I've based this on top of the branch at
https://lore.kernel.org/all/[email protected]/
which I've merged into the asm-generic tree. Vineet already has a similar patch for arch/arc, and I did the one for arch/openrisc after seeing that everything is there.

If this looks ok to you, please Ack so I can merge it in the asm-generic tree as well.

Arnd

 arch/openrisc/Kconfig             | 10 ++++++++++
 arch/openrisc/Makefile            |  3 ---
 arch/openrisc/kernel/or32_ksyms.c | 14 --------------
 3 files changed, 10 insertions(+), 17 deletions(-)
arch/openrisc/Kconfig +10 -0
index 6aaedc67a5e0..5be29befd86c 100644
@@ -22,6 +22,16 @@ config OPENRISC
 	select GENERIC_IRQ_CHIP
 	select GENERIC_IRQ_PROBE
 	select GENERIC_IRQ_SHOW
+	select GENERIC_LIB_LSHRDI3
+	select GENERIC_LIB_ASHLDI3
+	select GENERIC_LIB_ASHRDI3
+	select GENERIC_LIB_MULDI3
+	select GENERIC_LIB_UCMPDI2
+	select GENERIC_LIB_DIVSI3
+	select GENERIC_LIB_MODSI3
+	select GENERIC_LIB_UDIVSI3
+	select GENERIC_LIB_UMODSI3
+	select GENERIC_LIB_MULSI3
 	select GENERIC_PCI_IOMAP
 	select GENERIC_IOREMAP
 	select GENERIC_CPU_DEVICES
arch/openrisc/Makefile +0 -3
index 68249521db5a..38dc87bc6a3a 100644
@@ -18,7 +18,6 @@
 KBUILD_DEFCONFIG := or1ksim_defconfig
 
 OBJCOPYFLAGS    := -O binary -R .note -R .comment -S
-LIBGCC 		:= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
 
 KBUILD_CFLAGS	+= -pipe -ffixed-r10 -D__linux__
 KBUILD_CFLAGS	+= -msfimm -mshftimm
@@ -55,8 +54,6 @@ ifeq ($(CONFIG_OPENRISC_HAVE_INST_SEXT),y)
 	KBUILD_CFLAGS += $(call cc-option,-msext)
 endif
 
-libs-y		+= $(LIBGCC)
-
 PHONY += vmlinux.bin
 
 vmlinux.bin: vmlinux
arch/openrisc/kernel/or32_ksyms.c +0 -14
index 5aabef30ca09..7ae38030a9d4 100644
@@ -27,20 +27,6 @@
 #include <asm/hardirq.h>
 #include <asm/delay.h>
 
-#define DECLARE_EXPORT(name) extern void name(void); EXPORT_SYMBOL(name)
-
-/* compiler generated symbols */
-DECLARE_EXPORT(__udivsi3);
-DECLARE_EXPORT(__divsi3);
-DECLARE_EXPORT(__umodsi3);
-DECLARE_EXPORT(__modsi3);
-DECLARE_EXPORT(__muldi3);
-DECLARE_EXPORT(__mulsi3);
-DECLARE_EXPORT(__ashrdi3);
-DECLARE_EXPORT(__ashldi3);
-DECLARE_EXPORT(__lshrdi3);
-DECLARE_EXPORT(__ucmpdi2);
-
 EXPORT_SYMBOL(__copy_tofrom_user);
 EXPORT_SYMBOL(__clear_user);
 EXPORT_SYMBOL(memset);
Signature · 1 line
2.53.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Based on the work for nios2 and arc, remove the inclusion of libgcc and instead use the kernel's own copy of the required functions.

Quoted 8 lines
Cc Jonas Bonn <[email protected]>
Cc Stefan Kristiansson <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Simon Schuster <[email protected]>
Cc Vineet Gupta <[email protected]>
Quoted 11 lines

---
Hi Stafford,

I've based this on top of the branch at
https://lore.kernel.org/all/[email protected]/
which I've merged into the asm-generic tree. Vineet already has a similar patch for arch/arc, and I did the one for arch/openrisc after seeing that everything is there.

If this looks ok to you, please Ack so I can merge it in the asm-generic tree as well.

Thanks,

This all looks good to me. Acked above.

-Stafford

Quoted 76 lines
 arch/openrisc/Kconfig             | 10 ++++++++++
 arch/openrisc/Makefile            |  3 ---
 arch/openrisc/kernel/or32_ksyms.c | 14 --------------
 3 files changed, 10 insertions(+), 17 deletions(-)
arch/openrisc/Kconfig +10 -0
index 6aaedc67a5e0..5be29befd86c 100644
@@ -22,6 +22,16 @@ config OPENRISC
 	select GENERIC_IRQ_CHIP
 	select GENERIC_IRQ_PROBE
 	select GENERIC_IRQ_SHOW
+	select GENERIC_LIB_LSHRDI3
+	select GENERIC_LIB_ASHLDI3
+	select GENERIC_LIB_ASHRDI3
+	select GENERIC_LIB_MULDI3
+	select GENERIC_LIB_UCMPDI2
+	select GENERIC_LIB_DIVSI3
+	select GENERIC_LIB_MODSI3
+	select GENERIC_LIB_UDIVSI3
+	select GENERIC_LIB_UMODSI3
+	select GENERIC_LIB_MULSI3
 	select GENERIC_PCI_IOMAP
 	select GENERIC_IOREMAP
 	select GENERIC_CPU_DEVICES
arch/openrisc/Makefile +0 -3
index 68249521db5a..38dc87bc6a3a 100644
@@ -18,7 +18,6 @@
 KBUILD_DEFCONFIG := or1ksim_defconfig
 
 OBJCOPYFLAGS    := -O binary -R .note -R .comment -S
-LIBGCC 		:= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
 
 KBUILD_CFLAGS	+= -pipe -ffixed-r10 -D__linux__
 KBUILD_CFLAGS	+= -msfimm -mshftimm
@@ -55,8 +54,6 @@ ifeq ($(CONFIG_OPENRISC_HAVE_INST_SEXT),y)
 	KBUILD_CFLAGS += $(call cc-option,-msext)
 endif
 
-libs-y		+= $(LIBGCC)
-
 PHONY += vmlinux.bin
 
 vmlinux.bin: vmlinux
arch/openrisc/kernel/or32_ksyms.c +0 -14
index 5aabef30ca09..7ae38030a9d4 100644
@@ -27,20 +27,6 @@
 #include <asm/hardirq.h>
 #include <asm/delay.h>
 
-#define DECLARE_EXPORT(name) extern void name(void); EXPORT_SYMBOL(name)
-
-/* compiler generated symbols */
-DECLARE_EXPORT(__udivsi3);
-DECLARE_EXPORT(__divsi3);
-DECLARE_EXPORT(__umodsi3);
-DECLARE_EXPORT(__modsi3);
-DECLARE_EXPORT(__muldi3);
-DECLARE_EXPORT(__mulsi3);
-DECLARE_EXPORT(__ashrdi3);
-DECLARE_EXPORT(__ashldi3);
-DECLARE_EXPORT(__lshrdi3);
-DECLARE_EXPORT(__ucmpdi2);
-
 EXPORT_SYMBOL(__copy_tofrom_user);
 EXPORT_SYMBOL(__clear_user);
 EXPORT_SYMBOL(memset);
Signature · 1 line
2.53.0
#2 lore raw
Quoted 15 lines · Stafford Horne
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Based on the work for nios2 and arc, remove the inclusion of libgcc and instead use the kernel's own copy of the required functions.

Quoted 8 lines
Cc Jonas Bonn <[email protected]>
Cc Stefan Kristiansson <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Simon Schuster <[email protected]>
Cc Vineet Gupta <[email protected]>
Quoted 1 line

Thanks, I've added this to the asm-generic tree, and now only arch/parisc still uses libgcc.

Arnd