Skip to contentSkip to conversation

ARM: Don't include libgcc anymore

PATCH Superseded Jean-Christophe PLAGNIOL-VILLARD 2 participants 6 messages Aug 7, 2009 – Aug 8, 2009

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 ARM: Don't include libgcc anymore

This patch removes the inclusion of libgcc functions into U-Boot on the ARM architecture. Only the really needed functions are provided in the lib_arm directory. Those implementations are copied from Linux where they are well proven related to reliably, performance.

---
 board/trab/u-boot.lds             |    2 +-
 include/asm-arm/assembler.h       |  112 ++++++++++++
 include/asm-arm/linkage.h         |   11 ++
 include/linux/linkage.h           |   95 ++++++++++
 lib_arm/Makefile                  |   19 +--
 lib_arm/_divsi3.S                 |  140 ---------------
 lib_arm/_modsi3.S                 |   99 -----------
 lib_arm/_udivsi3.S                |   77 --------
 lib_arm/_umodsi3.S                |   88 ----------
 lib_arm/{_ashldi3.S => ashldi3.S} |    9 +-
 lib_arm/{_ashrdi3.S => ashrdi3.S} |    9 +-
 lib_arm/config.mk                 |    2 +
 lib_arm/lib1funcs.S               |  344 +++++++++++++++++++++++++++++++++++++
 lib_arm/{_ashrdi3.S => lshrdi3.S} |   13 +-
 14 files changed, 596 insertions(+), 424 deletions(-)
 create mode 100644 include/asm-arm/assembler.h
 create mode 100644 include/asm-arm/linkage.h
 create mode 100644 include/linux/linkage.h
 delete mode 100644 lib_arm/_divsi3.S
 delete mode 100644 lib_arm/_modsi3.S
 delete mode 100644 lib_arm/_udivsi3.S
 delete mode 100644 lib_arm/_umodsi3.S
 rename lib_arm/{_ashldi3.S => ashldi3.S} (93%)
 copy lib_arm/{_ashrdi3.S => ashrdi3.S} (93%)
 create mode 100644 lib_arm/lib1funcs.S
 rename lib_arm/{_ashrdi3.S => lshrdi3.S} (90%)
