Skip to contentSkip to conversation

mips: unify lds

PATCH New Jean-Christophe PLAGNIOL-VILLARD 5 participants 29 messages May 10, 2009 – Jul 17, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mips: unify lds

all mips boards except a few use the same cpu lds so move it to cpu/$(CPU)

that could be overwrite in following order
SOC
BOARD
via the corresponding config.mk

---
 Makefile                                    |    2 +
 board/dbau1x00/u-boot.lds                   |   70 --------------------------
 board/gth2/u-boot.lds                       |   70 --------------------------
 board/incaip/u-boot.lds                     |   70 --------------------------
 board/pb1x00/u-boot.lds                     |   70 --------------------------
 board/purple/config.mk                      |    2 +
 board/qemu-mips/u-boot.lds                  |   72 ---------------------------
 board/tb0229/u-boot.lds                     |   70 --------------------------
 {board/micronas/vct => cpu/mips}/u-boot.lds |   32 ++++++------
 mips_config.mk                              |   25 +++++++++
 10 files changed, 46 insertions(+), 437 deletions(-)
 delete mode 100644 board/dbau1x00/u-boot.lds
 delete mode 100644 board/gth2/u-boot.lds
 delete mode 100644 board/incaip/u-boot.lds
 delete mode 100644 board/pb1x00/u-boot.lds
 delete mode 100644 board/qemu-mips/u-boot.lds
 delete mode 100644 board/tb0229/u-boot.lds
 rename {board/micronas/vct => cpu/mips}/u-boot.lds (75%)
Makefile +2 -0
index ee09856..2cb0ce2 100644
@@ -3222,6 +3222,7 @@ dbau1550_config		:	unconfig
 dbau1550_el_config	:	unconfig
 	@mkdir -p $(obj)include
 	@echo "#define CONFIG_DBAU1550 1" >$(obj)include/config.h
+	@echo "#define CONFIG_CPU_LITTLE_ENDIAN" >>$(obj)include/config.h
 	@$(MKCONFIG) -a dbau1x00 mips mips dbau1x00
 
 gth2_config		:	unconfig
@@ -3232,6 +3233,7 @@ gth2_config		:	unconfig
 pb1000_config		:	unconfig
 	@mkdir -p $(obj)include
 	@echo "#define CONFIG_PB1000 1" >$(obj)include/config.h
+	@echo "#define CONFIG_CPU_LITTLE_ENDIAN" >>$(obj)include/config.h
 	@$(MKCONFIG) -a pb1x00 mips mips pb1x00
 
 qemu_mips_config	: unconfig
board/dbau1x00/u-boot.lds deleted +0 -70

70 lines not on this page · raw message

board/gth2/u-boot.lds deleted +0 -70

70 lines not on this page · raw message

board/incaip/u-boot.lds deleted +0 -70

70 lines not on this page · raw message

board/pb1x00/u-boot.lds deleted +0 -70

70 lines not on this page · raw message

board/purple/config.mk +2 -0
index ea478ed..16a55c6 100644
@@ -30,3 +30,5 @@ TEXT_BASE = 0xB0000000
 
 # RAM version
 #TEXT_BASE = 0x80100000
+
+LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
board/qemu-mips/u-boot.lds deleted +0 -72

72 lines not on this page · raw message

board/tb0229/u-boot.lds deleted +0 -70

70 lines not on this page · raw message

cpu/mips/u-boot.lds renamed from board/micronas/vct/u-boot.lds +17 -15
similarity index 75%
rename from board/micronas/vct/u-boot.lds
rename to cpu/mips/u-boot.lds
index b90b186..dda0dda 100644
@@ -1,5 +1,8 @@
 /*
- * (C) Copyright 2003
+ * (C) Copyright 2004
+ * Masami Komiya <[email protected]>
+ *
+ * (C) Copyright 2003-2005
  * Wolfgang Denk Engineering, <[email protected]>
  *
  * See file CREDITS for list of people who contributed to this
@@ -29,34 +32,34 @@ SECTIONS
 	. = 0x00000000;
 
 	. = ALIGN(4);
-	.text       :
+	.text :
 	{
-	  *(.text)
+		*(.text)
 	}
 
 	. = ALIGN(4);
-	.rodata  : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
+	.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
 
 	. = ALIGN(4);
-	.data  : { *(.data) }
+	.data : { *(.data) }
 
 	. = .;
 	_gp = ALIGN(16) + 0x7ff0;
 
 	.got : {
-	  __got_start = .;
-	  *(.got)
-	  __got_end = .;
+		__got_start = .;
+		*(.got)
+		__got_end = .;
 	}
 
 	. = ALIGN(4);
-	.sdata  : { *(.sdata) }
+	.sdata : { *(.sdata) }
 
 	. = ALIGN(4);
 	.u_boot_cmd : {
-	  __u_boot_cmd_start = .;
-	  *(.u_boot_cmd)
-	  __u_boot_cmd_end = .;
+		__u_boot_cmd_start = .;
+		*(.u_boot_cmd)
+		__u_boot_cmd_end = .;
 	}
 
 	. = ALIGN(4);
@@ -64,8 +67,7 @@ SECTIONS
 	num_got_entries = (__got_end - __got_start) >> 2;
 
 	. = ALIGN(4);
-	.sbss (NOLOAD)  : { *(.sbss) }
-	. = ALIGN(4);
-	.bss (NOLOAD)  : { *(.bss) }
+	.sbss (NOLOAD) : { *(.sbss) }
+	.bss (NOLOAD) : { *(.bss) . = ALIGN(4); }
 	uboot_end = .;
 }
mips_config.mk +25 -0
index 05eb05d..b4365a3 100644
@@ -46,3 +46,28 @@ PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
 PLATFORM_CPPFLAGS		+= -G 0 -mabicalls -fpic
 PLATFORM_CPPFLAGS		+= -msoft-float
 PLATFORM_LDFLAGS		+= -G 0 -static -n -nostdlib
+
+#
+# We explicitly add the endianness specifier if needed, this allows
+# to compile kernels with a toolchain for the other endianness. We
+# carefully avoid to add it redundantly because gcc 3.3/3.4 complains
+# when fed the toolchain default!
+#
+# Certain gcc versions upto gcc 4.1.1 (probably 4.2-subversion as of
+# 2006-10-10 don't properly change the predefined symbols if -EB / -EL
+# are used, so we kludge that here.  A bug has been filed at
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29413.
+#
+
+UNDEF_ALL += -UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__
+UNDEF_ALL += -UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__
+
+ifdef CONFIG_CPU_LITTLE_ENDIAN
+PREDEF +=-DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__
+PLATFORM_CFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(UNDEF_ALL) $(PREDEF))
+else
+PREDEF += -DMIPSEB -D_MIPSEB -D__MIPSEB -D__MIPSEB__
+PLATFORM_CFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(UNDEF_ALL) $(PREDEF))
+endif
+
+LDSCRIPT := $(SRCTREE)/cpu/$(CPU)/u-boot.lds
Signature · 1 line
1.6.1.3
#1 lore raw

PATCH 1/1 mips: unify lds

Dear Jean-Christophe PLAGNIOL-VILLARD,

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

all mips boards except a few use the same cpu lds so move it to cpu/$(CPU)

that could be overwrite in following order
SOC
BOARD
via the corresponding config.mk

...

Quoted 13 lines
Makefile +1 -0
index ee09856..2cb0ce2 100644
@@ -3222,6 +3222,7 @@ dbau1550_config		:	unconfig
 dbau1550_el_config	:	unconfig
 	@mkdir -p $(obj)include
 	@echo "#define CONFIG_DBAU1550 1" >$(obj)include/config.h
+	@echo "#define CONFIG_CPU_LITTLE_ENDIAN" >>$(obj)include/config.h
 	@$(MKCONFIG) -a dbau1x00 mips mips dbau1x00
 
 gth2_config		:	unconfig

Makefile gth2_config : unconfig · line 3237

Quoted 5 lines
Makefile +1 -0
@@ -3232,6 +3233,7 @@ gth2_config		:	unconfig
 pb1000_config		:	unconfig
 	@mkdir -p $(obj)include
 	@echo "#define CONFIG_PB1000 1" >$(obj)include/config.h
+	@echo "#define CONFIG_CPU_LITTLE_ENDIAN" >>$(obj)include/config.h
 	@$(MKCONFIG) -a pb1x00 mips mips pb1x00

These changes look unrelated to the linker script stuff you mention in the commit message ? If they are related, you should explain what you are doing here, and why.

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 dog always bit deepest on the veterinary hand.
                                    - Terry Pratchett, _Wyrd Sisters_
#2 lore raw

PATCH 1/1 mips: unify lds

Quoted 12 lines · Wolfgang Denk

Dear Jean-Christophe PLAGNIOL-VILLARD,

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

all mips boards except a few use the same cpu lds so move it to cpu/$(CPU)

that could be overwrite in following order
SOC
BOARD
via the corresponding config.mk

I've double checked that consolidation of u-boot.lds files is ok, and LDSCRIPT part as wll.

Quoted 11 lines
Quoted 11 lines
Makefile +1 -0
index ee09856..2cb0ce2 100644
@@ -3222,6 +3222,7 @@ dbau1550_config		:	unconfig
 dbau1550_el_config	:	unconfig
 	@mkdir -p $(obj)include
 	@echo "#define CONFIG_DBAU1550 1" >$(obj)include/config.h
+	@echo "#define CONFIG_CPU_LITTLE_ENDIAN" >>$(obj)include/config.h
 	@$(MKCONFIG) -a dbau1x00 mips mips dbau1x00
 
Quoted 11 lines

Makefile gth2_config : unconfig · line 3237

Quoted 7 lines
Makefile +1 -0
 gth2_config		:	unconfig
@@ -3232,6 +3233,7 @@ gth2_config		:	unconfig
 pb1000_config		:	unconfig
 	@mkdir -p $(obj)include
 	@echo "#define CONFIG_PB1000 1" >$(obj)include/config.h
+	@echo "#define CONFIG_CPU_LITTLE_ENDIAN" >>$(obj)include/config.h
 	@$(MKCONFIG) -a pb1x00 mips mips pb1x00

These changes look unrelated to the linker script stuff you mention in the commit message ? If they are related, you should explain what you are doing here, and why.

This tweaks little endian builds, and used with mips_config.mk change.

+ifdef CONFIG_CPU_LITTLE_ENDIAN
+PREDEF +=-DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__
+PLATFORM_CFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(UNDEF_ALL) $(PREDEF)) +else
+PREDEF += -DMIPSEB -D_MIPSEB -D__MIPSEB -D__MIPSEB__
+PLATFORM_CFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(UNDEF_ALL) $(PREDEF)) +endif

Background is, we're going to have a single, unified u-boot.lds, hence OUTPUT_FORMAT(default, big, little) command would be applied across all supported targets as well. Then, we'd like to pass -EL specifier to the linker so that some little-endian builds are processed properly.

The goal here is,

* Explicitly add the endianness specifier _if_needed_, this allows to compile kernels with a toolchain for the other endianness.

* We carefully avoid to add it redundantly because gcc 3.3/3.4 complains when fed the toolchain default!

* Expected behavior

  # echo mips-linux | grep -q 'mips.*el-.*' || echo -EL
  -EL
  # echo mips-linux | grep -q 'mips.*el-.*' && echo -EB
  # echo mipsel-linux | grep -q 'mips.*el-.*' || echo -EL
  # echo mipsel-linux | grep -q 'mips.*el-.*' && echo -EB
  -EB

* Side-effects

Some LE toolchains with 'mips-linux', will have a redundant -LE. Some BE toolchains with 'mipsel-linux', will have a redundant -BE.

In these cases, you would see a lot of warnings. It's harmless, so I'd like to ignore them as they're minor enough, and consolidation of lds files is more important here. Also note that I believe we would never find the latter case.

So, I'd like to say the patch itself looks basically good. But still some work needs to be done.

* How about splitting the patch into two, 1) CONFIG_CPU_LITTLE_ENDIAN introduction patch, and 2) u-boot.lds consoliation patch ?

* Just wondered, is there any reason why you didn't use PREDEF_{BE,LE} like Linux kernel does?

UNDEF_ALL += -UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ UNDEF_ALL += -UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__

Quoted 2 lines
Quoted 2 lines

PREDEF_BE += -DMIPSEB -D_MIPSEB -D__MIPSEB -D__MIPSEB__<< PREDEF_LE += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__<<

ifdef CONFIG_CPU_LITTLE_ENDIAN
PLATFORM_CFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(UNDEF_ALL) $(PREDEF_LE)) else
PLATFORM_CFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(UNDEF_ALL) $(PREDEF_BE)) endif

* By the way, s/PLATFORM_CFLAGS/PLATFORM_CPPFLAGS/.

* And we need -EL/-EB specifier on PLATFORM_LDFLAGS as well. We call the GNU ld directly on the final link, so $(UNDEF_ALL) and $(PREDEF_??) part probably are not required.

* We need to fix examples/{Makefile,mips.lds} as well.

* We need to remove ENDIANNESS from cpu/mips/config.mk, finally.

  diff --git a/cpu/mips/config.mk b/cpu/mips/config.mk
  index a173c54..098d6c7 100644
  --- a/cpu/mips/config.mk
  +++ b/cpu/mips/config.mk
  @@ -28,12 +28,4 @@ else \
          echo "-march=4kc -mtune=4kc"; \
   fi)
   
  -ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
  -ENDIANNESS = -EL
  -else
  -ENDIANNESS = -EB
  -endif
  -
  -MIPSFLAGS += $(ENDIANNESS)
  -
   PLATFORM_CPPFLAGS += $(MIPSFLAGS)

If there're any problems or objections, I'll work on the patch on my side (to help Jean), and try to queue them toward the next release. Revised patches are welcome, of course.

Shinya

#3 lore raw

PATCH 1/1 mips: unify lds

Quoted 4 lines · Shinya Kuribayashi

Background is, we're going to have a single, unified u-boot.lds, hence OUTPUT_FORMAT(default, big, little) command would be applied across all supported targets as well. Then, we'd like to pass -EL specifier to the linker so that some little-endian builds are processed properly.

Oops, s/linker/compiler/.

#4 lore raw

[U-Boot] *** PROBABLY SPAM *** Re: [PATCH 1/1] mips: unify lds

In reply to Shinya Kuribayashi
Quoted 10 lines

Background is, we're going to have a single, unified u-boot.lds, hence OUTPUT_FORMAT(default, big, little) command would be applied across all supported targets as well. Then, we'd like to pass -EL specifier to the linker so that some little-endian builds are processed properly.

The goal here is,

* Explicitly add the endianness specifier _if_needed_, this allows to compile kernels with a toolchain for the other endianness.

for the kernel they do not use the libgcc at all
this will allow you to compile it in the endianness specifier evenif your toolchain does not support it
but to do this in u-boot we will need to re-implement the div64 to allow a assembly implementation

Quoted 24 lines

* We carefully avoid to add it redundantly because gcc 3.3/3.4 complains when fed the toolchain default!

* Expected behavior

  # echo mips-linux | grep -q 'mips.*el-.*' || echo -EL
  -EL
  # echo mips-linux | grep -q 'mips.*el-.*' && echo -EB
  # echo mipsel-linux | grep -q 'mips.*el-.*' || echo -EL
  # echo mipsel-linux | grep -q 'mips.*el-.*' && echo -EB
  -EB

* Side-effects

Some LE toolchains with 'mips-linux', will have a redundant -LE. Some BE toolchains with 'mipsel-linux', will have a redundant -BE.

In these cases, you would see a lot of warnings. It's harmless, so I'd like to ignore them as they're minor enough, and consolidation of lds files is more important here. Also note that I believe we would never find the latter case.

Quoted 8 lines

So, I'd like to say the patch itself looks basically good. But still some work needs to be done.

* How about splitting the patch into two, 1) CONFIG_CPU_LITTLE_ENDIAN introduction patch, and 2) u-boot.lds consoliation patch ?

* Just wondered, is there any reason why you didn't use PREDEF_{BE,LE} like Linux kernel does?

no just to avaid double define

Quoted 11 lines

UNDEF_ALL += -UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ UNDEF_ALL += -UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__

Quoted 2 lines
Quoted 2 lines

PREDEF_BE += -DMIPSEB -D_MIPSEB -D__MIPSEB -D__MIPSEB__<< PREDEF_LE += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__<<

ifdef CONFIG_CPU_LITTLE_ENDIAN
PLATFORM_CFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(UNDEF_ALL) $(PREDEF_LE)) else
PLATFORM_CFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(UNDEF_ALL) $(PREDEF_BE)) endif

Quoted 5 lines

* By the way, s/PLATFORM_CFLAGS/PLATFORM_CPPFLAGS/.

* And we need -EL/-EB specifier on PLATFORM_LDFLAGS as well. We call the GNU ld directly on the final link, so $(UNDEF_ALL) and $(PREDEF_??) part probably are not required.

yes the PREDEF will not be necessarely

Quoted 23 lines

* We need to fix examples/{Makefile,mips.lds} as well.ind time to work on?

* We need to remove ENDIANNESS from cpu/mips/config.mk, finally.

  diff --git a/cpu/mips/config.mk b/cpu/mips/config.mk
  index a173c54..098d6c7 100644
  --- a/cpu/mips/config.mk
  +++ b/cpu/mips/config.mk
  @@ -28,12 +28,4 @@ else \
          echo "-march=4kc -mtune=4kc"; \
   fi)
   
  -ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
  -ENDIANNESS = -EL
  -else
  -ENDIANNESS = -EB
  -endif
  -
  -MIPSFLAGS += $(ENDIANNESS)
  -
   PLATFORM_CPPFLAGS += $(MIPSFLAGS)
Quoted 3 lines

If there're any problems or objections, I'll work on the patch on my side (to help Jean), and try to queue them toward the next release. Revised patches are welcome, of course.

did you find time to work on?

Best Regards,
J.

#5 lore raw

PATCH v2 1/2 mips: add endianness support

In reply to Shinya Kuribayashi

curently we need to specify the endian of each board in the LDS

in order to unify all of them add full endianness support

by default the mips platforms will be compiled as big-endian to compile it as little-endian define CONFIG_CPU_LITTLE_ENDIAN

---
 Makefile                   |    2 ++
 board/dbau1x00/u-boot.lds  |    5 +----
 board/gth2/u-boot.lds      |    5 +----
 board/incaip/u-boot.lds    |    5 +----
 board/pb1x00/u-boot.lds    |    5 +----
 board/purple/u-boot.lds    |    5 +----
 board/qemu-mips/u-boot.lds |    5 +----
 board/tb0229/u-boot.lds    |    3 +--
 cpu/mips/config.mk         |    9 ---------
 examples/Makefile          |    1 +
 examples/mips.lds          |    5 +----
 mips_config.mk             |   25 +++++++++++++++++++++++++
 12 files changed, 36 insertions(+), 39 deletions(-)
Makefile +2 -0
index 81a5cd0..7729c43 100644
@@ -3236,6 +3236,7 @@ dbau1550_config		:	unconfig
 dbau1550_el_config	:	unconfig
 	@mkdir -p $(obj)include
 	@echo "#define CONFIG_DBAU1550 1" >$(obj)include/config.h
+	@echo "#define CONFIG_CPU_LITTLE_ENDIAN" >>$(obj)include/config.h
 	@$(MKCONFIG) -a dbau1x00 mips mips dbau1x00
 
 gth2_config		:	unconfig
@@ -3246,6 +3247,7 @@ gth2_config		:	unconfig
 pb1000_config		:	unconfig
 	@mkdir -p $(obj)include
 	@echo "#define CONFIG_PB1000 1" >$(obj)include/config.h
+	@echo "#define CONFIG_CPU_LITTLE_ENDIAN" >>$(obj)include/config.h
 	@$(MKCONFIG) -a pb1x00 mips mips pb1x00
 
 qemu_mips_config	: unconfig
board/dbau1x00/u-boot.lds +1 -4
index 9a6cd1b..93c06db 100644
@@ -21,10 +21,7 @@
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
board/gth2/u-boot.lds +1 -4
index e6eee9b..f3b2c85 100644
@@ -21,10 +21,7 @@
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
board/incaip/u-boot.lds +1 -4
index 9a6cd1b..93c06db 100644
@@ -21,10 +21,7 @@
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
board/pb1x00/u-boot.lds +1 -4
index 9a6cd1b..93c06db 100644
@@ -21,10 +21,7 @@
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
board/purple/u-boot.lds +1 -4
index 04a641a..193d8b2 100644
@@ -21,10 +21,7 @@
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
board/qemu-mips/u-boot.lds +1 -4
index ad058ca..7f94b64 100644
@@ -21,10 +21,7 @@
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
board/tb0229/u-boot.lds +1 -2
index 56d7c25..6f21197 100644
@@ -23,8 +23,7 @@
  * MA 02111-1307 USA
  */
 
-OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradlittlemips", "elf32-tradlittlemips")
-
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
cpu/mips/config.mk +0 -9
index a173c54..928b7d8 100644
@@ -28,12 +28,3 @@ else \
 	echo "-march=4kc -mtune=4kc"; \
 fi)
 
-ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
-ENDIANNESS = -EL
-else
-ENDIANNESS = -EB
-endif
-
-MIPSFLAGS += $(ENDIANNESS)
-
-PLATFORM_CPPFLAGS += $(MIPSFLAGS)
examples/Makefile +1 -0
index dbcfa92..cf70d6d 100644
@@ -43,6 +43,7 @@ endif
 
 ifeq ($(ARCH),mips)
 LOAD_ADDR = 0x80200000 -T mips.lds
+EX_LDFLAGS += $(PLATFORM_LDFLAGS)
 endif
 
 ifeq ($(ARCH),nios)
examples/mips.lds +1 -4
index 717b201..9caff00 100644
@@ -21,10 +21,7 @@
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 SECTIONS
 {
mips_config.mk +25 -0
index 05eb05d..423e216 100644
@@ -46,3 +46,28 @@ PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
 PLATFORM_CPPFLAGS		+= -G 0 -mabicalls -fpic
 PLATFORM_CPPFLAGS		+= -msoft-float
 PLATFORM_LDFLAGS		+= -G 0 -static -n -nostdlib
+
+#
+# We explicitly add the endianness specifier if needed, this allows
+# to compile kernels with a toolchain for the other endianness. We
+# carefully avoid to add it redundantly because gcc 3.3/3.4 complains
+# when fed the toolchain default!
+#
+# Certain gcc versions upto gcc 4.1.1 (probably 4.2-subversion as of
+# 2006-10-10 don't properly change the predefined symbols if -EB / -EL
+# are used, so we kludge that here.  A bug has been filed at
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29413.
+#
+
+UNDEF_ALL += -UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__
+UNDEF_ALL += -UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__
+PREDEF_BE += -DMIPSEB -D_MIPSEB -D__MIPSEB -D__MIPSEB__
+PREDEF_LE += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__
+
+ifdef CONFIG_CPU_LITTLE_ENDIAN
+PLATFORM_CPPFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(UNDEF_ALL) $(PREDEF_LE))
+PLATFORM_LDFLAGS += -EL
+else
+PLATFORM_CPPFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(UNDEF_ALL) $(PREDEF_BE))
+PLATFORM_LDFLAGS += -EB
+endif
Signature · 1 line
1.6.3.1
#6 lore raw

PATCH v2 2/2 mips: unify lds

all mips boards except a few use the same cpu lds so move it to cpu/$(CPU)

that could be overwrite in following order
SOC
BOARD
via the corresponding config.mk

---
 board/dbau1x00/u-boot.lds                   |   67 --------------------------
 board/gth2/u-boot.lds                       |   67 --------------------------
 board/incaip/u-boot.lds                     |   67 --------------------------
 board/pb1x00/u-boot.lds                     |   67 --------------------------
 board/purple/config.mk                      |    2 +
 board/qemu-mips/u-boot.lds                  |   69 ---------------------------
 board/tb0229/u-boot.lds                     |   69 ---------------------------
 {board/micronas/vct => cpu/mips}/u-boot.lds |   32 +++++++------
 mips_config.mk                              |    2 +
 9 files changed, 21 insertions(+), 421 deletions(-)
 delete mode 100644 board/dbau1x00/u-boot.lds
 delete mode 100644 board/gth2/u-boot.lds
 delete mode 100644 board/incaip/u-boot.lds
 delete mode 100644 board/pb1x00/u-boot.lds
 delete mode 100644 board/qemu-mips/u-boot.lds
 delete mode 100644 board/tb0229/u-boot.lds
 rename {board/micronas/vct => cpu/mips}/u-boot.lds (75%)
board/dbau1x00/u-boot.lds deleted +0 -67
deleted file mode 100644
index 93c06db..0000000
@@ -1,67 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <[email protected]>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
-OUTPUT_ARCH(mips)
-ENTRY(_start)
-SECTIONS
-{
-	. = 0x00000000;
-
-	. = ALIGN(4);
-	.text       :
-	{
-	  *(.text)
-	}
-
-	. = ALIGN(4);
-	.rodata  : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
-
-	. = ALIGN(4);
-	.data  : { *(.data) }
-
-	. = .;
-	_gp = ALIGN(16) + 0x7ff0;
-
-	.got : {
-	  __got_start = .;
-	  *(.got)
-	  __got_end = .;
-	}
-
-	.sdata  : { *(.sdata) }
-
-	.u_boot_cmd : {
-	  __u_boot_cmd_start = .;
-	  *(.u_boot_cmd)
-	  __u_boot_cmd_end = .;
-	}
-
-	uboot_end_data = .;
-	num_got_entries = (__got_end - __got_start) >> 2;
-
-	. = ALIGN(4);
-	.sbss (NOLOAD)  : { *(.sbss) }
-	.bss (NOLOAD)  : { *(.bss) . = ALIGN(4); }
-	uboot_end = .;
-}
board/gth2/u-boot.lds deleted +0 -67

67 lines not on this page · raw message

board/incaip/u-boot.lds deleted +0 -67

67 lines not on this page · raw message

board/pb1x00/u-boot.lds deleted +0 -67

67 lines not on this page · raw message

board/purple/config.mk +2 -0
index ea478ed..16a55c6 100644
@@ -30,3 +30,5 @@ TEXT_BASE = 0xB0000000
 
 # RAM version
 #TEXT_BASE = 0x80100000
+
+LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
board/qemu-mips/u-boot.lds deleted +0 -69

69 lines not on this page · raw message

board/tb0229/u-boot.lds deleted +0 -69

69 lines not on this page · raw message

