Skip to contentSkip to conversation

Move libgcc inclusion from common Makefile to platform configs files

PATCH Superseded Jean-Christophe PLAGNIOL-VILLARD 5 participants 16 messages Jun 20, 2009 – Jul 10, 2009 Kbuild

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 Move libgcc inclusion from common Makefile to platform configs files

This patch moves the libgcc Makefile inclusion from the toplevel Makefile to the arch_config.mk files. This is in preparation for the ARM architecture to move away from including libgcc function and only using self-contained U-Boot functions as done in Linux.

Currently in the next branch all the ARM boards that use the nand are broken due to the adding of the 64 Bit device size support. In the past we have seen problems with different toolchains due to EABI, FPU as example. With this patch and the following one we move away from all these problems and we will be able to have full control to have a functions embedded into u-boot.

---
Rebased against current HEAD

Best Regards,
J.

 Makefile                 |    2 +-
 api_examples/Makefile    |    4 +---
 arm_config.mk            |    2 ++
 avr32_config.mk          |    2 ++
 blackfin_config.mk       |    2 ++
 board/netstar/Makefile   |    4 +---
 board/sl8245/config.mk   |    1 -
 board/trab/Makefile      |    2 --
 board/voiceblue/Makefile |    4 +---
 examples/Makefile        |    2 +-
 i386_config.mk           |    2 ++
 m68k_config.mk           |    2 ++
 microblaze_config.mk     |    2 ++
 mips_config.mk           |    2 ++
 nios2_config.mk          |    2 ++
 nios_config.mk           |    2 ++
 ppc_config.mk            |    2 ++
 sh_config.mk             |    2 ++
 sparc_config.mk          |    2 ++
 19 files changed, 29 insertions(+), 14 deletions(-)
Makefile +1 -1
index 6a2dd9f..8035831 100644
@@ -288,7 +288,7 @@ LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).a
 LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
 
 # Add GCC lib
-PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
+PLATFORM_LIBS += $(PLATFORM_LIBGCC)
 
 ifeq ($(CONFIG_NAND_U_BOOT),y)
 NAND_SPL = nand_spl
api_examples/Makefile +1 -3
index 4c01437..4bfa7e6 100644
@@ -56,8 +56,6 @@ OBJS	:= $(addprefix $(obj),$(COBJS))
 ELF	:= $(addprefix $(obj),$(ELF))
 BIN	:= $(addprefix $(obj),$(BIN))
 
-gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
-
 CPPFLAGS += -I..
 
 all:	$(obj).depend $(OBJS) $(LIB) $(ELF) $(BIN)
@@ -70,7 +68,7 @@ $(ELF):
 $(obj)%:	$(obj)%.o $(LIB)
 		$(LD) $(obj)crt0.o -Ttext $(LOAD_ADDR) \
 			-o $@ $< $(LIB) \
-			-L$(gcclibdir) -lgcc
+			$(PLATFORM_LIBGCC)
 
 $(BIN):
 $(obj)%.bin:	$(obj)%
arm_config.mk +2 -0
index c4cf99d..b88a3f2 100644
@@ -24,3 +24,5 @@
 PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__
 
 LDSCRIPT := $(SRCTREE)/cpu/$(CPU)/u-boot.lds
+
+PLATFORM_LIBGCC += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
avr32_config.mk +2 -0
index 441caa4..8569d5f 100644
@@ -23,3 +23,5 @@
 
 PLATFORM_RELFLAGS	+= -ffixed-r5 -fPIC -mno-init-got -mrelax
 PLATFORM_LDFLAGS	+= --relax
+
+PLATFORM_LIBGCC += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
blackfin_config.mk +2 -0
index 989e976..1534c0d 100644
@@ -60,3 +60,5 @@ LDR_FLAGS += $(LDR_FLAGS-y)
 ifeq ($(wildcard $(TOPDIR)/board/$(BOARD)/u-boot.lds*),)
 LDSCRIPT = $(obj)lib_$(ARCH)/u-boot.lds
 endif
+
+PLATFORM_LIBGCC += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
board/netstar/Makefile +1 -3
index 91bac38..1cc2722 100644
@@ -36,8 +36,6 @@ SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c) eeprom.c \
 OBJS	:= $(addprefix $(obj),$(COBJS))
 SOBJS	:= $(addprefix $(obj),$(SOBJS))
 
-gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
-
 LOAD_ADDR = 0x10400000
 LDSCRIPT = $(TOPDIR)/board/$(BOARDDIR)/eeprom.lds
 lnk = $(if $(obj),$(obj),.)
@@ -55,7 +53,7 @@ $(obj)eeprom.srec:	$(obj)eeprom.o $(obj)eeprom_start.o
 		-o $(<:.o=) -e eeprom eeprom.o eeprom_start.o \
 		-L$(obj)../../examples -lstubs \
 		-L$(obj)../../lib_generic -lgeneric \
-		-L$(gcclibdir) -lgcc
+		$(PLATFROM_LIBGCC)
 	$(OBJCOPY) -O srec $(<:.o=) $@
 
 $(obj)eeprom.bin:	$(obj)eeprom.srec
board/sl8245/config.mk +0 -1
index 022512b..299fc6c 100644
@@ -28,4 +28,3 @@
 TEXT_BASE = 0xFFF00000
 
 PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)
-PLATFORM_LIBS += $(shell $(CC) -print-libgcc-file-name)
board/trab/Makefile +0 -2
index 30e5fbb..a3661c4 100644
@@ -36,8 +36,6 @@ SOBJS	:= $(addprefix $(obj),$(SOBJS))
 
 OBJS_FKT := $(addprefix $(obj),$(COBJS_FKT))
 
-gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
-
 LOAD_ADDR = 0xc100000
 
 #########################################################################
board/voiceblue/Makefile +1 -3
index e7c1cbb..0d1e079 100644
@@ -33,8 +33,6 @@ SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c) eeprom.c eeprom_start.S
 OBJS	:= $(addprefix $(obj),$(COBJS))
 SOBJS	:= $(addprefix $(obj),$(SOBJS))
 
-gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
-
 LOAD_ADDR = 0x10400000
 LDSCRIPT = $(TOPDIR)/board/$(BOARDDIR)/eeprom.lds
 lnk = $(if $(obj),$(obj),.)
@@ -49,7 +47,7 @@ $(obj)eeprom.srec:	$(obj)eeprom.o $(obj)eeprom_start.o
 		-o $(<:.o=) -e eeprom eeprom.o eeprom_start.o \
 		-L$(obj)../../examples -lstubs \
 		-L$(obj)../../lib_generic -lgeneric \
-		-L$(gcclibdir) -lgcc
+		$(PLATFROM_LIBGCC)
 	$(OBJCOPY) -O srec $(<:.o=) $@
 
 $(obj)eeprom.bin:	$(obj)eeprom.srec
examples/Makefile +1 -1
index dbcfa92..5bd13f1 100644
@@ -178,7 +178,7 @@ $(ELF):
 $(obj)%:	$(obj)%.o $(LIB)
 		$(LD) -g $(EX_LDFLAGS) -Ttext $(LOAD_ADDR) \
 			-o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \
-			-L$(gcclibdir) -lgcc
+			$(PLATFORM_LIBGCC)
 
 $(SREC):
 $(obj)%.srec:	$(obj)%
i386_config.mk +2 -0
index 9e6d37d..03b2538 100644
@@ -22,3 +22,5 @@
 #
 
 PLATFORM_CPPFLAGS += -DCONFIG_I386 -D__I386__
+
+PLATFORM_LIBGCC += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
m68k_config.mk +2 -0
index 12bd27c..f0c963b 100644
@@ -23,3 +23,5 @@
 
 PLATFORM_CPPFLAGS += -DCONFIG_M68K -D__M68K__
 PLATFORM_LDFLAGS  += -n
+
+PLATFORM_LIBGCC += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
microblaze_config.mk +2 -0
index e44c79e..5f78c5c 100644
@@ -25,3 +25,5 @@
 #
 
 PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
+
+PLATFORM_LIBGCC += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
mips_config.mk +2 -0
index 05eb05d..3ae6c19 100644
@@ -23,6 +23,8 @@
 
 PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
 
+PLATFORM_LIBGCC  += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
+
 #
 # From Linux arch/mips/Makefile
 #
nios2_config.mk +2 -0
index 3f23b56..1bf4992 100644
@@ -24,3 +24,5 @@
 
 PLATFORM_CPPFLAGS += -DCONFIG_NIOS2 -D__NIOS2__
 PLATFORM_CPPFLAGS += -ffixed-r15 -G0
+
+PLATFORM_LIBGCC += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
nios_config.mk +2 -0
index 1cf0f32..d72db7d 100644
@@ -23,3 +23,5 @@
 #
 
 PLATFORM_CPPFLAGS += -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs
+
+PLATFORM_LIBGCC += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
ppc_config.mk +2 -0
index c95b3b1..74a4f11 100644
@@ -24,6 +24,8 @@
 PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
 PLATFORM_LDFLAGS  += -n
 
+PLATFORM_LIBGCC += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
+
 #
 # When cross-compiling on NetBSD, we have to define __PPC__ or else we
 # will pick up a va_list declaration that is incompatible with the
sh_config.mk +2 -0
index 49d50f7..311699a 100644
@@ -22,3 +22,5 @@
 #
 
 PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
+
+PLATFORM_LIBGCC += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
sparc_config.mk +2 -0
index 87f745f..15d2f5b 100644
@@ -22,3 +22,5 @@
 #
 
 PLATFORM_CPPFLAGS += -DCONFIG_SPARC -D__sparc__
+
+PLATFORM_LIBGCC += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
Signature · 1 line
1.6.3.1
#1 lore raw

PATCH v2 2/2 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.

---
Rebased against current HEAD

Best Regards,
J.

 Makefile                          |   11 +-
 arm_config.mk                     |    2 +-
 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                  |   10 +-
 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/lib1funcs.S               |  348 +++++++++++++++++++++++++++++++++++++
 lib_arm/{_ashrdi3.S => lshrdi3.S} |   13 +-
 15 files changed, 603 insertions(+), 423 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%)
Makefile +8 -3
index 8035831..4cc2be7 100644
@@ -228,7 +228,6 @@ endif
 ifeq ($(CPU),ixp)
 LIBS += cpu/ixp/npe/libnpe.a
 endif
-LIBS += lib_$(ARCH)/lib$(ARCH).a
 LIBS += fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a \
 	fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a fs/yaffs2/libyaffs2.a \
 	fs/ubifs/libubifs.a
@@ -287,6 +286,9 @@ LIBS := $(addprefix $(obj),$(LIBS))
 LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).a
 LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
 
+LIBARCH = lib_$(ARCH)/lib$(ARCH).a
+LIBARCH := $(addprefix $(obj),$(LIBARCH))
+
 # Add GCC lib
 PLATFORM_LIBS += $(PLATFORM_LIBGCC)
 
@@ -301,7 +303,7 @@ U_BOOT_ONENAND = $(obj)u-boot-onenand.bin
 endif
 
 __OBJS := $(subst $(obj),,$(OBJS))
-__LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD))
+__LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD)) $(subst $(obj),,$(LIBARCH))
 
 #########################################################################
 #########################################################################
@@ -362,13 +364,16 @@ endif
 $(OBJS):	depend
 		$(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))
 
+$(LIBARCH):	depend
+		$(MAKE) -C $(dir $(subst $(obj),,$@))
+
 $(LIBS):	depend $(SUBDIRS)
 		$(MAKE) -C $(dir $(subst $(obj),,$@))
 
 $(LIBBOARD):	depend $(LIBS)
 		$(MAKE) -C $(dir $(subst $(obj),,$@))
 
-$(SUBDIRS):	depend
+$(SUBDIRS):	depend $(LIBARCH)
 		$(MAKE) -C $@ all
 
 $(LDSCRIPT):	depend
arm_config.mk +1 -1
index b88a3f2..0d6cd24 100644
@@ -25,4 +25,4 @@ PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__
 
 LDSCRIPT := $(SRCTREE)/cpu/$(CPU)/u-boot.lds
 
-PLATFORM_LIBGCC += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
+PLATFORM_LIBGCC += -L$(OBJTREE)/lib_arm -larm
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 +4 -6
index 4469361..756643f 100644
@@ -25,12 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(ARCH).a
 
-SOBJS-y	+= _ashldi3.o
-SOBJS-y	+= _ashrdi3.o
-SOBJS-y	+= _divsi3.o
-SOBJS-y	+= _modsi3.o
-SOBJS-y	+= _udivsi3.o
-SOBJS-y	+= _umodsi3.o
+SOBJS-y	+= lib1funcs.o
+SOBJS-y	+= ashldi3.o
+SOBJS-y	+= ashrdi3.o
+SOBJS-y += lshrdi3.o
 
 COBJS-y	+= board.o
 COBJS-y	+= bootm.o
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/lib1funcs.S new file +348 -0

348 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
#2 lore raw

PATCH v2 2/2 ARM: Don't include libgcc anymore

Quoted 11 lines · Jean-Christophe PLAGNIOL-VILLARD

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.

---
Rebased against current HEAD

Best Regards,
J.

...

Quoted 1 line
 create mode 100644 lib_arm/lib1funcs.S

For this I get

Warning: trailing whitespace in lines 51,65,152 of lib_arm/lib1funcs.S

Best regards

Dirk

#3 lore raw

PATCH v2 1/2 Move libgcc inclusion from common Makefile to platform configs files

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 4 lines · On Saturday 20 June 2009 05:33:26 Jean-Christophe PLAGNIOL-VILLARD wrote:

This patch moves the libgcc Makefile inclusion from the toplevel Makefile to the arch_config.mk files. This is in preparation for the ARM architecture to move away from including libgcc function and only using self-contained U-Boot functions as done in Linux.

why not change the top level Makefile to read:
PLATFORM_LIBGCC ?= ...

then any board/arch that doesnt want it can simply do:
PLATFORM_LIBGCC = # dont want it
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090620/0661677e/attachment.pgp

#4 lore raw

PATCH v2 1/2 Move libgcc inclusion from common Makefile to platform configs files

Quoted 11 lines · Mike Frysinger
Quoted 4 lines · On Saturday 20 June 2009 05:33:26 Jean-Christophe PLAGNIOL-VILLARD wrote:

This patch moves the libgcc Makefile inclusion from the toplevel Makefile to the arch_config.mk files. This is in preparation for the ARM architecture to move away from including libgcc function and only using self-contained U-Boot functions as done in Linux.

why not change the top level Makefile to read:
PLATFORM_LIBGCC ?= ...

then any board/arch that doesnt want it can simply do:
PLATFORM_LIBGCC = # dont want it

because you need to provide the equivalent functions for standalone application and api and U-Boot ofcourse

so as as for arm we will provide self-contained functions

Best Regards,
J.

#5 lore raw

PATCH v2 1/2 Move libgcc inclusion from common Makefile to platform configs files

Quoted 7 lines · On Saturday 20 June 2009 06:40:07 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 6 lines · Mike Frysinger
Quoted 4 lines · On Saturday 20 June 2009 05:33:26 Jean-Christophe PLAGNIOL-VILLARD wrote:

This patch moves the libgcc Makefile inclusion from the toplevel Makefile to the arch_config.mk files. This is in preparation for the ARM architecture to move away from including libgcc function and only using self-contained U-Boot functions as done in Linux.

Quoted 8 lines
Quoted 5 lines

why not change the top level Makefile to read:
PLATFORM_LIBGCC ?= ...

then any board/arch that doesnt want it can simply do:
PLATFORM_LIBGCC = # dont want it

because you need to provide the equivalent functions for standalone application and api and U-Boot ofcourse

so move it to config.mk. this doesnt change the important point: leave PLATFORM_LIBGCC default in the toplevel common files. what i proposed doesnt limit what you want to do with arm in any way.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090620/bb659992/attachment.pgp

#6 lore raw

PATCH v2 1/2 Move libgcc inclusion from common Makefile to platform configs files

Quoted 14 lines · Mike Frysinger
Quoted 13 lines · On Saturday 20 June 2009 06:40:07 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 11 lines · Mike Frysinger
Quoted 4 lines · On Saturday 20 June 2009 05:33:26 Jean-Christophe PLAGNIOL-VILLARD wrote:

This patch moves the libgcc Makefile inclusion from the toplevel Makefile to the arch_config.mk files. This is in preparation for the ARM architecture to move away from including libgcc function and only using self-contained U-Boot functions as done in Linux.

why not change the top level Makefile to read:
PLATFORM_LIBGCC ?= ...

then any board/arch that doesnt want it can simply do:
PLATFORM_LIBGCC = # dont want it

Quoted 6 lines
Quoted 2 lines

because you need to provide the equivalent functions for standalone application and api and U-Boot ofcourse

so move it to config.mk. this doesnt change the important point: leave PLATFORM_LIBGCC default in the toplevel common files. what i proposed doesnt limit what you want to do with arm in any way.

I think it's better to let it at arch level and force any new arch adding to manage it instead provide a default one

Best Regards,
J.

#7 lore raw

PATCH v2 1/2 Move libgcc inclusion from common Makefile to platform configs files

Quoted 18 lines · On Saturday 20 June 2009 07:30:41 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 17 lines · Mike Frysinger
Quoted 15 lines · On Saturday 20 June 2009 06:40:07 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 11 lines · Mike Frysinger
Quoted 4 lines · On Saturday 20 June 2009 05:33:26 Jean-Christophe wrote:

This patch moves the libgcc Makefile inclusion from the toplevel Makefile to the arch_config.mk files. This is in preparation for the ARM architecture to move away from including libgcc function and only using self-contained U-Boot functions as done in Linux.

why not change the top level Makefile to read:
PLATFORM_LIBGCC ?= ...

then any board/arch that doesnt want it can simply do:
PLATFORM_LIBGCC = # dont want it

because you need to provide the equivalent functions for standalone application and api and U-Boot ofcourse

Quoted 6 lines
Quoted 3 lines

so move it to config.mk. this doesnt change the important point: leave PLATFORM_LIBGCC default in the toplevel common files. what i proposed doesnt limit what you want to do with arm in any way.

I think it's better to let it at arch level and force any new arch adding to manage it instead provide a default one

considering most arches want this code, i dont think so. you're proposing we duplicate the same common code in all arches to support one deviating arch -- arm. the defaults should reflect the common state while the deviating ones change the behavior as they like.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090620/89cd12ea/attachment.pgp

#8 lore raw

PATCH v2 1/2 Move libgcc inclusion from common Makefile to platform configs files

Quoted 23 lines · Mike Frysinger
Quoted 22 lines · On Saturday 20 June 2009 07:30:41 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 20 lines · Mike Frysinger
Quoted 7 lines · On Saturday 20 June 2009 06:40:07 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 6 lines · Mike Frysinger
Quoted 4 lines · On Saturday 20 June 2009 05:33:26 Jean-Christophe wrote:

This patch moves the libgcc Makefile inclusion from the toplevel Makefile to the arch_config.mk files. This is in preparation for the ARM architecture to move away from including libgcc function and only using self-contained U-Boot functions as done in Linux.

Quoted 8 lines
Quoted 5 lines

why not change the top level Makefile to read:
PLATFORM_LIBGCC ?= ...

then any board/arch that doesnt want it can simply do:
PLATFORM_LIBGCC = # dont want it

because you need to provide the equivalent functions for standalone application and api and U-Boot ofcourse

so move it to config.mk. this doesnt change the important point: leave PLATFORM_LIBGCC default in the toplevel common files. what i proposed doesnt limit what you want to do with arm in any way.

Quoted 7 lines
Quoted 2 lines

I think it's better to let it at arch level and force any new arch adding to manage it instead provide a default one

considering most arches want this code, i dont think so. you're proposing we duplicate the same common code in all arches to support one deviating arch -- arm. the defaults should reflect the common state while the deviating ones change the behavior as they like.

This is where I disagree other arch as mips and other will also need to move away from the needs to include libgcc to be really toolchain independant

I do think it's really important for U-Boot be able to have full control to have a functions embedded into.

So stop to have libgcc include by default will really reflect it

Best Regards,
J.

#9 lore raw

PATCH v2 1/2 Move libgcc inclusion from common Makefile to platform configs files

Quoted 33 lines · On Saturday 20 June 2009 09:01:36 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 24 lines · Mike Frysinger
Quoted 23 lines · On Saturday 20 June 2009 07:30:41 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 21 lines · Mike Frysinger
Quoted 8 lines · On Saturday 20 June 2009 06:40:07 Jean-Christophe wrote:
Quoted 7 lines · Mike Frysinger
Quoted 5 lines · On Saturday 20 June 2009 05:33:26 Jean-Christophe wrote:

This patch moves the libgcc Makefile inclusion from the toplevel Makefile to the arch_config.mk files. This is in preparation for the ARM architecture to move away from including libgcc function and only using self-contained U-Boot functions as done in Linux.

Quoted 8 lines
Quoted 5 lines

why not change the top level Makefile to read:
PLATFORM_LIBGCC ?= ...

then any board/arch that doesnt want it can simply do:
PLATFORM_LIBGCC = # dont want it

because you need to provide the equivalent functions for standalone application and api and U-Boot ofcourse

so move it to config.mk. this doesnt change the important point:
leave PLATFORM_LIBGCC default in the toplevel common files. what i proposed doesnt limit what you want to do with arm in any way.

Quoted 7 lines
Quoted 2 lines

I think it's better to let it at arch level and force any new arch adding to manage it instead provide a default one

considering most arches want this code, i dont think so. you're proposing we duplicate the same common code in all arches to support one deviating arch -- arm. the defaults should reflect the common state while the deviating ones change the behavior as they like.

Quoted 8 lines

This is where I disagree other arch as mips and other will also need to move away from the needs to include libgcc to be really toolchain independant

I do think it's really important for U-Boot be able to have full control to have a functions embedded into.

So stop to have libgcc include by default will really reflect it

so you have two arches (mips/arm) that you dont want to use libgcc. that is still vastly the minority. if we ever do get most ports not using libgcc, then pushing it to the arch configs makes sense. but we havent and we arent even close.

how you want to manage libgcc dependency is your prerogative ... it doesnt mean you should be forcing other people to follow suit.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090620/690c779d/attachment.pgp

#10 lore raw

PATCH v2 1/2 Move libgcc inclusion from common Makefile to platform configs files

Quoted 41 lines · Mike Frysinger
Quoted 40 lines · On Saturday 20 June 2009 09:01:36 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 24 lines · Mike Frysinger
Quoted 23 lines · On Saturday 20 June 2009 07:30:41 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 21 lines · Mike Frysinger
Quoted 8 lines · On Saturday 20 June 2009 06:40:07 Jean-Christophe wrote:
Quoted 7 lines · Mike Frysinger
Quoted 5 lines · On Saturday 20 June 2009 05:33:26 Jean-Christophe wrote:

This patch moves the libgcc Makefile inclusion from the toplevel Makefile to the arch_config.mk files. This is in preparation for the ARM architecture to move away from including libgcc function and only using self-contained U-Boot functions as done in Linux.

Quoted 8 lines
Quoted 5 lines

why not change the top level Makefile to read:
PLATFORM_LIBGCC ?= ...

then any board/arch that doesnt want it can simply do:
PLATFORM_LIBGCC = # dont want it

because you need to provide the equivalent functions for standalone application and api and U-Boot ofcourse

so move it to config.mk. this doesnt change the important point:
leave PLATFORM_LIBGCC default in the toplevel common files. what i proposed doesnt limit what you want to do with arm in any way.

Quoted 7 lines
Quoted 2 lines

I think it's better to let it at arch level and force any new arch adding to manage it instead provide a default one

considering most arches want this code, i dont think so. you're proposing we duplicate the same common code in all arches to support one deviating arch -- arm. the defaults should reflect the common state while the deviating ones change the behavior as they like.

This is where I disagree other arch as mips and other will also need to move away from the needs to include libgcc to be really toolchain independant

I do think it's really important for U-Boot be able to have full control to have a functions embedded into.

Quoted 6 lines
Quoted 1 line

So stop to have libgcc include by default will really reflect it

so you have two arches (mips/arm) that you dont want to use libgcc. that is still vastly the minority. if we ever do get most ports not using libgcc, then pushing it to the arch configs makes sense. but we havent and we arent even close.

which minoroty?
I just give you example but you will see arm, mips, sh, powerpc etc... toolchains problem just because we use the libgcc

I've patch in qualification for mips and sh so it will not be so long maybe 2 or 3 weeks

Quoted 3 lines

how you want to manage libgcc dependency is your prerogative ... it doesnt mean you should be forcing other people to follow suit.

you can do your own choice but I steel think it's a good improvement

Best Regards,
J.

#11 lore raw

PATCH v2 1/2 Move libgcc inclusion from common Makefile to platform configs files

Quoted 42 lines · On Saturday 20 June 2009 09:57:51 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 41 lines · Mike Frysinger
Quoted 40 lines · On Saturday 20 June 2009 09:01:36 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 24 lines · Mike Frysinger
Quoted 23 lines · On Saturday 20 June 2009 07:30:41 Jean-Christophe wrote:
Quoted 21 lines · Mike Frysinger
Quoted 8 lines · On Saturday 20 June 2009 06:40:07 Jean-Christophe wrote:
Quoted 7 lines · Mike Frysinger
Quoted 5 lines · On Saturday 20 June 2009 05:33:26 Jean-Christophe wrote:

This patch moves the libgcc Makefile inclusion from the toplevel Makefile to the arch_config.mk files. This is in preparation for the ARM architecture to move away from including libgcc function and only using self-contained U-Boot functions as done in Linux.

Quoted 8 lines
Quoted 5 lines

why not change the top level Makefile to read:
PLATFORM_LIBGCC ?= ...

then any board/arch that doesnt want it can simply do:
PLATFORM_LIBGCC = # dont want it

because you need to provide the equivalent functions for standalone application and api and U-Boot ofcourse

so move it to config.mk. this doesnt change the important point:
leave PLATFORM_LIBGCC default in the toplevel common files. what i proposed doesnt limit what you want to do with arm in any way.

Quoted 7 lines
Quoted 2 lines

I think it's better to let it at arch level and force any new arch adding to manage it instead provide a default one

considering most arches want this code, i dont think so. you're proposing we duplicate the same common code in all arches to support one deviating arch -- arm. the defaults should reflect the common state while the deviating ones change the behavior as they like.

This is where I disagree other arch as mips and other will also need to move away from the needs to include libgcc to be really toolchain independant

I do think it's really important for U-Boot be able to have full control to have a functions embedded into.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

So stop to have libgcc include by default will really reflect it

so you have two arches (mips/arm) that you dont want to use libgcc. that is still vastly the minority. if we ever do get most ports not using libgcc, then pushing it to the arch configs makes sense. but we havent and we arent even close.

which minoroty?

the majority use libgcc

Quoted 2 lines

I just give you example but you will see arm, mips, sh, powerpc etc... toolchains problem just because we use the libgcc

4 is still the minority, but this is Woflgang's call

Quoted 2 lines

I've patch in qualification for mips and sh so it will not be so long maybe 2 or 3 weeks

considering my proposed change is much simpler, and would allow for trivial migration as you converted things, it still makes more sense.

Quoted 4 lines
Quoted 2 lines

how you want to manage libgcc dependency is your prerogative ... it doesnt mean you should be forcing other people to follow suit.

you can do your own choice but I steel think it's a good improvement

