All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] mips: unify lds
@ 2009-05-10 20:56 Jean-Christophe PLAGNIOL-VILLARD
  2009-05-10 21:34 ` Wolfgang Denk
  0 siblings, 1 reply; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-10 20:56 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
---
 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%)

diff --git a/Makefile b/Makefile
index ee09856..2cb0ce2 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/board/dbau1x00/u-boot.lds b/board/dbau1x00/u-boot.lds
deleted file mode 100644
index 9a6cd1b..0000000
--- a/board/dbau1x00/u-boot.lds
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
-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 = .;
-}
diff --git a/board/gth2/u-boot.lds b/board/gth2/u-boot.lds
deleted file mode 100644
index e6eee9b..0000000
--- a/board/gth2/u-boot.lds
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * (C) Copyright 2003-2005
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
-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 = .;
-}
diff --git a/board/incaip/u-boot.lds b/board/incaip/u-boot.lds
deleted file mode 100644
index 9a6cd1b..0000000
--- a/board/incaip/u-boot.lds
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
-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 = .;
-}
diff --git a/board/pb1x00/u-boot.lds b/board/pb1x00/u-boot.lds
deleted file mode 100644
index 9a6cd1b..0000000
--- a/board/pb1x00/u-boot.lds
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
-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 = .;
-}
diff --git a/board/purple/config.mk b/board/purple/config.mk
index ea478ed..16a55c6 100644
--- a/board/purple/config.mk
+++ b/board/purple/config.mk
@@ -30,3 +30,5 @@ TEXT_BASE = 0xB0000000
 
 # RAM version
 #TEXT_BASE = 0x80100000
+
+LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
diff --git a/board/qemu-mips/u-boot.lds b/board/qemu-mips/u-boot.lds
deleted file mode 100644
index ad058ca..0000000
--- a/board/qemu-mips/u-boot.lds
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
-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 = .;
-	}
-
-	. = ALIGN(4);
-	.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  : { *(.sbss) }
-	.bss  : { *(.bss) . = ALIGN(4); }
-	uboot_end = .;
-}
diff --git a/board/tb0229/u-boot.lds b/board/tb0229/u-boot.lds
deleted file mode 100644
index 56d7c25..0000000
--- a/board/tb0229/u-boot.lds
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * (C) Masami Komiya <mkomiya@sonare.it> 2004
- *
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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-tradlittlemips", "elf32-tradlittlemips", "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 = .;
-}
diff --git a/board/micronas/vct/u-boot.lds b/cpu/mips/u-boot.lds
similarity index 75%
rename from board/micronas/vct/u-boot.lds
rename to cpu/mips/u-boot.lds
index b90b186..dda0dda 100644
--- a/board/micronas/vct/u-boot.lds
+++ b/cpu/mips/u-boot.lds
@@ -1,5 +1,8 @@
 /*
- * (C) Copyright 2003
+ * (C) Copyright 2004
+ * Masami Komiya <mkomiya@sonare.it>
+ *
+ * (C) Copyright 2003-2005
  * Wolfgang Denk Engineering, <wd@denx.de>
  *
  * 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 = .;
 }
diff --git a/mips_config.mk b/mips_config.mk
index 05eb05d..b4365a3 100644
--- a/mips_config.mk
+++ b/mips_config.mk
@@ -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
-- 
1.6.1.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/1] mips: unify lds
  2009-05-10 20:56 [U-Boot] [PATCH 1/1] mips: unify lds Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-10 21:34 ` Wolfgang Denk
  2009-05-16  3:59   ` Shinya Kuribayashi
  0 siblings, 1 reply; 29+ messages in thread
From: Wolfgang Denk @ 2009-05-10 21:34 UTC (permalink / raw)
  To: u-boot

Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <1241989002-21623-1-git-send-email-plagnioj@jcrosoft.com> 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
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
...
> diff --git a/Makefile b/Makefile
> index ee09856..2cb0ce2 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -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

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

-- 
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_

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/1] mips: unify lds
  2009-05-10 21:34 ` Wolfgang Denk
@ 2009-05-16  3:59   ` Shinya Kuribayashi
  2009-05-16  4:02     ` Shinya Kuribayashi
                       ` (2 more replies)
  0 siblings, 3 replies; 29+ messages in thread
From: Shinya Kuribayashi @ 2009-05-16  3:59 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
> Dear Jean-Christophe PLAGNIOL-VILLARD,
> 
> In message <1241989002-21623-1-git-send-email-plagnioj@jcrosoft.com> 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
>>
>> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>> Cc: Shinya Kuribayashi <shinya.kuribayashi@necel.com>

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

>> diff --git a/Makefile b/Makefile
>> index ee09856..2cb0ce2 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -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
> 
> 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__
>>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

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/1] mips: unify lds
  2009-05-16  3:59   ` Shinya Kuribayashi
@ 2009-05-16  4:02     ` Shinya Kuribayashi
  2009-05-22 23:48     ` [U-Boot] *** PROBABLY SPAM *** " Jean-Christophe PLAGNIOL-VILLARD
  2009-05-23 11:35     ` [U-Boot] [PATCH 1/2 V2] mips: add endianness support Jean-Christophe PLAGNIOL-VILLARD
  2 siblings, 0 replies; 29+ messages in thread
From: Shinya Kuribayashi @ 2009-05-16  4:02 UTC (permalink / raw)
  To: u-boot

Shinya Kuribayashi wrote:
> 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/.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] *** PROBABLY SPAM *** Re: [PATCH 1/1] mips: unify lds
  2009-05-16  3:59   ` Shinya Kuribayashi
  2009-05-16  4:02     ` Shinya Kuribayashi
@ 2009-05-22 23:48     ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-23 11:35     ` [U-Boot] [PATCH 1/2 V2] mips: add endianness support Jean-Christophe PLAGNIOL-VILLARD
  2 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-22 23:48 UTC (permalink / raw)
  To: u-boot

> 
> 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
> 
> * 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?
no just to avaid double define
> 
>   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_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.
yes the PREDEF will not be necessarely
> 
> * 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)
> 
> 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.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/2 V2] mips: add endianness support
  2009-05-16  3:59   ` Shinya Kuribayashi
  2009-05-16  4:02     ` Shinya Kuribayashi
  2009-05-22 23:48     ` [U-Boot] *** PROBABLY SPAM *** " Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-23 11:35     ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-23 11:35       ` [U-Boot] [PATCH 2/2 V2] mips: unify lds Jean-Christophe PLAGNIOL-VILLARD
  2009-05-23 15:24       ` [U-Boot] [PATCH 1/2 V2] mips: add endianness support Shinya Kuribayashi
  2 siblings, 2 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-23 11:35 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 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(-)

diff --git a/Makefile b/Makefile
index 81a5cd0..7729c43 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/board/dbau1x00/u-boot.lds b/board/dbau1x00/u-boot.lds
index 9a6cd1b..93c06db 100644
--- a/board/dbau1x00/u-boot.lds
+++ b/board/dbau1x00/u-boot.lds
@@ -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
diff --git a/board/gth2/u-boot.lds b/board/gth2/u-boot.lds
index e6eee9b..f3b2c85 100644
--- a/board/gth2/u-boot.lds
+++ b/board/gth2/u-boot.lds
@@ -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
diff --git a/board/incaip/u-boot.lds b/board/incaip/u-boot.lds
index 9a6cd1b..93c06db 100644
--- a/board/incaip/u-boot.lds
+++ b/board/incaip/u-boot.lds
@@ -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
diff --git a/board/pb1x00/u-boot.lds b/board/pb1x00/u-boot.lds
index 9a6cd1b..93c06db 100644
--- a/board/pb1x00/u-boot.lds
+++ b/board/pb1x00/u-boot.lds
@@ -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
diff --git a/board/purple/u-boot.lds b/board/purple/u-boot.lds
index 04a641a..193d8b2 100644
--- a/board/purple/u-boot.lds
+++ b/board/purple/u-boot.lds
@@ -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
diff --git a/board/qemu-mips/u-boot.lds b/board/qemu-mips/u-boot.lds
index ad058ca..7f94b64 100644
--- a/board/qemu-mips/u-boot.lds
+++ b/board/qemu-mips/u-boot.lds
@@ -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
diff --git a/board/tb0229/u-boot.lds b/board/tb0229/u-boot.lds
index 56d7c25..6f21197 100644
--- a/board/tb0229/u-boot.lds
+++ b/board/tb0229/u-boot.lds
@@ -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
diff --git a/cpu/mips/config.mk b/cpu/mips/config.mk
index a173c54..928b7d8 100644
--- a/cpu/mips/config.mk
+++ b/cpu/mips/config.mk
@@ -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)
diff --git a/examples/Makefile b/examples/Makefile
index dbcfa92..cf70d6d 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -43,6 +43,7 @@ endif
 
 ifeq ($(ARCH),mips)
 LOAD_ADDR = 0x80200000 -T mips.lds
+EX_LDFLAGS += $(PLATFORM_LDFLAGS)
 endif
 
 ifeq ($(ARCH),nios)
diff --git a/examples/mips.lds b/examples/mips.lds
index 717b201..9caff00 100644
--- a/examples/mips.lds
+++ b/examples/mips.lds
@@ -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
 {
diff --git a/mips_config.mk b/mips_config.mk
index 05eb05d..423e216 100644
--- a/mips_config.mk
+++ b/mips_config.mk
@@ -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
-- 
1.6.3.1

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 2/2 V2] mips: unify lds
  2009-05-23 11:35     ` [U-Boot] [PATCH 1/2 V2] mips: add endianness support Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-23 11:35       ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-23 15:45         ` Shinya Kuribayashi
  2009-05-23 15:24       ` [U-Boot] [PATCH 1/2 V2] mips: add endianness support Shinya Kuribayashi
  1 sibling, 1 reply; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-23 11:35 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 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%)

diff --git a/board/dbau1x00/u-boot.lds b/board/dbau1x00/u-boot.lds
deleted file mode 100644
index 93c06db..0000000
--- a/board/dbau1x00/u-boot.lds
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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 = .;
-}
diff --git a/board/gth2/u-boot.lds b/board/gth2/u-boot.lds
deleted file mode 100644
index f3b2c85..0000000
--- a/board/gth2/u-boot.lds
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * (C) Copyright 2003-2005
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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 = .;
-}
diff --git a/board/incaip/u-boot.lds b/board/incaip/u-boot.lds
deleted file mode 100644
index 93c06db..0000000
--- a/board/incaip/u-boot.lds
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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 = .;
-}
diff --git a/board/pb1x00/u-boot.lds b/board/pb1x00/u-boot.lds
deleted file mode 100644
index 93c06db..0000000
--- a/board/pb1x00/u-boot.lds
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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 = .;
-}
diff --git a/board/purple/config.mk b/board/purple/config.mk
index ea478ed..16a55c6 100644
--- a/board/purple/config.mk
+++ b/board/purple/config.mk
@@ -30,3 +30,5 @@ TEXT_BASE = 0xB0000000
 
 # RAM version
 #TEXT_BASE = 0x80100000
+
+LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
diff --git a/board/qemu-mips/u-boot.lds b/board/qemu-mips/u-boot.lds
deleted file mode 100644
index 7f94b64..0000000
--- a/board/qemu-mips/u-boot.lds
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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 = .;
-	}
-
-	. = ALIGN(4);
-	.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  : { *(.sbss) }
-	.bss  : { *(.bss) . = ALIGN(4); }
-	uboot_end = .;
-}
diff --git a/board/tb0229/u-boot.lds b/board/tb0229/u-boot.lds
deleted file mode 100644
index 6f21197..0000000
--- a/board/tb0229/u-boot.lds
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * (C) Masami Komiya <mkomiya@sonare.it> 2004
- *
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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 = .;
-}
diff --git a/board/micronas/vct/u-boot.lds b/cpu/mips/u-boot.lds
similarity index 75%
rename from board/micronas/vct/u-boot.lds
rename to cpu/mips/u-boot.lds
index b90b186..dda0dda 100644
--- a/board/micronas/vct/u-boot.lds
+++ b/cpu/mips/u-boot.lds
@@ -1,5 +1,8 @@
 /*
- * (C) Copyright 2003
+ * (C) Copyright 2004
+ * Masami Komiya <mkomiya@sonare.it>
+ *
+ * (C) Copyright 2003-2005
  * Wolfgang Denk Engineering, <wd@denx.de>
  *
  * 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 = .;
 }
diff --git a/mips_config.mk b/mips_config.mk
index 423e216..41333d4 100644
--- a/mips_config.mk
+++ b/mips_config.mk
@@ -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
-- 
1.6.3.1

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/2 V2] mips: add endianness support
  2009-05-23 15:24       ` [U-Boot] [PATCH 1/2 V2] mips: add endianness support Shinya Kuribayashi
@ 2009-05-23 15:19         ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-23 17:58           ` Shinya Kuribayashi
  0 siblings, 1 reply; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-23 15:19 UTC (permalink / raw)
  To: u-boot

On 00:24 Sun 24 May     , Shinya Kuribayashi wrote:
> Hi,
>
> Jean-Christophe PLAGNIOL-VILLARD 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
>>
>> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>> ---
>>  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]
>
>> diff --git a/cpu/mips/config.mk b/cpu/mips/config.mk
>> index a173c54..928b7d8 100644
>> --- a/cpu/mips/config.mk
>> +++ b/cpu/mips/config.mk
>> @@ -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
>
>> -
>> -PLATFORM_CPPFLAGS += $(MIPSFLAGS)
>
> I think this wrongly removes -march=4kc -mtune=4kc.
I miss this
>
>> diff --git a/mips_config.mk b/mips_config.mk
>> index 05eb05d..423e216 100644
>> --- a/mips_config.mk
>> +++ b/mips_config.mk
>> @@ -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
>
> 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.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/2 V2] mips: add endianness support
  2009-05-23 11:35     ` [U-Boot] [PATCH 1/2 V2] mips: add endianness support Jean-Christophe PLAGNIOL-VILLARD
  2009-05-23 11:35       ` [U-Boot] [PATCH 2/2 V2] mips: unify lds Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-23 15:24       ` Shinya Kuribayashi
  2009-05-23 15:19         ` Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 1 reply; 29+ messages in thread
From: Shinya Kuribayashi @ 2009-05-23 15:24 UTC (permalink / raw)
  To: u-boot

Hi,

Jean-Christophe PLAGNIOL-VILLARD 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
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  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]

> diff --git a/cpu/mips/config.mk b/cpu/mips/config.mk
> index a173c54..928b7d8 100644
> --- a/cpu/mips/config.mk
> +++ b/cpu/mips/config.mk
> @@ -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

> -
> -PLATFORM_CPPFLAGS += $(MIPSFLAGS)

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

> diff --git a/mips_config.mk b/mips_config.mk
> index 05eb05d..423e216 100644
> --- a/mips_config.mk
> +++ b/mips_config.mk
> @@ -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

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

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 2/2 V2] mips: unify lds
  2009-05-23 11:35       ` [U-Boot] [PATCH 2/2 V2] mips: unify lds Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-23 15:45         ` Shinya Kuribayashi
  0 siblings, 0 replies; 29+ messages in thread
From: Shinya Kuribayashi @ 2009-05-23 15:45 UTC (permalink / raw)
  To: u-boot

Jean-Christophe PLAGNIOL-VILLARD 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
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Looks good, except for one nit.

> diff --git a/board/micronas/vct/u-boot.lds b/cpu/mips/u-boot.lds
> similarity index 75%
> rename from board/micronas/vct/u-boot.lds
> rename to cpu/mips/u-boot.lds
> index b90b186..dda0dda 100644
> --- a/board/micronas/vct/u-boot.lds
> +++ b/cpu/mips/u-boot.lds
> @@ -1,5 +1,8 @@
>  /*
> - * (C) Copyright 2003
> + * (C) Copyright 2004
> + * Masami Komiya <mkomiya@sonare.it>
> + *
> + * (C) Copyright 2003-2005
>   * Wolfgang Denk Engineering, <wd@denx.de>
>   *
>   * 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

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/2 V2] mips: add endianness support
  2009-05-23 15:19         ` Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-23 17:58           ` Shinya Kuribayashi
  2009-05-23 19:41             ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-23 19:42             ` [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 2 replies; 29+ messages in thread
From: Shinya Kuribayashi @ 2009-05-23 17:58 UTC (permalink / raw)
  To: u-boot

Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 00:24 Sun 24 May     , Shinya Kuribayashi wrote:
>> 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
$ 

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/2 V2] mips: add endianness support
  2009-05-23 17:58           ` Shinya Kuribayashi
@ 2009-05-23 19:41             ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-23 19:42             ` [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-23 19:41 UTC (permalink / raw)
  To: u-boot

On 02:58 Sun 24 May     , Shinya Kuribayashi wrote:
> Jean-Christophe PLAGNIOL-VILLARD wrote:
>> On 00:24 Sun 24 May     , Shinya Kuribayashi wrote:
>>> 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.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile
  2009-05-23 17:58           ` Shinya Kuribayashi
  2009-05-23 19:41             ` Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-23 19:42             ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-23 19:42               ` [U-Boot] [PATCH 2/3] mips: add endianness support Jean-Christophe PLAGNIOL-VILLARD
                                 ` (4 more replies)
  1 sibling, 5 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-23 19:42 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 81a5cd0..7f3776e 100644
--- a/Makefile
+++ b/Makefile
@@ -475,6 +475,7 @@ $(obj)include/autoconf.mk: $(obj)include/config.h
 	mv $@.tmp $@
 
 sinclude $(obj)include/autoconf.mk.dep
+sinclude $(obj)include/autoconf.mk
 
 #########################################################################
 else	# !config.mk
-- 
1.6.3.1

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 2/3] mips: add endianness support
  2009-05-23 19:42             ` [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-23 19:42               ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-23 19:42                 ` [U-Boot] [PATCH 3/3] mips: unify lds Jean-Christophe PLAGNIOL-VILLARD
  2009-05-31 22:26                 ` [U-Boot] [PATCH 2/3] mips: add endianness support Wolfgang Denk
  2009-05-23 22:28               ` [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile Wolfgang Denk
                                 ` (3 subsequent siblings)
  4 siblings, 2 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-23 19:42 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 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(-)

diff --git a/Makefile b/Makefile
index 7f3776e..929cae7 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/board/dbau1x00/u-boot.lds b/board/dbau1x00/u-boot.lds
index 9a6cd1b..93c06db 100644
--- a/board/dbau1x00/u-boot.lds
+++ b/board/dbau1x00/u-boot.lds
@@ -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
diff --git a/board/gth2/u-boot.lds b/board/gth2/u-boot.lds
index e6eee9b..f3b2c85 100644
--- a/board/gth2/u-boot.lds
+++ b/board/gth2/u-boot.lds
@@ -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
diff --git a/board/incaip/u-boot.lds b/board/incaip/u-boot.lds
index 9a6cd1b..93c06db 100644
--- a/board/incaip/u-boot.lds
+++ b/board/incaip/u-boot.lds
@@ -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
diff --git a/board/pb1x00/u-boot.lds b/board/pb1x00/u-boot.lds
index 9a6cd1b..93c06db 100644
--- a/board/pb1x00/u-boot.lds
+++ b/board/pb1x00/u-boot.lds
@@ -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
diff --git a/board/purple/u-boot.lds b/board/purple/u-boot.lds
index 04a641a..193d8b2 100644
--- a/board/purple/u-boot.lds
+++ b/board/purple/u-boot.lds
@@ -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
diff --git a/board/qemu-mips/u-boot.lds b/board/qemu-mips/u-boot.lds
index ad058ca..7f94b64 100644
--- a/board/qemu-mips/u-boot.lds
+++ b/board/qemu-mips/u-boot.lds
@@ -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
diff --git a/board/tb0229/u-boot.lds b/board/tb0229/u-boot.lds
index 56d7c25..6f21197 100644
--- a/board/tb0229/u-boot.lds
+++ b/board/tb0229/u-boot.lds
@@ -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
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)
diff --git a/examples/Makefile b/examples/Makefile
index dbcfa92..cf70d6d 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -43,6 +43,7 @@ endif
 
 ifeq ($(ARCH),mips)
 LOAD_ADDR = 0x80200000 -T mips.lds
+EX_LDFLAGS += $(PLATFORM_LDFLAGS)
 endif
 
 ifeq ($(ARCH),nios)
diff --git a/examples/mips.lds b/examples/mips.lds
index 717b201..9caff00 100644
--- a/examples/mips.lds
+++ b/examples/mips.lds
@@ -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
 {
diff --git a/mips_config.mk b/mips_config.mk
index 05eb05d..423e216 100644
--- a/mips_config.mk
+++ b/mips_config.mk
@@ -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
-- 
1.6.3.1

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 3/3] mips: unify lds
  2009-05-23 19:42               ` [U-Boot] [PATCH 2/3] mips: add endianness support Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-23 19:42                 ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-31 22:27                   ` Wolfgang Denk
  2009-05-31 22:26                 ` [U-Boot] [PATCH 2/3] mips: add endianness support Wolfgang Denk
  1 sibling, 1 reply; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-23 19:42 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 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%)

diff --git a/board/dbau1x00/u-boot.lds b/board/dbau1x00/u-boot.lds
deleted file mode 100644
index 93c06db..0000000
--- a/board/dbau1x00/u-boot.lds
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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 = .;
-}
diff --git a/board/gth2/u-boot.lds b/board/gth2/u-boot.lds
deleted file mode 100644
index f3b2c85..0000000
--- a/board/gth2/u-boot.lds
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * (C) Copyright 2003-2005
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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 = .;
-}
diff --git a/board/incaip/u-boot.lds b/board/incaip/u-boot.lds
deleted file mode 100644
index 93c06db..0000000
--- a/board/incaip/u-boot.lds
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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 = .;
-}
diff --git a/board/pb1x00/u-boot.lds b/board/pb1x00/u-boot.lds
deleted file mode 100644
index 93c06db..0000000
--- a/board/pb1x00/u-boot.lds
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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 = .;
-}
diff --git a/board/purple/config.mk b/board/purple/config.mk
index ea478ed..16a55c6 100644
--- a/board/purple/config.mk
+++ b/board/purple/config.mk
@@ -30,3 +30,5 @@ TEXT_BASE = 0xB0000000
 
 # RAM version
 #TEXT_BASE = 0x80100000
+
+LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
diff --git a/board/qemu-mips/u-boot.lds b/board/qemu-mips/u-boot.lds
deleted file mode 100644
index 7f94b64..0000000
--- a/board/qemu-mips/u-boot.lds
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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 = .;
-	}
-
-	. = ALIGN(4);
-	.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  : { *(.sbss) }
-	.bss  : { *(.bss) . = ALIGN(4); }
-	uboot_end = .;
-}
diff --git a/board/tb0229/u-boot.lds b/board/tb0229/u-boot.lds
deleted file mode 100644
index 6f21197..0000000
--- a/board/tb0229/u-boot.lds
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * (C) Masami Komiya <mkomiya@sonare.it> 2004
- *
- * (C) Copyright 2003
- * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * 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 = .;
-}
diff --git a/board/micronas/vct/u-boot.lds b/cpu/mips/u-boot.lds
similarity index 75%
rename from board/micronas/vct/u-boot.lds
rename to cpu/mips/u-boot.lds
index b90b186..dda0dda 100644
--- a/board/micronas/vct/u-boot.lds
+++ b/cpu/mips/u-boot.lds
@@ -1,5 +1,8 @@
 /*
- * (C) Copyright 2003
+ * (C) Copyright 2004
+ * Masami Komiya <mkomiya@sonare.it>
+ *
+ * (C) Copyright 2003-2005
  * Wolfgang Denk Engineering, <wd@denx.de>
  *
  * 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 = .;
 }
diff --git a/mips_config.mk b/mips_config.mk
index 423e216..41333d4 100644
--- a/mips_config.mk
+++ b/mips_config.mk
@@ -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
-- 
1.6.3.1

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile
  2009-05-23 19:42             ` [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile Jean-Christophe PLAGNIOL-VILLARD
  2009-05-23 19:42               ` [U-Boot] [PATCH 2/3] mips: add endianness support Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-23 22:28               ` Wolfgang Denk
  2009-05-24 15:18                 ` Jean-Christophe PLAGNIOL-VILLARD
  2009-06-23 14:34               ` Shinya Kuribayashi
                                 ` (2 subsequent siblings)
  4 siblings, 1 reply; 29+ messages in thread
From: Wolfgang Denk @ 2009-05-23 22:28 UTC (permalink / raw)
  To: u-boot

Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <1243107758-4528-1-git-send-email-plagnioj@jcrosoft.com> 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
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

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

-- 
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

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile
  2009-05-23 22:28               ` [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile Wolfgang Denk
@ 2009-05-24 15:18                 ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-24 17:13                   ` Wolfgang Denk
  0 siblings, 1 reply; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-24 15:18 UTC (permalink / raw)
  To: u-boot

On 00:28 Sun 24 May     , Wolfgang Denk wrote:
> Dear Jean-Christophe PLAGNIOL-VILLARD,
> 
> In message <1243107758-4528-1-git-send-email-plagnioj@jcrosoft.com> 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
> > 
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> 
> 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
> 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.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile
  2009-05-24 15:18                 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-24 17:13                   ` Wolfgang Denk
  0 siblings, 0 replies; 29+ messages in thread
From: Wolfgang Denk @ 2009-05-24 17:13 UTC (permalink / raw)
  To: u-boot

Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <20090524151849.GJ26561@game.jcrosoft.org> you wrote:
> On 00:28 Sun 24 May     , Wolfgang Denk wrote:
> > Dear Jean-Christophe PLAGNIOL-VILLARD,
> > 
> > In message <1243107758-4528-1-git-send-email-plagnioj@jcrosoft.com> 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
> > > 
> > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > 
> > 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.

> 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

-- 
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

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 2/3] mips: add endianness support
  2009-05-23 19:42               ` [U-Boot] [PATCH 2/3] mips: add endianness support Jean-Christophe PLAGNIOL-VILLARD
  2009-05-23 19:42                 ` [U-Boot] [PATCH 3/3] mips: unify lds Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-31 22:26                 ` Wolfgang Denk
  1 sibling, 0 replies; 29+ messages in thread
From: Wolfgang Denk @ 2009-05-31 22:26 UTC (permalink / raw)
  To: u-boot

Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <1243107758-4528-2-git-send-email-plagnioj@jcrosoft.com> 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
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

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

-- 
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?

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 3/3] mips: unify lds
  2009-05-23 19:42                 ` [U-Boot] [PATCH 3/3] mips: unify lds Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-31 22:27                   ` Wolfgang Denk
  0 siblings, 0 replies; 29+ messages in thread
From: Wolfgang Denk @ 2009-05-31 22:27 UTC (permalink / raw)
  To: u-boot

Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <1243107758-4528-3-git-send-email-plagnioj@jcrosoft.com> 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

-- 
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.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile
  2009-05-23 19:42             ` [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile Jean-Christophe PLAGNIOL-VILLARD
  2009-05-23 19:42               ` [U-Boot] [PATCH 2/3] mips: add endianness support Jean-Christophe PLAGNIOL-VILLARD
  2009-05-23 22:28               ` [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile Wolfgang Denk
@ 2009-06-23 14:34               ` Shinya Kuribayashi
  2009-06-23 15:14                 ` Jean-Christophe PLAGNIOL-VILLARD
  2009-06-23 17:07               ` Mike Frysinger
  2009-07-17 19:18               ` Wolfgang Denk
  4 siblings, 1 reply; 29+ messages in thread
From: Shinya Kuribayashi @ 2009-06-23 14:34 UTC (permalink / raw)
  To: u-boot

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

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
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  Makefile |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 81a5cd0..7f3776e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -475,6 +475,7 @@ $(obj)include/autoconf.mk: $(obj)include/config.h
>  	mv $@.tmp $@
>  
>  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

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile
  2009-06-23 14:34               ` Shinya Kuribayashi
@ 2009-06-23 15:14                 ` Jean-Christophe PLAGNIOL-VILLARD
  2009-06-23 15:40                   ` Shinya Kuribayashi
  0 siblings, 1 reply; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-06-23 15:14 UTC (permalink / raw)
  To: u-boot

> 
> 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.
???
you compile it as big endian to link it as little ???
> 
> 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.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile
  2009-06-23 15:14                 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2009-06-23 15:40                   ` Shinya Kuribayashi
  2009-06-23 21:26                     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 29+ messages in thread
From: Shinya Kuribayashi @ 2009-06-23 15:40 UTC (permalink / raw)
  To: u-boot

Jean-Christophe PLAGNIOL-VILLARD wrote:
>> | 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.

>> 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 :-(

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile
  2009-05-23 19:42             ` [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile Jean-Christophe PLAGNIOL-VILLARD
                                 ` (2 preceding siblings ...)
  2009-06-23 14:34               ` Shinya Kuribayashi
@ 2009-06-23 17:07               ` Mike Frysinger
  2009-06-23 17:33                 ` Jean-Christophe PLAGNIOL-VILLARD
  2009-07-10 22:35                 ` Wolfgang Denk
  2009-07-17 19:18               ` Wolfgang Denk
  4 siblings, 2 replies; 29+ messages in thread
From: Mike Frysinger @ 2009-06-23 17:07 UTC (permalink / raw)
  To: u-boot

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
>
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  Makefile |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 81a5cd0..7f3776e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -475,6 +475,7 @@ $(obj)include/autoconf.mk: $(obj)include/config.h
>  	mv $@.tmp $@
>
>  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 

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile
  2009-06-23 17:07               ` Mike Frysinger
@ 2009-06-23 17:33                 ` Jean-Christophe PLAGNIOL-VILLARD
  2009-07-10 22:35                 ` Wolfgang Denk
  1 sibling, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-06-23 17:33 UTC (permalink / raw)
  To: u-boot

On 13:07 Tue 23 Jun     , Mike Frysinger wrote:
> 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
> >
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > ---
> >  Makefile |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index 81a5cd0..7f3776e 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -475,6 +475,7 @@ $(obj)include/autoconf.mk: $(obj)include/config.h
> >  	mv $@.tmp $@
> >
> >  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
yes it's the same problem I guess and the solution I propose will for all
boards normally

Best Regards,
J.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile
  2009-06-23 15:40                   ` Shinya Kuribayashi
@ 2009-06-23 21:26                     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 29+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-06-23 21:26 UTC (permalink / raw)
  To: u-boot

On 00:40 Wed 24 Jun     , Shinya Kuribayashi wrote:
> Jean-Christophe PLAGNIOL-VILLARD wrote:
> >> | 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.
> 
> >> 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.
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
> 
> Autoconf.mk is expected to be generated *before* $(TOPDIR)/config.mk is
> included, right?
no not in the general Makefile

Best Regards,
J.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile
  2009-06-23 17:07               ` Mike Frysinger
  2009-06-23 17:33                 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2009-07-10 22:35                 ` Wolfgang Denk
  2009-07-11  3:18                   ` Mike Frysinger
  1 sibling, 1 reply; 29+ messages in thread
From: Wolfgang Denk @ 2009-07-10 22:35 UTC (permalink / raw)
  To: u-boot

Dear Mike Frysinger,

In message <200906231307.32968.vapier@gentoo.org> 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

-- 
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

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile
  2009-07-10 22:35                 ` Wolfgang Denk
@ 2009-07-11  3:18                   ` Mike Frysinger
  0 siblings, 0 replies; 29+ messages in thread
From: Mike Frysinger @ 2009-07-11  3:18 UTC (permalink / raw)
  To: u-boot

On Friday 10 July 2009 18:35:59 Wolfgang Denk wrote:
> Mike Frysinger 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?

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 

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile
  2009-05-23 19:42             ` [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile Jean-Christophe PLAGNIOL-VILLARD
                                 ` (3 preceding siblings ...)
  2009-06-23 17:07               ` Mike Frysinger
@ 2009-07-17 19:18               ` Wolfgang Denk
  4 siblings, 0 replies; 29+ messages in thread
From: Wolfgang Denk @ 2009-07-17 19:18 UTC (permalink / raw)
  To: u-boot

Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <1243107758-4528-1-git-send-email-plagnioj@jcrosoft.com> 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
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  Makefile |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)

Appied, thanks.

Best regards,

Wolfgang Denk

-- 
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_

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2009-07-17 19:18 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-10 20:56 [U-Boot] [PATCH 1/1] mips: unify lds Jean-Christophe PLAGNIOL-VILLARD
2009-05-10 21:34 ` Wolfgang Denk
2009-05-16  3:59   ` Shinya Kuribayashi
2009-05-16  4:02     ` Shinya Kuribayashi
2009-05-22 23:48     ` [U-Boot] *** PROBABLY SPAM *** " Jean-Christophe PLAGNIOL-VILLARD
2009-05-23 11:35     ` [U-Boot] [PATCH 1/2 V2] mips: add endianness support Jean-Christophe PLAGNIOL-VILLARD
2009-05-23 11:35       ` [U-Boot] [PATCH 2/2 V2] mips: unify lds Jean-Christophe PLAGNIOL-VILLARD
2009-05-23 15:45         ` Shinya Kuribayashi
2009-05-23 15:24       ` [U-Boot] [PATCH 1/2 V2] mips: add endianness support Shinya Kuribayashi
2009-05-23 15:19         ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-23 17:58           ` Shinya Kuribayashi
2009-05-23 19:41             ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-23 19:42             ` [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile Jean-Christophe PLAGNIOL-VILLARD
2009-05-23 19:42               ` [U-Boot] [PATCH 2/3] mips: add endianness support Jean-Christophe PLAGNIOL-VILLARD
2009-05-23 19:42                 ` [U-Boot] [PATCH 3/3] mips: unify lds Jean-Christophe PLAGNIOL-VILLARD
2009-05-31 22:27                   ` Wolfgang Denk
2009-05-31 22:26                 ` [U-Boot] [PATCH 2/3] mips: add endianness support Wolfgang Denk
2009-05-23 22:28               ` [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile Wolfgang Denk
2009-05-24 15:18                 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-24 17:13                   ` Wolfgang Denk
2009-06-23 14:34               ` Shinya Kuribayashi
2009-06-23 15:14                 ` Jean-Christophe PLAGNIOL-VILLARD
2009-06-23 15:40                   ` Shinya Kuribayashi
2009-06-23 21:26                     ` Jean-Christophe PLAGNIOL-VILLARD
2009-06-23 17:07               ` Mike Frysinger
2009-06-23 17:33                 ` Jean-Christophe PLAGNIOL-VILLARD
2009-07-10 22:35                 ` Wolfgang Denk
2009-07-11  3:18                   ` Mike Frysinger
2009-07-17 19:18               ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.