cpu/mips/u-boot.lds renamed from board/micronas/vct/u-boot.lds +17 -15
similarity index 75%
rename from board/micronas/vct/u-boot.lds
rename to cpu/mips/u-boot.lds
index b90b186..dda0dda 100644
@@ -1,5 +1,8 @@
 /*
- * (C) Copyright 2003
+ * (C) Copyright 2004
+ * Masami Komiya <[email protected]>
+ *
+ * (C) Copyright 2003-2005
  * Wolfgang Denk Engineering, <[email protected]>
  *
  * See file CREDITS for list of people who contributed to this
@@ -29,34 +32,34 @@ SECTIONS
 	. = 0x00000000;
 
 	. = ALIGN(4);
-	.text       :
+	.text :
 	{
-	  *(.text)
+		*(.text)
 	}
 
 	. = ALIGN(4);
-	.rodata  : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
+	.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
 
 	. = ALIGN(4);
-	.data  : { *(.data) }
+	.data : { *(.data) }
 
 	. = .;
 	_gp = ALIGN(16) + 0x7ff0;
 
 	.got : {
-	  __got_start = .;
-	  *(.got)
-	  __got_end = .;
+		__got_start = .;
+		*(.got)
+		__got_end = .;
 	}
 
 	. = ALIGN(4);
-	.sdata  : { *(.sdata) }
+	.sdata : { *(.sdata) }
 
 	. = ALIGN(4);
 	.u_boot_cmd : {
-	  __u_boot_cmd_start = .;
-	  *(.u_boot_cmd)
-	  __u_boot_cmd_end = .;
+		__u_boot_cmd_start = .;
+		*(.u_boot_cmd)
+		__u_boot_cmd_end = .;
 	}
 
 	. = ALIGN(4);
@@ -64,8 +67,7 @@ SECTIONS
 	num_got_entries = (__got_end - __got_start) >> 2;
 
 	. = ALIGN(4);
-	.sbss (NOLOAD)  : { *(.sbss) }
-	. = ALIGN(4);
-	.bss (NOLOAD)  : { *(.bss) }
+	.sbss (NOLOAD) : { *(.sbss) }
+	.bss (NOLOAD) : { *(.bss) . = ALIGN(4); }
 	uboot_end = .;
 }
mips_config.mk +2 -0
index 423e216..41333d4 100644
@@ -71,3 +71,5 @@ else
 PLATFORM_CPPFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(UNDEF_ALL) $(PREDEF_BE))
 PLATFORM_LDFLAGS += -EB
 endif
+
+LDSCRIPT := $(SRCTREE)/cpu/$(CPU)/u-boot.lds
Signature · 1 line
1.6.3.1
#7 lore raw

PATCH v2 2/2 mips: unify lds

Quoted 8 lines · Jean-Christophe PLAGNIOL-VILLARD

all mips boards except a few use the same cpu lds so move it to cpu/$(CPU)

that could be overwrite in following order
SOC
BOARD
via the corresponding config.mk

Looks good, except for one nit.

Quoted 8 lines
cpu/mips/u-boot.lds renamed from board/micronas/vct/u-boot.lds +0 -0
similarity index 75%
rename from board/micronas/vct/u-boot.lds
rename to cpu/mips/u-boot.lds
index b90b186..dda0dda 100644

cpu/mips/u-boot.lds line 8

Quoted 9 lines
cpu/mips/u-boot.lds renamed from board/micronas/vct/u-boot.lds +4 -1
@@ -1,5 +1,8 @@
 /*
- * (C) Copyright 2003
+ * (C) Copyright 2004
+ * Masami Komiya <[email protected]>
+ *
+ * (C) Copyright 2003-2005
  * Wolfgang Denk Engineering, <[email protected]>
  *
  * See file CREDITS for list of people who contributed to this

You probably just referred to the tb0229/u-boot.lds, but we'd like to see here Wolfgang first.

Shinya

#8 lore raw

PATCH v2 1/2 mips: add endianness support

In reply to Jean-Christophe PLAGNIOL-VILLARD

Hi,

Quoted 22 lines · Jean-Christophe PLAGNIOL-VILLARD

curently we need to specify the endian of each board in the LDS

in order to unify all of them add full endianness support

by default the mips platforms will be compiled as big-endian to compile it as little-endian define CONFIG_CPU_LITTLE_ENDIAN

---
 Makefile                   |    2 ++
 board/dbau1x00/u-boot.lds  |    5 +----
 board/gth2/u-boot.lds      |    5 +----
 board/incaip/u-boot.lds    |    5 +----
 board/pb1x00/u-boot.lds    |    5 +----
 board/purple/u-boot.lds    |    5 +----
 board/qemu-mips/u-boot.lds |    5 +----
 board/tb0229/u-boot.lds    |    3 +--
 cpu/mips/config.mk         |    9 ---------
 examples/Makefile          |    1 +
 examples/mips.lds          |    5 +----
 mips_config.mk             |   25 +++++++++++++++++++++++++
 12 files changed, 36 insertions(+), 39 deletions(-)

[snip]

Quoted 5 lines
cpu/mips/config.mk +0 -0
index a173c54..928b7d8 100644

cpu/mips/config.mk else \ · line 37

Quoted 10 lines
cpu/mips/config.mk +0 -7
@@ -28,12 +28,3 @@ else \
 	echo "-march=4kc -mtune=4kc"; \
 fi)
 
-ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
-ENDIANNESS = -EL
-else
-ENDIANNESS = -EB
-endif
-
-MIPSFLAGS += $(ENDIANNESS)

This is ok, but

cpu/mips/config.mk else \ · line 39

Quoted 2 lines
cpu/mips/config.mk +0 -2
-
-PLATFORM_CPPFLAGS += $(MIPSFLAGS)

I think this wrongly removes -march=4kc -mtune=4kc.

Quoted 23 lines
mips_config.mk +15 -0
index 05eb05d..423e216 100644
@@ -46,3 +46,28 @@ PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
 PLATFORM_CPPFLAGS		+= -G 0 -mabicalls -fpic
 PLATFORM_CPPFLAGS		+= -msoft-float
 PLATFORM_LDFLAGS		+= -G 0 -static -n -nostdlib
+
+#
+# We explicitly add the endianness specifier if needed, this allows
+# to compile kernels with a toolchain for the other endianness. We
+# carefully avoid to add it redundantly because gcc 3.3/3.4 complains
+# when fed the toolchain default!
+#
+# Certain gcc versions upto gcc 4.1.1 (probably 4.2-subversion as of
+# 2006-10-10 don't properly change the predefined symbols if -EB / -EL
+# are used, so we kludge that here.  A bug has been filed at
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29413.
+#
+
+UNDEF_ALL += -UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__
+UNDEF_ALL += -UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__

mips_config.mk PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__ · line 73

Quoted 10 lines
mips_config.mk +10 -0
+PREDEF_BE += -DMIPSEB -D_MIPSEB -D__MIPSEB -D__MIPSEB__
+PREDEF_LE += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__
+
+ifdef CONFIG_CPU_LITTLE_ENDIAN
+PLATFORM_CPPFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(UNDEF_ALL) $(PREDEF_LE))
+PLATFORM_LDFLAGS += -EL
+else
+PLATFORM_CPPFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(UNDEF_ALL) $(PREDEF_BE))
+PLATFORM_LDFLAGS += -EB
+endif

Thanks for resubmitting, but there's one thing I'm warried about. when I gave it a try last time, with almost the same patch you did, I had a GNU make problem. I'll look closely into it, so please wait for some time.

Shinya

#9 lore raw

PATCH v2 1/2 mips: add endianness support

Quoted 45 lines · Shinya Kuribayashi

Hi,

Quoted 22 lines · Jean-Christophe PLAGNIOL-VILLARD

curently we need to specify the endian of each board in the LDS

in order to unify all of them add full endianness support

by default the mips platforms will be compiled as big-endian to compile it as little-endian define CONFIG_CPU_LITTLE_ENDIAN

---
 Makefile                   |    2 ++
 board/dbau1x00/u-boot.lds  |    5 +----
 board/gth2/u-boot.lds      |    5 +----
 board/incaip/u-boot.lds    |    5 +----
 board/pb1x00/u-boot.lds    |    5 +----
 board/purple/u-boot.lds    |    5 +----
 board/qemu-mips/u-boot.lds |    5 +----
 board/tb0229/u-boot.lds    |    3 +--
 cpu/mips/config.mk         |    9 ---------
 examples/Makefile          |    1 +
 examples/mips.lds          |    5 +----
 mips_config.mk             |   25 +++++++++++++++++++++++++
 12 files changed, 36 insertions(+), 39 deletions(-)

[snip]

Quoted 5 lines
cpu/mips/config.mk +0 -0
index a173c54..928b7d8 100644

cpu/mips/config.mk else \ · line 36

Quoted 9 lines
cpu/mips/config.mk +0 -6
@@ -28,12 +28,3 @@ else \
 	echo "-march=4kc -mtune=4kc"; \
 fi)
 -ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
-ENDIANNESS = -EL
-else
-ENDIANNESS = -EB
-endif
-
-MIPSFLAGS += $(ENDIANNESS)

This is ok, but

Quoted 4 lines

cpu/mips/config.mk else \ · line 38

Quoted 2 lines
cpu/mips/config.mk +0 -2
-
-PLATFORM_CPPFLAGS += $(MIPSFLAGS)

I think this wrongly removes -march=4kc -mtune=4kc.

I miss this

Quoted 31 lines
Quoted 31 lines
mips_config.mk +22 -0
index 05eb05d..423e216 100644
@@ -46,3 +46,28 @@ PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
 PLATFORM_CPPFLAGS		+= -G 0 -mabicalls -fpic
 PLATFORM_CPPFLAGS		+= -msoft-float
 PLATFORM_LDFLAGS		+= -G 0 -static -n -nostdlib
+
+#
+# We explicitly add the endianness specifier if needed, this allows
+# to compile kernels with a toolchain for the other endianness. We
+# carefully avoid to add it redundantly because gcc 3.3/3.4 complains
+# when fed the toolchain default!
+#
+# Certain gcc versions upto gcc 4.1.1 (probably 4.2-subversion as of
+# 2006-10-10 don't properly change the predefined symbols if -EB / -EL
+# are used, so we kludge that here.  A bug has been filed at
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29413.
+#
+
+UNDEF_ALL += -UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__
+UNDEF_ALL += -UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__
+PREDEF_BE += -DMIPSEB -D_MIPSEB -D__MIPSEB -D__MIPSEB__
+PREDEF_LE += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__
+
+ifdef CONFIG_CPU_LITTLE_ENDIAN
+PLATFORM_CPPFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(UNDEF_ALL) $(PREDEF_LE))
+PLATFORM_LDFLAGS += -EL
+else
Quoted 8 lines

mips_config.mk PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__ · line 73

Quoted 3 lines
mips_config.mk +3 -0
+PLATFORM_CPPFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(UNDEF_ALL) $(PREDEF_BE))
+PLATFORM_LDFLAGS += -EB
+endif

Thanks for resubmitting, but there's one thing I'm warried about. when I gave it a try last time, with almost the same patch you did, I had a GNU make problem. I'll look closely into it, so please wait for some time.

which one?

Best Regards,
J.

#10 lore raw

PATCH v2 1/2 mips: add endianness support

Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 4 lines · Shinya Kuribayashi

Thanks for resubmitting, but there's one thing I'm warried about. when I gave it a try last time, with almost the same patch you did, I had a GNU make problem. I'll look closely into it, so please wait for some time.

which one?

First build attempt failed to complete the final linking because wrong endianness specifier was passed. However, one more try and you'll see it got built where correct specifier (-EL) was there.

---

$ mips-linux-gnu-gcc --version
mips-linux-gnu-gcc (Sourcery G++ Lite 4.3-154) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ mips-linux-gnu-gcc -dumpmachine
mips-linux-gnu
$ make dbau1550_el_config CROSS_COMPILE=mips-linux-gnu-
Configuring for dbau1x00 board...
$ make  CROSS_COMPILE=mips-linux-gnu-

[...]

make -C examples all
make[1]: Entering directory `/home/skuribay/git/u-boot.git/examples'

mips-linux-gnu-gcc -g  -Os   -D__KERNEL__ -DTEXT_BASE=0xbfc00000 -I/home/skuribay/git/u-boot.git/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/mips-4.3-154/bin/../lib/gcc/mips-linux-gnu/4.3.3/include -pipe  -DCONFIG_MIPS -D__MIPS__ -G 0 -mabicalls -fpic -msoft-float -EL -UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__ -Wall -Wstrict-prototypes -fno-stack-protector -c -o hello_world.o hello_world.c
mips-linux-gnu-gcc -g  -Os   -D__KERNEL__ -DTEXT_BASE=0xbfc00000 -I/home/skuribay/git/u-boot.git/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/mips-4.3-154/bin/../lib/gcc/mips-linux-gnu/4.3.3/include -pipe  -DCONFIG_MIPS -D__MIPS__ -G 0 -mabicalls -fpic -msoft-float -EL -UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__ -Wall -Wstrict-prototypes -fno-stack-protector -c -o stubs.o stubs.c
mips-linux-gnu-ar crv libstubs.a stubs.o
a - stubs.o
mips-linux-gnu-ld -g  -G 0 -static -n -nostdlib -EL -Ttext 0x80200000 -T mips.lds \
			-o hello_world -e hello_world hello_world.o libstubs.a \
			-L/opt/mips-4.3-154/bin/../lib/gcc/mips-linux-gnu/4.3.3 -lgcc

mips-linux-gnu-objcopy -O srec hello_world hello_world.srec 2>/dev/null mips-linux-gnu-objcopy -O binary hello_world hello_world.bin 2>/dev/null make[1]: Leaving directory `/home/skuribay/git/u-boot.git/examples'

[...]

make -C /home/skuribay/git/u-boot.git/cpu/mips/ u-boot.lds
make[1]: Entering directory `/home/skuribay/git/u-boot.git/cpu/mips'
make[1]: Nothing to be done for `u-boot.lds'.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/cpu/mips'
UNDEF_SYM=`mips-linux-gnu-objdump -x board/dbau1x00/libdbau1x00.a lib_generic/libgeneric.a lib_generic/lzma/liblzma.a lib_generic/lzo/liblzo.a cpu/mips/libmips.a lib_mips/libmips.a 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 net/libnet.a disk/libdisk.a drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a drivers/dma/libdma.a drivers/fpga/libfpga.a drivers/gpio/libgpio.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a drivers/input/libinput.a drivers/misc/libmisc.a drivers/mmc/libmmc.a drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a drivers/mtd/onenand/libonenand.a drivers/mtd/ubi/libubi.a drivers/mtd/spi/libspi_flash.a drivers/net/libnet.a drivers/net/phy/libphy.a drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a drivers/serial/libserial.

a drivers/twserial/libtws.a drivers/usb/gadget/libusb_gadget.a drivers/usb/host/libusb_host.a drivers/usb/musb/libusb_musb.a drivers/video/libvideo.a drivers/watchdog/libwatchdog.a common/libcommon.a libfdt/libfdt.a api/libapi.a post/libpost.a | \
		sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
		cd /home/skuribay/git/u-boot.git && mips-linux-gnu-ld -Bstatic -T /home/skuribay/git/u-boot.git/cpu/mips/u-boot.lds  -G 0 -static -n -nostdlib -EB -Ttext 0xbfc00000 $UNDEF_SYM cpu/mips/start.o \
			--start-group lib_generic/libgeneric.a lib_generic/lzma/liblzma.a lib_generic/lzo/liblzo.a cpu/mips/libmips.a lib_mips/libmips.a 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 net/libnet.a disk/libdisk.a drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a drivers/dma/libdma.a drivers/fpga/libfpga.a drivers/gpio/libgpio.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a drivers/input/libinput.a drivers/misc/libmisc.a drivers/mmc/libmmc.a drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a drivers/mtd/onenand/libonenand.a drivers/mtd/ubi/libubi.a drivers/mtd/spi/libspi_flash.a drivers/net/libnet.a drivers/net/phy/libphy.a drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a drivers/serial/libserial.a drivers/twserial/libtws.a drivers/usb/gadget/li

busb_gadget.a drivers/usb/host/libusb_host.a drivers/usb/musb/libusb_musb.a drivers/video/libvideo.a drivers/watchdog/libwatchdog.a common/libcommon.a libfdt/libfdt.a api/libapi.a post/libpost.a board/dbau1x00/libdbau1x00.a --end-group -L /opt/mips-4.3-154/bin/../lib/gcc/mips-linux-gnu/4.3.3/soft-float -lgcc \
-Map u-boot.map -o u-boot
mips-linux-gnu-ld: Warning: size of symbol `cpu_eth_init' changed from 56 in cpu/mips/libmips.a(cpu.o) to 8 in net/libnet.a(eth.o)
mips-linux-gnu-ld: cpu/mips/start.o: compiled for a little endian system and target is big endian
mips-linux-gnu-ld: cpu/mips/start.o: endianness incompatible with that of the selected emulation
mips-linux-gnu-ld: failed to merge target specific data of file cpu/mips/start.o
mips-linux-gnu-ld: cpu/mips/libmips.a(cache.o): compiled for a little endian system and target is big endian
mips-linux-gnu-ld: cpu/mips/libmips.a(cache.o): endianness incompatible with that of the selected emulation
mips-linux-gnu-ld: failed to merge target specific data of file cpu/mips/libmips.a(cache.o)

[...]

mips-linux-gnu-ld: cpu/mips/libmips.a(au1x00_serial.o): endianness incompatible with that of the selected emulation
mips-linux-gnu-ld: failed to merge target specific data of file cpu/mips/libmips.a(au1x00_serial.o)
mips-linux-gnu-ld: lib_mips/libmips.a(bootm.o): compiled for a little endian system and target is big endian
mips-linux-gnu-ld: lib_mips/libmips.a(bootm.o): endianness incompatible with that of the selected emulation
mips-linux-gnu-ld: failed to merge target specific data of file lib_mips/libmips.a(bootm.o)
mips-linux-gnu-ld: drivers/rtc/librtc.a(date.o): compiled for a little endian system and target is big endian
mips-linux-gnu-ld: drivers/rtc/librtc.a(date.o): endianness incompatible with that of the selected emulation
mips-linux-gnu-ld: failed to merge target specific data of file drivers/rtc/librtc.a(date.o)
/bin/bash: line 4: 19904 Segmentation fault mips-linux-gnu-ld -Bstatic -T /home/skuribay/git/u-boot.git/cpu/mips/u-boot.lds -G 0 -static -n -nostdlib -EB -Ttext 0xbfc00000 $UNDEF_SYM cpu/mips/start.o --start-group lib_generic/libgeneric.a lib_generic/lzma/liblzma.a lib_generic/lzo/liblzo.a cpu/mips/libmips.a lib_mips/libmips.a 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 net/libnet.a disk/libdisk.a drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a drivers/dma/libdma.a drivers/fpga/libfpga.a drivers/gpio/libgpio.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a drivers/input/libinput.a drivers/misc/libmisc.a drivers/mmc/libmmc.a drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a drivers/mtd/onenand/libonenand.a drivers/mtd/ubi/libubi.a drivers/mtd/spi/libspi_flash.a drivers/net/libnet.a drivers/net/phy/libp
hy.a drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a drivers/serial/libserial.a drivers/twserial/libtws.a drivers/usb/gadget/libusb_gadget.a drivers/usb/host/libusb_host.a drivers/usb/musb/libusb_musb.a drivers/video/libvideo.a drivers/watchdog/libwatchdog.a common/libcommon.a libfdt/libfdt.a api/libapi.a post/libpost.a board/dbau1x00/libdbau1x00.a --end-group -L /opt/mips-4.3-154/bin/../lib/gcc/mips-linux-gnu/4.3.3/soft-float -lgcc -Map u-boot.map -o u-boot
make: *** [u-boot] Error 139
$
$

$ make  CROSS_COMPILE=mips-linux-gnu-
for dir in tools examples api_examples ; do make -C $dir _depend ; done
make[1]: Entering directory `/home/skuribay/git/u-boot.git/tools'
make[1]: Nothing to be done for `_depend'.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/tools'
make[1]: Entering directory `/home/skuribay/git/u-boot.git/examples'
make[1]: Nothing to be done for `_depend'.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/examples'
make[1]: Entering directory `/home/skuribay/git/u-boot.git/api_examples'
make[1]: Nothing to be done for `_depend'.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/api_examples'
make -C tools all
make[1]: Entering directory `/home/skuribay/git/u-boot.git/tools'
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/tools'
make -C examples all
make[1]: Entering directory `/home/skuribay/git/u-boot.git/examples'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/examples'
make -C api_examples all
make[1]: Entering directory `/home/skuribay/git/u-boot.git/api_examples'
mips-linux-gnu-ar crv libglue.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/api_examples'
make -C cpu/mips start.o
make[1]: Entering directory `/home/skuribay/git/u-boot.git/cpu/mips'
make[1]: `start.o' is up to date.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/cpu/mips'
make -C lib_generic/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/lib_generic'
make[1]: `libgeneric.a' is up to date.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/lib_generic'
make -C lib_generic/lzma/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/lib_generic/lzma'
mips-linux-gnu-ar crv liblzma.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/lib_generic/lzma'
make -C lib_generic/lzo/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/lib_generic/lzo'
mips-linux-gnu-ar crv liblzo.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/lib_generic/lzo'
make -C cpu/mips/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/cpu/mips'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/cpu/mips'
make -C lib_mips/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/lib_mips'
mips-linux-gnu-gcc -g  -Os   -D__KERNEL__ -DTEXT_BASE=0xbfc00000 -I/home/skuribay/git/u-boot.git/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/mips-4.3-154/bin/../lib/gcc/mips-linux-gnu/4.3.3/include -pipe  -DCONFIG_MIPS -D__MIPS__ -G 0 -mabicalls -fpic -msoft-float -EL -UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__ -Wall -Wstrict-prototypes -fno-stack-protector -c -o board.o board.c
mips-linux-gnu-ar crv libmips.a board.o bootm.o time.o
r - board.o
r - bootm.o
r - time.o
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/lib_mips'
make -C fs/cramfs/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/fs/cramfs'
mips-linux-gnu-ar crv libcramfs.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/fs/cramfs'
make -C fs/fat/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/fs/fat'
mips-linux-gnu-ar crv libfat.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/fs/fat'
make -C fs/fdos/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/fs/fdos'
mips-linux-gnu-ar crv libfdos.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/fs/fdos'
make -C fs/jffs2/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/fs/jffs2'
mips-linux-gnu-ar crv libjffs2.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/fs/jffs2'
make -C fs/reiserfs/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/fs/reiserfs'
mips-linux-gnu-ar crv libreiserfs.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/fs/reiserfs'
make -C fs/ext2/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/fs/ext2'
mips-linux-gnu-ar crv libext2fs.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/fs/ext2'
make -C fs/yaffs2/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/fs/yaffs2'
mips-linux-gnu-ar crv libyaffs2.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/fs/yaffs2'
make -C fs/ubifs/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/fs/ubifs'
mips-linux-gnu-ar crv libubifs.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/fs/ubifs'
make -C net/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/net'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/net'
make -C disk/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/disk'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/disk'
make -C drivers/bios_emulator/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/bios_emulator'
mips-linux-gnu-ar crv libatibiosemu.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/bios_emulator'
make -C drivers/block/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/block'
mips-linux-gnu-ar crv libblock.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/block'
make -C drivers/dma/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/dma'
mips-linux-gnu-ar crv libdma.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/dma'
make -C drivers/fpga/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/fpga'
mips-linux-gnu-ar crv libfpga.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/fpga'
make -C drivers/gpio/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/gpio'
mips-linux-gnu-ar crv libgpio.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/gpio'
make -C drivers/hwmon/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/hwmon'
mips-linux-gnu-ar crv libhwmon.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/hwmon'
make -C drivers/i2c/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/i2c'
mips-linux-gnu-ar crv libi2c.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/i2c'
make -C drivers/input/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/input'
mips-linux-gnu-ar crv libinput.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/input'
make -C drivers/misc/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/misc'
mips-linux-gnu-ar crv libmisc.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/misc'
make -C drivers/mmc/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/mmc'
mips-linux-gnu-ar crv libmmc.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/mmc'
make -C drivers/mtd/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/mtd'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/mtd'
make -C drivers/mtd/nand/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/mtd/nand'
mips-linux-gnu-ar crv libnand.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/mtd/nand'
make -C drivers/mtd/nand_legacy/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/mtd/nand_legacy'
mips-linux-gnu-ar crv libnand_legacy.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/mtd/nand_legacy'
make -C drivers/mtd/onenand/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/mtd/onenand'
mips-linux-gnu-ar crv libonenand.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/mtd/onenand'
make -C drivers/mtd/ubi/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/mtd/ubi'
mips-linux-gnu-ar crv libubi.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/mtd/ubi'
make -C drivers/mtd/spi/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/mtd/spi'
mips-linux-gnu-ar crv libspi_flash.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/mtd/spi'
make -C drivers/net/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/net'
mips-linux-gnu-ar crv libnet.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/net'
make -C drivers/net/phy/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/net/phy'
mips-linux-gnu-ar crv libphy.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/net/phy'
make -C drivers/net/sk98lin/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/net/sk98lin'
mips-linux-gnu-ar crv libsk98lin.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/net/sk98lin'
make -C drivers/pci/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/pci'
mips-linux-gnu-ar crv libpci.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/pci'
make -C drivers/pcmcia/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/pcmcia'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/pcmcia'
make -C drivers/spi/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/spi'
mips-linux-gnu-ar crv libspi.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/spi'
make -C drivers/rtc/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/rtc'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/rtc'
make -C drivers/serial/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/serial'
mips-linux-gnu-ar crv libserial.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/serial'
make -C drivers/twserial/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/twserial'
mips-linux-gnu-ar crv libtws.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/twserial'
make -C drivers/usb/gadget/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/usb/gadget'
mips-linux-gnu-ar crv libusb_gadget.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/usb/gadget'
make -C drivers/usb/host/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/usb/host'
mips-linux-gnu-ar crv libusb_host.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/usb/host'
make -C drivers/usb/musb/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/usb/musb'
mips-linux-gnu-ar crv libusb_musb.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/usb/musb'
make -C drivers/video/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/video'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/video'
make -C drivers/watchdog/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/drivers/watchdog'
mips-linux-gnu-ar crv libwatchdog.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/drivers/watchdog'
make -C common/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/common'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/common'
make -C libfdt/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/libfdt'
mips-linux-gnu-ar crv libfdt.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/libfdt'
make -C api/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/api'
mips-linux-gnu-ar crv libapi.a 
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/api'
make -C post/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/post'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/post'
make -C board/dbau1x00/
make[1]: Entering directory `/home/skuribay/git/u-boot.git/board/dbau1x00'
make[1]: `libdbau1x00.a' is up to date.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/board/dbau1x00'
make -C /home/skuribay/git/u-boot.git/cpu/mips/ u-boot.lds
make[1]: Entering directory `/home/skuribay/git/u-boot.git/cpu/mips'
make[1]: Nothing to be done for `u-boot.lds'.
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/cpu/mips'
UNDEF_SYM=`mips-linux-gnu-objdump -x board/dbau1x00/libdbau1x00.a lib_generic/libgeneric.a lib_generic/lzma/liblzma.a lib_generic/lzo/liblzo.a cpu/mips/libmips.a lib_mips/libmips.a 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 net/libnet.a disk/libdisk.a drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a drivers/dma/libdma.a drivers/fpga/libfpga.a drivers/gpio/libgpio.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a drivers/input/libinput.a drivers/misc/libmisc.a drivers/mmc/libmmc.a drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a drivers/mtd/onenand/libonenand.a drivers/mtd/ubi/libubi.a drivers/mtd/spi/libspi_flash.a drivers/net/libnet.a drivers/net/phy/libphy.a drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a drivers/serial/libserial.
a drivers/twserial/libtws.a drivers/usb/gadget/libusb_gadget.a drivers/usb/host/libusb_host.a drivers/usb/musb/libusb_musb.a drivers/video/libvideo.a drivers/watchdog/libwatchdog.a common/libcommon.a libfdt/libfdt.a api/libapi.a post/libpost.a | \
		sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
		cd /home/skuribay/git/u-boot.git && mips-linux-gnu-ld -Bstatic -T /home/skuribay/git/u-boot.git/cpu/mips/u-boot.lds  -G 0 -static -n -nostdlib -EL -Ttext 0xbfc00000 $UNDEF_SYM cpu/mips/start.o \
			--start-group lib_generic/libgeneric.a lib_generic/lzma/liblzma.a lib_generic/lzo/liblzo.a cpu/mips/libmips.a lib_mips/libmips.a 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 net/libnet.a disk/libdisk.a drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a drivers/dma/libdma.a drivers/fpga/libfpga.a drivers/gpio/libgpio.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a drivers/input/libinput.a drivers/misc/libmisc.a drivers/mmc/libmmc.a drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a drivers/mtd/onenand/libonenand.a drivers/mtd/ubi/libubi.a drivers/mtd/spi/libspi_flash.a drivers/net/libnet.a drivers/net/phy/libphy.a drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a drivers/serial/libserial.a drivers/twserial/libtws.a drivers/usb/gadget/li
busb_gadget.a drivers/usb/host/libusb_host.a drivers/usb/musb/libusb_musb.a drivers/video/libvideo.a drivers/watchdog/libwatchdog.a common/libcommon.a libfdt/libfdt.a api/libapi.a post/libpost.a board/dbau1x00/libdbau1x00.a --end-group -L /opt/mips-4.3-154/bin/../lib/gcc/mips-linux-gnu/4.3.3/soft-float/el -lgcc \
			-Map u-boot.map -o u-boot
mips-linux-gnu-objcopy -O srec u-boot u-boot.srec
mips-linux-gnu-objcopy --gap-fill=0xff -O binary u-boot u-boot.bin
$ 
#11 lore raw

PATCH v2 1/2 mips: add endianness support

Quoted 11 lines · Shinya Kuribayashi
Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 4 lines · Shinya Kuribayashi

Thanks for resubmitting, but there's one thing I'm warried about. when I gave it a try last time, with almost the same patch you did, I had a GNU make problem. I'll look closely into it, so please wait for some time.

which one?

First build attempt failed to complete the final linking because wrong endianness specifier was passed. However, one more try and you'll see it got built where correct specifier (-EL) was there.

I've found why. It's due to the fact that we do not include the autoconf.mk in the Makefile at the first run as they do not exist

see V3

Best Regards,
J.

#12 lore raw

PATCH 1/3 fix: missing autoconfig.mk from general Makefile

In reply to Shinya Kuribayashi

at the first run of make we generate the autoconf.mk and autoconf.mk.dep if not already the case and we currently include only to .dep

in order to use these autogenerated value we need to include it also evenif it's include in config.mk but it's done before there generation

---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Makefile +1 -0
index 81a5cd0..7f3776e 100644
@@ -475,6 +475,7 @@ $(obj)include/autoconf.mk: $(obj)include/config.h
 	mv [email protected] $@
 
 sinclude $(obj)include/autoconf.mk.dep
+sinclude $(obj)include/autoconf.mk
 
 #########################################################################
 else	# !config.mk
Signature · 1 line
1.6.3.1
#13 lore raw

PATCH 2/3 mips: add endianness support

curently we need to specify the endian of each board in the LDS

in order to unify all of them add full endianness support

by default the mips platforms will be compiled as big-endian to compile it as little-endian define CONFIG_CPU_LITTLE_ENDIAN

---
 Makefile                   |    2 ++
 board/dbau1x00/u-boot.lds  |    5 +----
 board/gth2/u-boot.lds      |    5 +----
 board/incaip/u-boot.lds    |    5 +----
 board/pb1x00/u-boot.lds    |    5 +----
 board/purple/u-boot.lds    |    5 +----
 board/qemu-mips/u-boot.lds |    5 +----
 board/tb0229/u-boot.lds    |    3 +--
 cpu/mips/config.mk         |    8 --------
 examples/Makefile          |    1 +
 examples/mips.lds          |    5 +----
 mips_config.mk             |   25 +++++++++++++++++++++++++
 12 files changed, 36 insertions(+), 38 deletions(-)
Makefile +2 -0
index 7f3776e..929cae7 100644
@@ -3237,6 +3237,7 @@ dbau1550_config		:	unconfig
 dbau1550_el_config	:	unconfig
 	@mkdir -p $(obj)include
 	@echo "#define CONFIG_DBAU1550 1" >$(obj)include/config.h
+	@echo "#define CONFIG_CPU_LITTLE_ENDIAN" >>$(obj)include/config.h
 	@$(MKCONFIG) -a dbau1x00 mips mips dbau1x00
 
 gth2_config		:	unconfig
@@ -3247,6 +3248,7 @@ gth2_config		:	unconfig
 pb1000_config		:	unconfig
 	@mkdir -p $(obj)include
 	@echo "#define CONFIG_PB1000 1" >$(obj)include/config.h
+	@echo "#define CONFIG_CPU_LITTLE_ENDIAN" >>$(obj)include/config.h
 	@$(MKCONFIG) -a pb1x00 mips mips pb1x00
 
 qemu_mips_config	: unconfig
board/dbau1x00/u-boot.lds +1 -4
index 9a6cd1b..93c06db 100644
@@ -21,10 +21,7 @@
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
board/gth2/u-boot.lds +1 -4
index e6eee9b..f3b2c85 100644
@@ -21,10 +21,7 @@
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
board/incaip/u-boot.lds +1 -4
index 9a6cd1b..93c06db 100644
@@ -21,10 +21,7 @@
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
board/pb1x00/u-boot.lds +1 -4
index 9a6cd1b..93c06db 100644
@@ -21,10 +21,7 @@
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
board/purple/u-boot.lds +1 -4
index 04a641a..193d8b2 100644
@@ -21,10 +21,7 @@
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
board/qemu-mips/u-boot.lds +1 -4
index ad058ca..7f94b64 100644
@@ -21,10 +21,7 @@
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
board/tb0229/u-boot.lds +1 -2
index 56d7c25..6f21197 100644
@@ -23,8 +23,7 @@
  * MA 02111-1307 USA
  */
 
-OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradlittlemips", "elf32-tradlittlemips")
-
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
cpu/mips/config.mk +0 -8
index a173c54..098d6c7 100644
@@ -28,12 +28,4 @@ else \
 	echo "-march=4kc -mtune=4kc"; \
 fi)
 
-ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
-ENDIANNESS = -EL
-else
-ENDIANNESS = -EB
-endif
-
-MIPSFLAGS += $(ENDIANNESS)
-
 PLATFORM_CPPFLAGS += $(MIPSFLAGS)
examples/Makefile +1 -0
index dbcfa92..cf70d6d 100644
@@ -43,6 +43,7 @@ endif
 
 ifeq ($(ARCH),mips)
 LOAD_ADDR = 0x80200000 -T mips.lds
+EX_LDFLAGS += $(PLATFORM_LDFLAGS)
 endif
 
 ifeq ($(ARCH),nios)
examples/mips.lds +1 -4
index 717b201..9caff00 100644
@@ -21,10 +21,7 @@
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 SECTIONS
 {
mips_config.mk +25 -0
index 05eb05d..423e216 100644
@@ -46,3 +46,28 @@ PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
 PLATFORM_CPPFLAGS		+= -G 0 -mabicalls -fpic
 PLATFORM_CPPFLAGS		+= -msoft-float
 PLATFORM_LDFLAGS		+= -G 0 -static -n -nostdlib
+
+#
+# We explicitly add the endianness specifier if needed, this allows
+# to compile kernels with a toolchain for the other endianness. We
+# carefully avoid to add it redundantly because gcc 3.3/3.4 complains
+# when fed the toolchain default!
+#
+# Certain gcc versions upto gcc 4.1.1 (probably 4.2-subversion as of
+# 2006-10-10 don't properly change the predefined symbols if -EB / -EL
+# are used, so we kludge that here.  A bug has been filed at
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29413.
+#
+
+UNDEF_ALL += -UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__
+UNDEF_ALL += -UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__
+PREDEF_BE += -DMIPSEB -D_MIPSEB -D__MIPSEB -D__MIPSEB__
+PREDEF_LE += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__
+
+ifdef CONFIG_CPU_LITTLE_ENDIAN
+PLATFORM_CPPFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(UNDEF_ALL) $(PREDEF_LE))
+PLATFORM_LDFLAGS += -EL
+else
+PLATFORM_CPPFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(UNDEF_ALL) $(PREDEF_BE))
+PLATFORM_LDFLAGS += -EB
+endif
Signature · 1 line
1.6.3.1
#14 lore raw

PATCH 3/3 mips: unify lds

all mips boards except a few use the same cpu lds so move it to cpu/$(CPU)

that could be overwrite in following order
SOC
BOARD
via the corresponding config.mk

---
 board/dbau1x00/u-boot.lds                   |   67 --------------------------
 board/gth2/u-boot.lds                       |   67 --------------------------
 board/incaip/u-boot.lds                     |   67 --------------------------
 board/pb1x00/u-boot.lds                     |   67 --------------------------
 board/purple/config.mk                      |    2 +
 board/qemu-mips/u-boot.lds                  |   69 ---------------------------
 board/tb0229/u-boot.lds                     |   69 ---------------------------
 {board/micronas/vct => cpu/mips}/u-boot.lds |   32 +++++++------
 mips_config.mk                              |    2 +
 9 files changed, 21 insertions(+), 421 deletions(-)
 delete mode 100644 board/dbau1x00/u-boot.lds
 delete mode 100644 board/gth2/u-boot.lds
 delete mode 100644 board/incaip/u-boot.lds
 delete mode 100644 board/pb1x00/u-boot.lds
 delete mode 100644 board/qemu-mips/u-boot.lds
 delete mode 100644 board/tb0229/u-boot.lds
 rename {board/micronas/vct => cpu/mips}/u-boot.lds (75%)
board/dbau1x00/u-boot.lds deleted +0 -67
deleted file mode 100644
index 93c06db..0000000
@@ -1,67 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <[email protected]>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
-OUTPUT_ARCH(mips)
-ENTRY(_start)
-SECTIONS
-{
-	. = 0x00000000;
-
-	. = ALIGN(4);
-	.text       :
-	{
-	  *(.text)
-	}
-
-	. = ALIGN(4);
-	.rodata  : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
-
-	. = ALIGN(4);
-	.data  : { *(.data) }
-
-	. = .;
-	_gp = ALIGN(16) + 0x7ff0;
-
-	.got : {
-	  __got_start = .;
-	  *(.got)
-	  __got_end = .;
-	}
-
-	.sdata  : { *(.sdata) }
-
-	.u_boot_cmd : {
-	  __u_boot_cmd_start = .;
-	  *(.u_boot_cmd)
-	  __u_boot_cmd_end = .;
-	}
-
-	uboot_end_data = .;
-	num_got_entries = (__got_end - __got_start) >> 2;
-
-	. = ALIGN(4);
-	.sbss (NOLOAD)  : { *(.sbss) }
-	.bss (NOLOAD)  : { *(.bss) . = ALIGN(4); }
-	uboot_end = .;
-}
board/gth2/u-boot.lds deleted +0 -67

67 lines not on this page · raw message

board/incaip/u-boot.lds deleted +0 -67

67 lines not on this page · raw message

board/pb1x00/u-boot.lds deleted +0 -67

67 lines not on this page · raw message

board/purple/config.mk +2 -0
index ea478ed..16a55c6 100644
@@ -30,3 +30,5 @@ TEXT_BASE = 0xB0000000
 
 # RAM version
 #TEXT_BASE = 0x80100000
+
+LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
board/qemu-mips/u-boot.lds deleted +0 -69

69 lines not on this page · raw message

board/tb0229/u-boot.lds deleted +0 -69

69 lines not on this page · raw message

cpu/mips/u-boot.lds renamed from board/micronas/vct/u-boot.lds +17 -15
similarity index 75%
rename from board/micronas/vct/u-boot.lds
rename to cpu/mips/u-boot.lds
index b90b186..dda0dda 100644
@@ -1,5 +1,8 @@
 /*
- * (C) Copyright 2003
+ * (C) Copyright 2004
+ * Masami Komiya <[email protected]>
+ *
+ * (C) Copyright 2003-2005
  * Wolfgang Denk Engineering, <[email protected]>
  *
  * See file CREDITS for list of people who contributed to this
@@ -29,34 +32,34 @@ SECTIONS
 	. = 0x00000000;
 
 	. = ALIGN(4);
-	.text       :
+	.text :
 	{
-	  *(.text)
+		*(.text)
 	}
 
 	. = ALIGN(4);
-	.rodata  : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
+	.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
 
 	. = ALIGN(4);
-	.data  : { *(.data) }
+	.data : { *(.data) }
 
 	. = .;
 	_gp = ALIGN(16) + 0x7ff0;
 
 	.got : {
-	  __got_start = .;
-	  *(.got)
-	  __got_end = .;
+		__got_start = .;
+		*(.got)
+		__got_end = .;
 	}
 
 	. = ALIGN(4);
-	.sdata  : { *(.sdata) }
+	.sdata : { *(.sdata) }
 
 	. = ALIGN(4);
 	.u_boot_cmd : {
-	  __u_boot_cmd_start = .;
-	  *(.u_boot_cmd)
-	  __u_boot_cmd_end = .;
+		__u_boot_cmd_start = .;
+		*(.u_boot_cmd)
+		__u_boot_cmd_end = .;
 	}
 
 	. = ALIGN(4);
@@ -64,8 +67,7 @@ SECTIONS
 	num_got_entries = (__got_end - __got_start) >> 2;
 
 	. = ALIGN(4);
-	.sbss (NOLOAD)  : { *(.sbss) }
-	. = ALIGN(4);
-	.bss (NOLOAD)  : { *(.bss) }
+	.sbss (NOLOAD) : { *(.sbss) }
+	.bss (NOLOAD) : { *(.bss) . = ALIGN(4); }
 	uboot_end = .;
 }
mips_config.mk +2 -0
index 423e216..41333d4 100644
@@ -71,3 +71,5 @@ else
 PLATFORM_CPPFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(UNDEF_ALL) $(PREDEF_BE))
 PLATFORM_LDFLAGS += -EB
 endif
+
+LDSCRIPT := $(SRCTREE)/cpu/$(CPU)/u-boot.lds
Signature · 1 line
1.6.3.1
#15 lore raw

PATCH 3/3 mips: unify lds

Dear Jean-Christophe PLAGNIOL-VILLARD,

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

all mips boards except a few use the same cpu lds so move it to cpu/$(CPU)

that could be overwrite in following order
SOC
BOARD
via the corresponding config.mk

NAK.

Please use complete words and understandable language for commit messages. Avoid home-made abbreviations that nobody else uses.

Best regards,

Wolfgang Denk

Signature · 4 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
When all is said and done, more is said than done.
#16 lore raw

PATCH 2/3 mips: add endianness support

In reply to Jean-Christophe PLAGNIOL-VILLARD

Dear Jean-Christophe PLAGNIOL-VILLARD,

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

curently we need to specify the endian of each board in the LDS

in order to unify all of them add full endianness support

by default the mips platforms will be compiled as big-endian to compile it as little-endian define CONFIG_CPU_LITTLE_ENDIAN

Is this patch number (2 of 3) a misnomer?

I cannot make heads nor tails of this patch.

It seems to be a new version of a previously submitted patch, but it is not marked as such?

Best regards,

Wolfgang Denk

Signature · 4 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
Thought for the day: What if there were no hypothetical situations?
#17 lore raw

PATCH 1/3 fix: missing autoconfig.mk from general Makefile

In reply to Jean-Christophe PLAGNIOL-VILLARD

Dear Jean-Christophe PLAGNIOL-VILLARD,

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

at the first run of make we generate the autoconf.mk and autoconf.mk.dep if not already the case and we currently include only to .dep

in order to use these autogenerated value we need to include it also evenif it's include in config.mk but it's done before there generation

Can you please explain which exact problem you are fixing here? I. e. can you please show an error case that gets fixed by this change?

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
That Microsoft, the Trabant of the operating  system  world,  may  be
glancing  over the Berlin Wall at the Audis and BMWs and Mercedes. In
their own universe Trabants and Ladas were mainstream too...
                                                   -- Evan Leibovitch
#18 lore raw

PATCH 1/3 fix: missing autoconfig.mk from general Makefile

Quoted 6 lines · Wolfgang Denk

Dear Jean-Christophe PLAGNIOL-VILLARD,

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

at the first run of make we generate the autoconf.mk and autoconf.mk.dep if not already the case and we currently include only to .dep

Quoted 6 lines
Quoted 4 lines

in order to use these autogenerated value we need to include it also evenif it's include in config.mk but it's done before there generation

Can you please explain which exact problem you are fixing here? I. e.

in order to use these autogenerated value we need to include it also evenif it's include in config.mk but it's done before there generation

which we need to do this

ifdef CONFIG_CPU_LITTLE_ENDIAN
.....
else
....
endif

when doing the LD of u-boot as the CONFIG_CPU_LITTLE_ENDIAN will not be define so we will link it as big-endian

Quoted 1 line

can you please show an error case that gets fixed by this change?

http://www.mail-archive.com/u-boot at lists.denx.de/msg14517.html

Best Regards,
J.

#19 lore raw

PATCH 1/3 fix: missing autoconfig.mk from general Makefile

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 6 lines · Wolfgang Denk

Dear Jean-Christophe PLAGNIOL-VILLARD,

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

at the first run of make we generate the autoconf.mk and autoconf.mk.dep if not already the case and we currently include only to .dep

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

in order to use these autogenerated value we need to include it also evenif it's include in config.mk but it's done before there generation

Can you please explain which exact problem you are fixing here? I. e.

in order to use these autogenerated value we need to include it also evenif it's include in config.mk but it's done before there generation

Believe me, I can read.

Just repeating the same words you already used in the commit message is not helpful at all. Actually it I cannot help but consider this affronting.

I did not understand the words there, and I don't understand them here.

Quoted 7 lines

which we need to do this

ifdef CONFIG_CPU_LITTLE_ENDIAN
.....
else
....
endif

We need to do this. And am I now supposed to guess where (i. e. in which spoecific file) we might need to do this or why and why it may or may not be working? Come on. This is not an explanation. This is just throwing words without any meaning at me.

I'm not willing to discuss on such a base.

Please try to explain in a understandable way what you mean (and than use this understandable explanation for the commit message).

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
A person who is more than casually interested in computers should  be
well  schooled in machine language, since it is a fundamental part of
a computer.                                           -- Donald Knuth
#20 lore raw

PATCH 1/3 fix: missing autoconfig.mk from general Makefile

In reply to Jean-Christophe PLAGNIOL-VILLARD

Hi Jean, or someone who understands U-Boot's build system well,

Quoted 16 lines · Jean-Christophe PLAGNIOL-VILLARD

at the first run of make we generate the autoconf.mk and autoconf.mk.dep if not already the case and we currently include only to .dep

in order to use these autogenerated value we need to include it also evenif it's include in config.mk but it's done before there generation

---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Makefile +0 -0
index 81a5cd0..7f3776e 100644

Makefile $(obj)include/autoconf.mk: $(obj)include/config.h · line 481

Quoted 7 lines
Makefile +1 -0
@@ -475,6 +475,7 @@ $(obj)include/autoconf.mk: $(obj)include/config.h
 	mv [email protected] $@
 
 sinclude $(obj)include/autoconf.mk.dep
+sinclude $(obj)include/autoconf.mk
 
 #########################################################################
 else	# !config.mk

I'm still thinking how to fix this issue.

The problem here is, deferred expansion on PLATFORM_LDFLAGS doesn't work expectedly. In this case,

| autoconf.mk
| -----------
| CONFIG_CPU_LITTLE_ENDIAN=y
| 
| mips_config.mk
| --------------
| 
| ifneq (,$(CONFIG_CPU_LITTLE_ENDIAN))
| PLATFORM_CPPFLAGS	+= $(shell $(CC) -dumpmachine |...
| PLATFORM_LDFLAGS	+= -EL
| else
| PLATFORM_CPPFLAGS	+= $(shell $(CC) -dumpmachine |...
| PLATFORM_LDFLAGS	+= -EB
| endif

doesn't work, but simply doing ...

| ifneq (,$(CONFIG_CPU_LITTLE_ENDIAN))
| PLATFORM_CPPFLAGS	+= $(shell $(CC) -dumpmachine |...
| else
| PLATFORM_CPPFLAGS	+= $(shell $(CC) -dumpmachine |...
| endif
|
| PLATFORM_LDFLAGS	+= -EL

does work.

Then, what needs to be fixed finally? Can't we have PLATFORM_LDFLAGS conditionally configured? or is this a U-Boot's build system issue?

Shinya

#21 lore raw

PATCH 1/3 fix: missing autoconfig.mk from general Makefile

Quoted 31 lines

I'm still thinking how to fix this issue.

The problem here is, deferred expansion on PLATFORM_LDFLAGS doesn't work expectedly. In this case,

| autoconf.mk
| -----------
| CONFIG_CPU_LITTLE_ENDIAN=y
| 
| mips_config.mk
| --------------
| 
| ifneq (,$(CONFIG_CPU_LITTLE_ENDIAN))
| PLATFORM_CPPFLAGS	+= $(shell $(CC) -dumpmachine |...
| PLATFORM_LDFLAGS	+= -EL
| else
| PLATFORM_CPPFLAGS	+= $(shell $(CC) -dumpmachine |...
| PLATFORM_LDFLAGS	+= -EB
| endif

doesn't work, but simply doing ...

| ifneq (,$(CONFIG_CPU_LITTLE_ENDIAN))
| PLATFORM_CPPFLAGS	+= $(shell $(CC) -dumpmachine |...
| else
| PLATFORM_CPPFLAGS	+= $(shell $(CC) -dumpmachine |...
| endif
|
| PLATFORM_LDFLAGS	+= -EL
Quoted 1 line

does work.

???
you compile it as big endian to link it as little ???

Quoted 3 lines

Then, what needs to be fixed finally? Can't we have PLATFORM_LDFLAGS conditionally configured? or is this a U-Boot's build system issue?

it a u-boot build system issues
we need to include the autoconf.mk after generate it to use it in the GENERAL Makefile which is the case here for final link

Best Regards,
J.

#22 lore raw

PATCH 1/3 fix: missing autoconfig.mk from general Makefile

Quoted 11 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 9 lines
| ifneq (,$(CONFIG_CPU_LITTLE_ENDIAN))
| PLATFORM_CPPFLAGS	+= $(shell $(CC) -dumpmachine |...
| else
| PLATFORM_CPPFLAGS	+= $(shell $(CC) -dumpmachine |...
| endif
|
| PLATFORM_LDFLAGS	+= -EL

does work.

???
you compile it as big endian to link it as little ???

Ah, above was just a sample only intended for LE build.

Quoted 5 lines
Quoted 2 lines

Then, what needs to be fixed finally? Can't we have PLATFORM_LDFLAGS conditionally configured? or is this a U-Boot's build system issue?

it a u-boot build system issues
we need to include the autoconf.mk after generate it to use it in the GENERAL Makefile which is the case here for final link

I know that, but $(obj)include/autoconf.mk will be included by $(TOPDIR)/config.mk. Then what a rationale for including it redundantly by $(TOPDIR/Makefile? I assume that Wolfgang is probably requesting the explanation for that.

Autoconf.mk is expected to be generated *before* $(TOPDIR)/config.mk is included, right? If so, do you think your patch is a reasonable enough? Or do we need to consider another approach?

Shinya - not a GNU make expert :-(

#23 lore raw

PATCH 1/3 fix: missing autoconfig.mk from general Makefile

Quoted 17 lines · Shinya Kuribayashi
Quoted 11 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 9 lines
| ifneq (,$(CONFIG_CPU_LITTLE_ENDIAN))
| PLATFORM_CPPFLAGS	+= $(shell $(CC) -dumpmachine |...
| else
| PLATFORM_CPPFLAGS	+= $(shell $(CC) -dumpmachine |...
| endif
|
| PLATFORM_LDFLAGS	+= -EL

does work.

???
you compile it as big endian to link it as little ???

Ah, above was just a sample only intended for LE build.

Quoted 2 lines
Quoted 2 lines

Then, what needs to be fixed finally? Can't we have PLATFORM_LDFLAGS conditionally configured? or is this a U-Boot's build system issue?

Quoted 8 lines
Quoted 3 lines

it a u-boot build system issues
we need to include the autoconf.mk after generate it to use it in the GENERAL Makefile which is the case here for final link

I know that, but $(obj)include/autoconf.mk will be included by $(TOPDIR)/config.mk. Then what a rationale for including it redundantly by $(TOPDIR/Makefile? I assume that Wolfgang is probably requesting the explanation for that.

for sub Makefile yes as you re-include it via including config.mk for the first Makefile no as you generate it in you need to include it just after to be able to use it as you include the config.mk before generate it

Quoted 3 lines

Autoconf.mk is expected to be generated *before* $(TOPDIR)/config.mk is included, right?

no not in the general Makefile

Best Regards,
J.

#24 lore raw

PATCH 1/3 fix: missing autoconfig.mk from general Makefile

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 16 lines · On Saturday 23 May 2009 15:42:36 Jean-Christophe PLAGNIOL-VILLARD wrote:

at the first run of make we generate the autoconf.mk and autoconf.mk.dep if not already the case and we currently include only to .dep

in order to use these autogenerated value we need to include it also evenif it's include in config.mk but it's done before there generation

---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Makefile +0 -0
index 81a5cd0..7f3776e 100644

Makefile $(obj)include/autoconf.mk: $(obj)include/config.h · line 481

Quoted 7 lines
Makefile +1 -0
@@ -475,6 +475,7 @@ $(obj)include/autoconf.mk: $(obj)include/config.h
 	mv [email protected] $@
 
 sinclude $(obj)include/autoconf.mk.dep
+sinclude $(obj)include/autoconf.mk
 
 #########################################################################
 else	# !config.mk

while i dont really understand your changelog, i think you're attempting to fix a problem i too have hit with Blackfin systems. but i just hacked around it in my tree (i posted this patch before but Wolfgang opposed it on the basis that no other arch had the problems Blackfin did, but apparently that is no longer true):
http://git.denx.de/?p=u-boot/u-boot-
blackfin.git;a=commitdiff;h=12ce98a697dde38aefe7131ce9a1b2e0e01640ad
-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/20090623/f058ab56/attachment-0001.pgp

#25 lore raw

PATCH 1/3 fix: missing autoconfig.mk from general Makefile

Quoted 22 lines · Mike Frysinger
Quoted 21 lines · On Saturday 23 May 2009 15:42:36 Jean-Christophe PLAGNIOL-VILLARD wrote:

at the first run of make we generate the autoconf.mk and autoconf.mk.dep if not already the case and we currently include only to .dep

in order to use these autogenerated value we need to include it also evenif it's include in config.mk but it's done before there generation

---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Makefile +1 -0
index 81a5cd0..7f3776e 100644
@@ -475,6 +475,7 @@ $(obj)include/autoconf.mk: $(obj)include/config.h
 	mv [email protected] $@
 
 sinclude $(obj)include/autoconf.mk.dep
+sinclude $(obj)include/autoconf.mk
 
Quoted 10 lines

Makefile $(obj)include/autoconf.mk: $(obj)include/config.h · line 481

Quoted 2 lines
Makefile +0 -0
 #########################################################################
 else	# !config.mk

while i dont really understand your changelog, i think you're attempting to fix a problem i too have hit with Blackfin systems. but i just hacked around it in my tree (i posted this patch before but Wolfgang opposed it on the basis that no other arch had the problems Blackfin did, but apparently that is no longer true):
http://git.denx.de/?p=u-boot/u-boot-
blackfin.git;a=commitdiff;h=12ce98a697dde38aefe7131ce9a1b2e0e01640ad

yes it's the same problem I guess and the solution I propose will for all boards normally

Best Regards,
J.

#26 lore raw

PATCH 1/3 fix: missing autoconfig.mk from general Makefile

In reply to Mike Frysinger

Dear Mike Frysinger,

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

while i dont really understand your changelog, i think you're attempting to fix a problem i too have hit with Blackfin systems. but i just hacked around it in my tree (i posted this patch before but Wolfgang opposed it on the basis that no other arch had the problems Blackfin did, but apparently that is no longer true):
http://git.denx.de/?p=u-boot/u-boot-
blackfin.git;a=commitdiff;h=12ce98a697dde38aefe7131ce9a1b2e0e01640ad

So what do you suggest? Apply Jean-Chritophe's patch (maybe you could ACK it then?)? Or use your's instead?

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
Mandrell: "You know what I think?"
Doctor:   "Ah, ah that's a catch question. With a brain your size you
          don't think, right?"
                - Dr. Who
#27 lore raw

PATCH 1/3 fix: missing autoconfig.mk from general Makefile

Quoted 11 lines · On Friday 10 July 2009 18:35:59 Wolfgang Denk wrote:
Quoted 7 lines · Mike Frysinger

while i dont really understand your changelog, i think you're attempting to fix a problem i too have hit with Blackfin systems. but i just hacked around it in my tree (i posted this patch before but Wolfgang opposed it on the basis that no other arch had the problems Blackfin did, but apparently that is no longer true):
http://git.denx.de/?p=u-boot/u-boot-
blackfin.git;a=commitdiff;h=12ce98a697dde38aefe7131ce9a1b2e0e01640ad

So what do you suggest? Apply Jean-Chritophe's patch (maybe you could ACK it then?)? Or use your's instead?

i tested Jean's and while it doesnt work as well as i'd like (i'd prefer it be included before the config.mk), i can work with this in place of the patch i proposed. i'll have to tweak the blackfin_config.mk once this gets merged.

so yes, i'd add my signed-off-by to 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/20090710/18070b69/attachment-0001.pgp

#28 lore raw

PATCH 1/3 fix: missing autoconfig.mk from general Makefile

In reply to Jean-Christophe PLAGNIOL-VILLARD

Dear Jean-Christophe PLAGNIOL-VILLARD,

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

at the first run of make we generate the autoconf.mk and autoconf.mk.dep if not already the case and we currently include only to .dep

in order to use these autogenerated value we need to include it also evenif it's include in config.mk but it's done before there generation

---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Appied, thanks.

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
A Chairman was as necessary to a Board planet  as  the  zero  was  in
mathematics, but being a zero had big disadvantages...
                         - Terry Pratchett, _The Dark Side of the Sun_