[U-Boot] [PATCH] Fix build issues cause by LDFLAGS_FINAL changes

2011-03-31 Thread Wolfgang Denk
Commit 6dc1ece Introduce a new linker flag LDFLAGS_FINAL modified a
number of Makefiles in a way that broke out-of-tree builds.  The
problem was that $(nandobj) was used before it got defined.

Fix this.

Signed-off-by: Wolfgang Denk w...@denx.de
---
 nand_spl/board/amcc/acadia/Makefile   |6 +++---
 nand_spl/board/amcc/bamboo/Makefile   |6 +++---
 nand_spl/board/amcc/canyonlands/Makefile  |6 +++---
 nand_spl/board/amcc/kilauea/Makefile  |6 +++---
 nand_spl/board/amcc/sequoia/Makefile  |6 +++---
 nand_spl/board/freescale/mpc8313erdb/Makefile |6 +++---
 nand_spl/board/freescale/mpc8315erdb/Makefile |6 +++---
 nand_spl/board/freescale/mpc8536ds/Makefile   |6 +++---
 nand_spl/board/freescale/mpc8569mds/Makefile  |6 +++---
 nand_spl/board/freescale/mpc8572ds/Makefile   |6 +++---
 nand_spl/board/sheldon/simpc8313/Makefile |6 +++---
 11 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/nand_spl/board/amcc/acadia/Makefile 
b/nand_spl/board/amcc/acadia/Makefile
index f4323d5..84cb8ab 100644
--- a/nand_spl/board/amcc/acadia/Makefile
+++ b/nand_spl/board/amcc/acadia/Makefile
@@ -24,6 +24,8 @@
 include $(TOPDIR)/config.mk
 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 
+nandobj:= $(OBJTREE)/nand_spl/
+
 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
   $(LDFLAGS_FINAL)
@@ -36,9 +38,7 @@ COBJS = gpio.o nand_boot.o nand_ecc.o memory.o ndfc.o pll.o
 SRCS   := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 __OBJS := $(SOBJS) $(COBJS)
-LNDIR  := $(OBJTREE)/nand_spl/board/$(BOARDDIR)
-
-nandobj:= $(OBJTREE)/nand_spl/
+LNDIR  := $(nandobj)board/$(BOARDDIR)
 
 ALL= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin 
$(nandobj)u-boot-spl-16k.bin \
$(nandobj)System.map
diff --git a/nand_spl/board/amcc/bamboo/Makefile 
b/nand_spl/board/amcc/bamboo/Makefile
index 15af860..6430219 100644
--- a/nand_spl/board/amcc/bamboo/Makefile
+++ b/nand_spl/board/amcc/bamboo/Makefile
@@ -24,6 +24,8 @@
 include $(TOPDIR)/config.mk
 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 
+nandobj:= $(OBJTREE)/nand_spl/
+
 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
   $(LDFLAGS_FINAL)
@@ -36,9 +38,7 @@ COBJS = nand_boot.o nand_ecc.o ndfc.o sdram.o
 SRCS   := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 __OBJS := $(SOBJS) $(COBJS)
-LNDIR  := $(OBJTREE)/nand_spl/board/$(BOARDDIR)
-
-nandobj:= $(OBJTREE)/nand_spl/
+LNDIR  := $(nandobj)board/$(BOARDDIR)
 
 ALL= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin 
$(nandobj)u-boot-spl-16k.bin
 
diff --git a/nand_spl/board/amcc/canyonlands/Makefile 
b/nand_spl/board/amcc/canyonlands/Makefile
index 62c77d8..509a46e 100644
--- a/nand_spl/board/amcc/canyonlands/Makefile
+++ b/nand_spl/board/amcc/canyonlands/Makefile
@@ -24,6 +24,8 @@
 include $(TOPDIR)/config.mk
 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 
+nandobj:= $(OBJTREE)/nand_spl/
+
 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
   $(LDFLAGS_FINAL)
@@ -41,9 +43,7 @@ COBJS += ndfc.o
 SRCS   := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 __OBJS := $(SOBJS) $(COBJS)
-LNDIR  := $(OBJTREE)/nand_spl/board/$(BOARDDIR)
-
-nandobj:= $(OBJTREE)/nand_spl/
+LNDIR  := $(nandobj)board/$(BOARDDIR)
 
 ALL= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin 
$(nandobj)u-boot-spl-16k.bin
 
diff --git a/nand_spl/board/amcc/kilauea/Makefile 
b/nand_spl/board/amcc/kilauea/Makefile
index 1053ce3..104b7e2 100644
--- a/nand_spl/board/amcc/kilauea/Makefile
+++ b/nand_spl/board/amcc/kilauea/Makefile
@@ -24,6 +24,8 @@
 include $(TOPDIR)/config.mk
 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 
+nandobj:= $(OBJTREE)/nand_spl/
+
 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
   $(LDFLAGS_FINAL)
@@ -36,9 +38,7 @@ COBJS = 44x_spd_ddr2.o nand_boot.o nand_ecc.o ndfc.o
 SRCS   := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 __OBJS := $(SOBJS) $(COBJS)
-LNDIR  := $(OBJTREE)/nand_spl/board/$(BOARDDIR)
-
-nandobj:= $(OBJTREE)/nand_spl/
+LNDIR  := $(nandobj)board/$(BOARDDIR)
 
 ALL= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin 
$(nandobj)u-boot-spl-16k.bin
 
diff --git a/nand_spl/board/amcc/sequoia/Makefile 
b/nand_spl/board/amcc/sequoia/Makefile
index 9516b5c..54e8a12 100644
--- a/nand_spl/board/amcc/sequoia/Makefile
+++ b/nand_spl/board/amcc/sequoia/Makefile
@@ -24,6 +24,8 