board/trab/u-boot.lds +1 -1
index d8bcfa4..a83853e 100644
@@ -33,7 +33,7 @@ SECTIONS
 	.text      :
 	{
 	  cpu/arm920t/start.o	(.text)
-	  lib_arm/_umodsi3.o	(.text)
+	  lib_arm/lib1funcs.o	(.text)
 	  lib_generic/zlib.o	(.text)
 	  lib_generic/crc32.o	(.text)
 	  lib_generic/string.o	(.text)
include/asm-arm/assembler.h new file +112 -0

112 lines not on this page · raw message

include/asm-arm/linkage.h new file +11 -0
new file mode 100644
index 0000000..5a25632
@@ -0,0 +1,11 @@
+#ifndef __ASM_LINKAGE_H
+#define __ASM_LINKAGE_H
+
+#define __ALIGN .align 0
+#define __ALIGN_STR ".align 0"
+
+#define ENDPROC(name) \
+  .type name, %function; \
+  END(name)
+
+#endif
include/linux/linkage.h new file +95 -0

95 lines not on this page · raw message

lib_arm/Makefile +8 -11
index c37e2e0..3fda6d2 100644
@@ -26,15 +26,12 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(ARCH).a
 LIBGCC	= $(obj)libgcc.a
 
-GLSOBJS	+= _ashldi3.o
-GLSOBJS	+= _ashrdi3.o
-GLSOBJS	+= _divsi3.o
-GLSOBJS	+= _lshrdi3.o
-GLSOBJS	+= _modsi3.o
-GLSOBJS	+= _udivsi3.o
-GLSOBJS	+= _umodsi3.o
+GLCOBJS-y += div0.o
 
-GLCOBJS	+= div0.o
+GLSOBJS-y += lib1funcs.o
+GLSOBJS-y += ashldi3.o
+GLSOBJS-y += ashrdi3.o
+GLSOBJS-y += lshrdi3.o
 
 COBJS-y	+= board.o
 COBJS-y	+= bootm.o
@@ -45,11 +42,11 @@ endif
 COBJS-y	+= interrupts.o
 COBJS-y	+= reset.o
 
-SRCS	:= $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
+SRCS	:= $(GLSOBJS-y:.o=.S) $(GLCOBJS-y:.o=.c) \
 	   $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
-LGOBJS	:= $(addprefix $(obj),$(GLSOBJS)) \
-	   $(addprefix $(obj),$(GLCOBJS))
+LGOBJS	:= $(addprefix $(obj),$(GLSOBJS-y)) \
+	   $(addprefix $(obj),$(GLCOBJS-y))
 
 ifdef USE_PRIVATE_LIBGCC
 all:	$(LIB) $(LIBGCC)
lib_arm/_divsi3.S deleted +0 -140

140 lines not on this page · raw message

lib_arm/_modsi3.S deleted +0 -99

99 lines not on this page · raw message

lib_arm/_udivsi3.S deleted +0 -77

77 lines not on this page · raw message

lib_arm/_umodsi3.S deleted +0 -88

88 lines not on this page · raw message

lib_arm/ashldi3.S renamed from lib_arm/_ashldi3.S +7 -2
similarity index 93%
rename from lib_arm/_ashldi3.S
rename to lib_arm/ashldi3.S
index de4403d..1154d92 100644
@@ -26,6 +26,8 @@ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
 
+#include <linux/linkage.h>
+
 #ifdef __ARMEB__
 #define al r1
 #define ah r0
@@ -34,8 +36,8 @@ Boston, MA 02110-1301, USA.  */
 #define ah r1
 #endif
 
-.globl __ashldi3
-__ashldi3:
+ENTRY(__ashldi3)
+ENTRY(__aeabi_llsl)
 
 	subs	r3, r2, #32
 	rsb	ip, r2, #32
@@ -44,3 +46,6 @@ __ashldi3:
 	orrmi	ah, ah, al, lsr ip
 	mov	al, al, lsl r2
 	mov	pc, lr
+
+ENDPROC(__ashldi3)
+ENDPROC(__aeabi_llsl)
lib_arm/ashrdi3.S renamed from lib_arm/_ashrdi3.S +7 -2
similarity index 93%
copy from lib_arm/_ashrdi3.S
copy to lib_arm/ashrdi3.S
index 5edbcb3..9f8b355 100644
@@ -26,6 +26,8 @@ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
 
+#include <linux/linkage.h>
+
 #ifdef __ARMEB__
 #define al r1
 #define ah r0
@@ -34,8 +36,8 @@ Boston, MA 02110-1301, USA.  */
 #define ah r1
 #endif
 
-.globl __ashrdi3
-__ashrdi3:
+ENTRY(__ashrdi3)
+ENTRY(__aeabi_lasr)
 
 	subs	r3, r2, #32
 	rsb	ip, r2, #32
@@ -44,3 +46,6 @@ __ashrdi3:
 	orrmi	al, al, ah, lsl ip
 	mov	ah, ah, asr r2
 	mov	pc, lr
+
+ENDPROC(__ashrdi3)
+ENDPROC(__aeabi_lasr)
lib_arm/config.mk +2 -0
index a13603e..3f85cfd 100644
@@ -26,3 +26,5 @@ CROSS_COMPILE ?= arm-linux-
 PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__
 
 LDSCRIPT := $(SRCTREE)/cpu/$(CPU)/u-boot.lds
+
+USE_PRIVATE_LIBGCC ?= yes
lib_arm/lib1funcs.S new file +344 -0

344 lines not on this page · raw message

lib_arm/lshrdi3.S renamed from lib_arm/_ashrdi3.S +9 -4
similarity index 90%
rename from lib_arm/_ashrdi3.S
rename to lib_arm/lshrdi3.S
index 5edbcb3..99ea338 100644
@@ -26,6 +26,8 @@ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
 
+#include <linux/linkage.h>
+
 #ifdef __ARMEB__
 #define al r1
 #define ah r0
@@ -34,13 +36,16 @@ Boston, MA 02110-1301, USA.  */
 #define ah r1
 #endif
 
-.globl __ashrdi3
-__ashrdi3:
+ENTRY(__lshrdi3)
+ENTRY(__aeabi_llsr)
 
 	subs	r3, r2, #32
 	rsb	ip, r2, #32
 	movmi	al, al, lsr r2
-	movpl	al, ah, asr r3
+	movpl	al, ah, lsr r3
 	orrmi	al, al, ah, lsl ip
-	mov	ah, ah, asr r2
+	mov	ah, ah, lsr r2
 	mov	pc, lr
+
+ENDPROC(__lshrdi3)
+ENDPROC(__aeabi_llsr)
Signature · 1 line
1.6.3.1
#1 lore raw

PATCH v3 1/1 ARM: Don't include libgcc anymore

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 4 lines · In message <[email protected]> you wrote:

This patch removes the inclusion of libgcc functions into U-Boot on the ARM architecture. Only the really needed functions are provided in the lib_arm directory. Those implementations are copied from Linux where they are well proven related to reliably, performance.

Why would this be needed? I posted a patch that seems to fix all currently known issues. Do you see any remaining problems with my patch applied?

If so, please let me know, and include exact information how to reproduce such problems - which board, which exact tool chain, how to run it, which error messages you see, etc.

At the moment I don't see any advantages of your patch. On contrary, I would like to avoid such an intrusive change so late in the release cycle unless there is really good reason for it.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
One possible reason that things aren't going  according  to  plan  is
that there never was a plan in the first place.
#2 lore raw

PATCH v3 1/1 ARM: Don't include libgcc anymore

Quoted 12 lines · Wolfgang Denk

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 4 lines · In message <[email protected]> you wrote:

This patch removes the inclusion of libgcc functions into U-Boot on the ARM architecture. Only the really needed functions are provided in the lib_arm directory. Those implementations are copied from Linux where they are well proven related to reliably, performance.

Why would this be needed? I posted a patch that seems to fix all currently known issues. Do you see any remaining problems with my patch applied?

Quoted 7 lines

If so, please let me know, and include exact information how to reproduce such problems - which board, which exact tool chain, how to run it, which error messages you see, etc.

At the moment I don't see any advantages of your patch. On contrary, I would like to avoid such an intrusive change so late in the release cycle unless there is really good reason for it.

the omap3 does not build with my toolchains

as it's also miss other EABI function
__aeabi_idivmod
__aeabi_uidivmod

so yes we do need it

Best Regards,
J.

#3 lore raw

PATCH v3 1/1 ARM: Don't include libgcc anymore

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 4 lines

If so, please let me know, and include exact information how to reproduce such problems - which board, which exact tool chain, how to run it, which error messages you see, etc.

Please read what I wrote.

Quoted 4 lines
Quoted 3 lines

At the moment I don't see any advantages of your patch. On contrary, I would like to avoid such an intrusive change so late in the release cycle unless there is really good reason for it.

the omap3 does not build with my toolchains

The omap3? There is no board configuration "omap3" in Mainline.

Please provide full details - which board name (so I can try and byuild it, too), which exact tool chain (so I can try this one, too), and especially what your error messages were.

Quoted 3 lines

as it's also miss other EABI function
__aeabi_idivmod
__aeabi_uidivmod

What are you talking about? Did you actually test my patch? I don't think so. See the last lines of it:

...
+
+.globl __aeabi_uidivmod
+__aeabi_uidivmod:
+
+ stmfd sp!, {r0, r1, ip, lr}
+ bl __aeabi_uidiv
+ ldmfd sp!, {r1, r2, ip, lr}
+ mul r3, r0, r2
+ sub r1, r1, r3
+ mov pc, lr
+
+.globl __aeabi_idivmod
+__aeabi_idivmod:
+
+ stmfd sp!, {r0, r1, ip, lr}
+ bl __aeabi_idiv
+ ldmfd sp!, {r1, r2, ip, lr}
+ mul r3, r0, r2
+ sub r1, r1, r3
+ mov pc, lr

Signature · 4 lines
1.6.0.6


So - which function names get added here?
Quoted 1 line

so yes we do need it

You must provide better facts. What you claim here is obviously not correct. Please check again.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Of all possible committee reactions to any  given  agenda  item,  the
reaction  that will occur is the one which will liberate the greatest
amount of hot air.                                -- Thomas L. Martin
#4 lore raw

PATCH v3 1/1 ARM: Don't include libgcc anymore

In reply to Wolfgang Denk
Quoted 4 lines

At the moment I don't see any advantages of your patch. On contrary, I would like to avoid such an intrusive change so late in the release cycle unless there is really good reason for it.

on contrary my patch was patch months ago and well tested on multiple boards and socs

your patch is more dangerous IMHO as it is not well tested and as you just send few days ago

so for my point of view non well tested patch against well tested please let us use this one

and we will need it any way really soon to support cortex m3 and will remove anyway the current code

Best Regards,
J.

#5 lore raw

PATCH v3 1/1 ARM: Don't include libgcc anymore

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 3 lines · In message <[email protected]> you wrote:

your patch is more dangerous IMHO as it is not well tested and as you just send few days ago

The changes in my patch are so small that the consequences can be pretty well judged.

Did you test it?

Did you encounter any problems with it?

Actually, did you bother to compare the code we have in U-Boot with what you suggest to add?

Quoted 2 lines

and we will need it any way really soon to support cortex m3 and will remove anyway the current code

OK, we can address this problem when we have it on our plate. This is not the case yet.

Again, I ask: did you test my patch? are there any problems with it?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"How is this place run - is it an anarchy?"
"No, I wouldn't say so; it is not that well organised..."