it depends on the arch. for ones doing stupid things (like arm), thats one thing. but for others, it's simply a waste of time and unnecessary overhead. i'm not about to *copy* the exact sources from gcc just to avoid -lgcc. -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090620/52ae8c6e/attachment.pgp

#12 lore raw

PATCH v2 1/2 Move libgcc inclusion from common Makefile to platform configs files

Quoted 22 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

This is where I disagree other arch as mips and other will also need to move away from the needs to include libgcc to be really toolchain independant

I do think it's really important for U-Boot be able to have full control to have a functions embedded into.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

So stop to have libgcc include by default will really reflect it

so you have two arches (mips/arm) that you dont want to use libgcc. that is still vastly the minority. if we ever do get most ports not using libgcc, then pushing it to the arch configs makes sense. but we havent and we arent even close.

which minoroty?

the majority use libgcc

Quoted 2 lines

I just give you example but you will see arm, mips, sh, powerpc etc... toolchains problem just because we use the libgcc

Quoted 7 lines

4 is still the minority, but this is Woflgang's call

Quoted 2 lines

I've patch in qualification for mips and sh so it will not be so long maybe 2 or 3 weeks

considering my proposed change is much simpler, and would allow for trivial migration as you converted things, it still makes more sense.

it's not the size of the change, it's just I do not agree with it

Best Regards,
J.

#13 lore raw

PATCH v2 1/2 Move libgcc inclusion from common Makefile to platform configs files

Dear Jean-Christophe PLAGNIOL-VILLARD,

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

4 is still the minority, but this is Woflgang's call

Quoted 2 lines

I've patch in qualification for mips and sh so it will not be so long maybe 2 or 3 weeks

considering my proposed change is much simpler, and would allow for trivial migration as you converted things, it still makes more sense.

it's not the size of the change, it's just I do not agree with it

We had this discussion before. My position has not changed since:
defaults should be set such that the majority of boards / configu- rations can just use the default settings, and only deviation (or call it broken) configurations need to apply fixes.

Jean-Christophe, please implement this as suggested by Mike.

Thanks.

Best regards,

Wolfgang Denk

Signature · 7 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
"Obviously, a major malfunction has occurred."
              -- Steve Nesbitt, voice of Mission Control, January 28,
                 1986, as the shuttle Challenger exploded within view
                 of the grandstands.
#14 lore raw

PATCH v2 1/2 Move libgcc inclusion from common Makefile to platform configs files

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 2 lines · Jean-Christophe PLAGNIOL-VILLARD

I just give you example but you will see arm, mips, sh, powerpc etc... toolchains problem just because we use the libgcc

What problems will powerpc have due to libgcc, and why would we choose to reinvent the wheel rather than fix the toolchain if it's not supporting the ABI we're trying to build for?

Linking libgcc *removes* dependencies on the interface between the compiler and those functions. If you really want u-boot to have complete control of the generated code, you'll have to write in assembly.

-Scott

#15 lore raw

PATCH v2 1/2 Move libgcc inclusion from common Makefile to platform configs files

In reply to Jean-Christophe PLAGNIOL-VILLARD

Dear Jean-Christophe PLAGNIOL-VILLARD,

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

This patch moves the libgcc Makefile inclusion from the toplevel Makefile to the arch_config.mk files. This is in preparation for the ARM architecture to move away from including libgcc function and only using self-contained U-Boot functions as done in Linux.

Quoted 8 lines

Currently in the next branch all the ARM boards that use the nand are broken due to the adding of the 64 Bit device size support. In the past we have seen problems with different toolchains due to EABI, FPU as example. With this patch and the following one we move away from all these problems and we will be able to have full control to have a functions embedded into u-boot.

---

NAK.

I think Mike Frysinger's proposal (see
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/61892/focus=61896
and the rest of the thread) makes perfect sense: the default settings should be such that the majority of architectures just work as is, and only the deviating ones need to change the behavior.

Please rework as suggested and resubmit. Thanks.

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
A quarrel is quickly settled when deserted by one party; there is  no
battle unless there be two.                                  - Seneca