Re: [U-Boot] [PATCH] Fix build issues cause by LDFLAGS_FINAL changes

2011-03-31 Thread Haiying Wang
Dear Wolfgang,
On Thu, 2011-03-31 at 16:52 +0200, Wolfgang Denk wrote:
 Commit 6dc1ece Introduce a new linker flag LDFLAGS_FINAL modified a
 number of Makefiles in a way that broke out-of-tree builds.  The
 problem was that $(nandobj) was used before it got defined.
What is out-of-tree builds? Why did LDFLAGS_FINAL patch break it? the
$(nandobj) was defined in those Makefiles in that way before applying
LDFLAGS_FINAL patch. Why could the out-of-tree builds passed before
applying LDFLAG_FINAL patch?

Thanks.

Haiying



___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Fix build issues cause by LDFLAGS_FINAL changes

2011-03-31 Thread Wolfgang Denk
Dear Haiying Wang,

In message 1301583985.1991.4.camel@haiying-laptop you wrote:

 What is out-of-tree builds? Why did LDFLAGS_FINAL patch break it? the

out-of-tree building means that you store all build results in some
other directory, outside of the source tree. See item 3 under Notes at
http://www.denx.de/wiki/U-Boot/Patches

Your patch broke it because it referenced $(nandobj) before defining
it - aslong as the build directory and the source directory are the
same, this makes no difference.  But for out-of-tree builds...

 $(nandobj) was defined in those Makefiles in that way before applying
 LDFLAGS_FINAL patch. Why could the out-of-tree builds passed before
 applying LDFLAG_FINAL patch?

Have a look at the changes introduced by your commit, and you will
see.  The problem is a bit buried in the changes of = into := and
$(PLATFORM_LDFLAGS) into $(LDFLAGS) $(LDFLAGS_FINAL) in lines like
these:

-LDFLAGS= -Bstatic -T $(nandobj)u-boot.lds -Ttext 
$(CONFIG_SYS_TEXT_BASE) $(PLATFORM_LDFLAGS)
+LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
+  $(LDFLAGS_FINAL)


[It is a bit strange to append to LDFLAGS line that.]

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: w...@denx.de
You say you are lying. But if everything you say is a lie,  then  you
are  telling  the truth. You cannot tell the truth because everything
you say is a lie. You lie, you tell the truth ... but you cannot, for
you lie.
-- Norman the android, I, Mudd, stardate 4513.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Fix build issues cause by LDFLAGS_FINAL changes

2011-03-31 Thread Haiying Wang
On Thu, 2011-03-31 at 17:37 +0200, Wolfgang Denk wrote:

  $(nandobj) was defined in those Makefiles in that way before applying
  LDFLAGS_FINAL patch. Why could the out-of-tree builds passed before
  applying LDFLAG_FINAL patch?
 
 Have a look at the changes introduced by your commit, and you will
 see.  The problem is a bit buried in the changes of = into := and
 $(PLATFORM_LDFLAGS) into $(LDFLAGS) $(LDFLAGS_FINAL) in lines like
 these:
 
 -LDFLAGS= -Bstatic -T $(nandobj)u-boot.lds -Ttext 
 $(CONFIG_SYS_TEXT_BASE) $(PLATFORM_LDFLAGS)
 +LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) 
 \
 +  $(LDFLAGS_FINAL)

Oh,yes, I got it now. := will expand the variables immediately and =
will delay the expansion until the new variable is referenced, which can
explain the $(nandobj)worked before this patch. 

 
 [It is a bit strange to append to LDFLAGS line that.]
The reason I used := was because I added LDFLAGS_FINAL += -Bstatic
$(LDFLAGS) in my first version of this patch, but it seems that it is
not necessary to do so after I remove $(LDFLAGS) for LDFLAGS_FINAL.

Thanks for pointing it out.

Haiying


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Fix build issues cause by LDFLAGS_FINAL changes

2011-03-31 Thread Scott Wood
On Thu, 31 Mar 2011 16:52:31 +0200
Wolfgang Denk w...@denx.de wrote:

 Commit 6dc1ece Introduce a new linker flag LDFLAGS_FINAL modified a
 number of Makefiles in a way that broke out-of-tree builds.  The
 problem was that $(nandobj) was used before it got defined.
 
 Fix this.
 
 Signed-off-by: Wolfgang Denk w...@denx.de
 ---
  nand_spl/board/amcc/acadia/Makefile   |6 +++---
  nand_spl/board/amcc/bamboo/Makefile   |6 +++---
  nand_spl/board/amcc/canyonlands/Makefile  |6 +++---
  nand_spl/board/amcc/kilauea/Makefile  |6 +++---
  nand_spl/board/amcc/sequoia/Makefile  |6 +++---
  nand_spl/board/freescale/mpc8313erdb/Makefile |6 +++---
  nand_spl/board/freescale/mpc8315erdb/Makefile |6 +++---
  nand_spl/board/freescale/mpc8536ds/Makefile   |6 +++---
  nand_spl/board/freescale/mpc8569mds/Makefile  |6 +++---
  nand_spl/board/freescale/mpc8572ds/Makefile   |6 +++---
  nand_spl/board/sheldon/simpc8313/Makefile |6 +++---
  11 files changed, 33 insertions(+), 33 deletions(-)

Also needed in da8xxevm, tx25, smdk6400, and mx31pdk.

Should also be done in p1_p2_rdb for consistency (it doesn't use nandobj in
LDFLAGS, but neither do the ohter 85xx that got updated).

-Scott

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot