Skip to contentSkip to conversation

Build issues with a number of 83xx boards

U-Boot New Wolfgang Denk 4 participants 13 messages Mar 31, 2011

lore
Share & tools
lore
#0 lore raw

Dear Kim & Kumar,

are you aware that a number of 83xx boards don't build any more? I see errors like these:

Configuring for MPC8313ERDB_NAND_33 - Board: MPC8313ERDB, Options: SYS_33MHZ,NAND_U_BOOT
ppc_6xx-ld: cannot open linker script file u-boot.lds: No such file or directory
make[1]: *** [/work/wd/tmp-ppc/nand_spl/u-boot-spl] Error 1

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
For every complex problem, there is a solution that is simple,  neat,
and wrong.                                               - Mark Twain
#1 lore raw

Hi all,

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

are you aware that a number of 83xx boards don't build any more? I see errors like these:

Configuring for MPC8313ERDB_NAND_33 - Board: MPC8313ERDB, Options: SYS_33MHZ,NAND_U_BOOT
ppc_6xx-ld: cannot open linker script file u-boot.lds: No such file or directory
make[1]: *** [/work/wd/tmp-ppc/nand_spl/u-boot-spl] Error 1

The culprit is this commit:

	6dc1eceb9c5f42216f1ba0e0ef538015b0aa10bc is the first bad
	commit
	commit 6dc1eceb9c5f42216f1ba0e0ef538015b0aa10bc
	Author: Haiying Wang <[email protected]>
	Date:   Tue Feb 22 16:38:05 2011 -0500

	    Introduce a new linker flag LDFLAGS_FINAL

It appears this has never been tested with out-of-tree builds!

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"When anyone says `theoretically,' they really mean `not really.'"
- David Parnas
#2 lore raw

PATCH 1/1 Fix build issues cause by LDFLAGS_FINAL changes

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.

---
 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(-)
nand_spl/board/amcc/acadia/Makefile +3 -3
index f4323d5..84cb8ab 100644
@@ -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
nand_spl/board/amcc/bamboo/Makefile +3 -3
index 15af860..6430219 100644
@@ -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
 
nand_spl/board/amcc/canyonlands/Makefile +3 -3
index 62c77d8..509a46e 100644
@@ -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
 
nand_spl/board/amcc/kilauea/Makefile +3 -3
index 1053ce3..104b7e2 100644
@@ -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
 
nand_spl/board/amcc/sequoia/Makefile +3 -3
index 9516b5c..54e8a12 100644
@@ -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	= denali_data_eye.o 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
 
nand_spl/board/freescale/mpc8313erdb/Makefile +3 -3
index 2f83e2b..cff2a43 100644
@@ -27,6 +27,8 @@ PAD_TO := 0xfff04000
 
 include $(TOPDIR)/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_SPL) \
 	   $(LDFLAGS) $(LDFLAGS_FINAL)
@@ -40,9 +42,7 @@ COBJS	= nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o nand_init.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
 
nand_spl/board/freescale/mpc8315erdb/Makefile +3 -3
index 2f83e2b..cff2a43 100644
@@ -27,6 +27,8 @@ PAD_TO := 0xfff04000
 
 include $(TOPDIR)/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_SPL) \
 	   $(LDFLAGS) $(LDFLAGS_FINAL)
@@ -40,9 +42,7 @@ COBJS	= nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o nand_init.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
 
nand_spl/board/freescale/mpc8536ds/Makefile +3 -3
index 7ed6cea..a0e1455 100644
@@ -29,6 +29,8 @@ PAD_TO := 0xfff01000
 
 include $(TOPDIR)/config.mk
 
+nandobj	:= $(OBJTREE)/nand_spl/
+
 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
 LDFLAGS := -T $(LDSCRIPT) -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(LDFLAGS) \
 	   $(LDFLAGS_FINAL)
@@ -42,9 +44,7 @@ COBJS	= cache.o cpu_init_early.o cpu_init_nand.o fsl_law.o law.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
 
nand_spl/board/freescale/mpc8569mds/Makefile +3 -3
index 7ed6cea..a0e1455 100644
@@ -29,6 +29,8 @@ PAD_TO := 0xfff01000
 
 include $(TOPDIR)/config.mk
 
+nandobj	:= $(OBJTREE)/nand_spl/
+
 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
 LDFLAGS := -T $(LDSCRIPT) -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(LDFLAGS) \
 	   $(LDFLAGS_FINAL)
@@ -42,9 +44,7 @@ COBJS	= cache.o cpu_init_early.o cpu_init_nand.o fsl_law.o law.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
 
nand_spl/board/freescale/mpc8572ds/Makefile +3 -3
index 862c014..092ce14 100644
@@ -29,6 +29,8 @@ PAD_TO := 0xfff01000
 
 include $(TOPDIR)/config.mk
 
+nandobj	:= $(OBJTREE)/nand_spl/
+
 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
 LDFLAGS := -T $(LDSCRIPT) -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(LDFLAGS) \
 	   $(LDFLAGS_FINAL)
@@ -42,9 +44,7 @@ COBJS	= cache.o cpu_init_early.o cpu_init_nand.o fsl_law.o law.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
 
nand_spl/board/sheldon/simpc8313/Makefile +3 -3
index aacbd04..2a3ddac 100644
@@ -27,6 +27,8 @@ NAND_SPL := y
 
 include $(TOPDIR)/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_SPL) \
 	   $(LDFLAGS) $(LDFLAGS_FINAL)
@@ -40,9 +42,7 @@ COBJS	= nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o nand_init.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
 
Signature · 1 line
1.7.4
#3 lore raw

PATCH 1/1 Fix build issues cause by LDFLAGS_FINAL changes

Dear Wolfgang,

Quoted 3 lines · 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.

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

#7 lore raw
In reply to Wolfgang Denk
Quoted 9 lines · On Thu, 31 Mar 2011 11:19:15 +0200 Wolfgang Denk <[email protected]> wrote:

Dear Kim & Kumar,

are you aware that a number of 83xx boards don't build any more? I see errors like these:

Configuring for MPC8313ERDB_NAND_33 - Board: MPC8313ERDB, Options: SYS_33MHZ,NAND_U_BOOT
ppc_6xx-ld: cannot open linker script file u-boot.lds: No such file or directory
make[1]: *** [/work/wd/tmp-ppc/nand_spl/u-boot-spl] Error 1

this isn't 83xx-specific; the nand_spl target was source tree build dependent. Scott already has a fix in his next branch:

http://git.denx.de/?p=u-boot/u-boot-nand-flash.git;a=commit;h=f13a375e5875acbfec298e9967d2f234f027ab16

Scott, please push this commit upstream to fix out of source tree NAND builds.

Kim

#4 lore raw

PATCH 1/1 Fix build issues cause by LDFLAGS_FINAL changes

In reply to Haiying Wang

Dear Haiying Wang,

Quoted 2 lines · 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...

Quoted 3 lines

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

Signature · 8 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
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
#8 lore raw
In reply to Kim Phillips

Dear Kim Phillips,

Quoted 13 lines · In message <[email protected]> you wrote:
Quoted 9 lines · On Thu, 31 Mar 2011 11:19:15 +0200 Wolfgang Denk <[email protected]> wrote:

Dear Kim & Kumar,

are you aware that a number of 83xx boards don't build any more? I see errors like these:

Configuring for MPC8313ERDB_NAND_33 - Board: MPC8313ERDB, Options: SYS_33MHZ,NAND_U_BOOT
ppc_6xx-ld: cannot open linker script file u-boot.lds: No such file or directory
make[1]: *** [/work/wd/tmp-ppc/nand_spl/u-boot-spl] Error 1

Quoted 7 lines

this isn't 83xx-specific; the nand_spl target was source tree build dependent. Scott already has a fix in his next branch:

http://git.denx.de/?p=u-boot/u-boot-nand-flash.git;a=commit;h=f13a375e5875acbfec298e9967d2f234f027ab16

Scott, please push this commit upstream to fix out of source tree NAND builds.

See my previous mail with a fix.

Why put such fiuxes into a NEXT branch when we're trying to get a release ot?

That's ...

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Where there's no emotion, there's no motive for violence.
	-- Spock, "Dagger of the Mind", stardate 2715.1
#5 lore raw

PATCH 1/1 Fix build issues cause by LDFLAGS_FINAL changes

In reply to Wolfgang Denk

Review

Quoted 12 lines · Wolfgang Denk
Quoted 3 lines

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

(quoted diff) +2 -1
-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.

Quoted 2 lines

[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

#9 lore raw
In reply to Wolfgang Denk
Quoted 24 lines · On Thu, 31 Mar 2011 17:40:17 +0200 Wolfgang Denk <[email protected]> wrote:

Dear Kim Phillips,

Quoted 13 lines · In message <[email protected]> you wrote:
Quoted 9 lines · On Thu, 31 Mar 2011 11:19:15 +0200 Wolfgang Denk <[email protected]> wrote:

Dear Kim & Kumar,

are you aware that a number of 83xx boards don't build any more? I see errors like these:

Configuring for MPC8313ERDB_NAND_33 - Board: MPC8313ERDB, Options: SYS_33MHZ,NAND_U_BOOT
ppc_6xx-ld: cannot open linker script file u-boot.lds: No such file or directory
make[1]: *** [/work/wd/tmp-ppc/nand_spl/u-boot-spl] Error 1

Quoted 7 lines

this isn't 83xx-specific; the nand_spl target was source tree build dependent. Scott already has a fix in his next branch:

http://git.denx.de/?p=u-boot/u-boot-nand-flash.git;a=commit;h=f13a375e5875acbfec298e9967d2f234f027ab16

Scott, please push this commit upstream to fix out of source tree NAND builds.

Quoted 7 lines

See my previous mail with a fix.

Why put such fiuxes into a NEXT branch when we're trying to get a release ot?

That's ...

The patch Kim quoted, which is in my next branch, is unrelated to the above error. It is a cleanup patch.

I don't see the above error with top-of-tree:

$ CROSS_COMPILE=~/ppc-tc-4.5/bin/powerpc-linux-gnu- ./MAKEALL MPC8313ERDB_NAND_33
Configuring for MPC8313ERDB_NAND_33 - Board: MPC8313ERDB, Options: SYS_33MHZ,NAND_U_BOOT
   text    data     bss     dec     hex filename
 250372   27944   42056  320372   4e374 ./u-boot

--------------------- SUMMARY ---------------------------- Boards compiled: 1
----------------------------------------------------------

$ git describe HEAD
v2011.03-rc2-6-gb12fee0

-Scott

#10 lore raw
Quoted 8 lines · On Thu, 31 Mar 2011 11:21:09 -0500 Scott Wood <[email protected]> wrote:
Quoted 6 lines · On Thu, 31 Mar 2011 17:40:17 +0200 Wolfgang Denk <[email protected]> wrote:
Quoted 2 lines · In message <[email protected]> you wrote:

Scott, please push this commit upstream to fix out of source tree NAND builds.

See my previous mail with a fix.

Quoted 7 lines
Quoted 4 lines

Why put such fiuxes into a NEXT branch when we're trying to get a release ot?

That's ...

The patch Kim quoted, which is in my next branch, is unrelated to the above error. It is a cleanup patch.

it prepends the build directory $(obj) to the nand_spl target. But now WD has posted another patch (that seems more invasive than the one I quoted).

Quoted 3 lines

I don't see the above error with top-of-tree:

$ CROSS_COMPILE=~/ppc-tc-4.5/bin/powerpc-linux-gnu- ./MAKEALL MPC8313ERDB_NAND_33

try BUILD_DIR=/tmp/hah ./MAKEALL MPC8313ERDB_NAND_33

Kim

#11 lore raw
Quoted 14 lines · On Thu, 31 Mar 2011 11:51:30 -0500 Kim Phillips <[email protected]>…
Quoted 11 lines · On Thu, 31 Mar 2011 11:21:09 -0500 Scott Wood <[email protected]> wrote:
Quoted 9 lines · On Thu, 31 Mar 2011 17:40:17 +0200 Wolfgang Denk <[email protected]> wrote:
Quoted 2 lines · In message <[email protected]> you wrote:

Scott, please push this commit upstream to fix out of source tree NAND builds.

See my previous mail with a fix.

Why put such fiuxes into a NEXT branch when we're trying to get a release ot?

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

That's ...

The patch Kim quoted, which is in my next branch, is unrelated to the above error. It is a cleanup patch.

it prepends the build directory $(obj) to the nand_spl target.

The build directory was always prepended to the nand_spl target. That patch just moves where the target was defined.

The problem is with $(nandobj) in the nand_spl makefiles.

Quoted 3 lines

But now
WD has posted another patch (that seems more invasive than the one I quoted).

It's solving a different problem, and it's the right fix -- it's better to avoid depending on deferred evaluation if we can do so reasonably.

Quoted 5 lines
Quoted 3 lines

I don't see the above error with top-of-tree:

$ CROSS_COMPILE=~/ppc-tc-4.5/bin/powerpc-linux-gnu- ./MAKEALL MPC8313ERDB_NAND_33

try BUILD_DIR=/tmp/hah ./MAKEALL MPC8313ERDB_NAND_33

Right, I saw afterward that it was an out-of-tree build. I see the same thing in my next branch, once I rebase onto Wolfgang's current master which has the LDFLAGS_FINAL patch.

"Fix NAND_SPL and ONENAND_IPL in Makefile" has nothing to do with this.

-Scott

#6 lore raw

PATCH 1/1 Fix build issues cause by LDFLAGS_FINAL changes

In reply to Wolfgang Denk
Quoted 7 lines · On Thu, 31 Mar 2011 16:52:31 +0200 Wolfgang Denk <[email protected]> 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.

Quoted 13 lines
---
 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

#12 lore raw
In reply to Scott Wood

Dear Scott Wood,

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

I don't see the above error with top-of-tree:

$ CROSS_COMPILE=~/ppc-tc-4.5/bin/powerpc-linux-gnu- ./MAKEALL MPC8313ERDB_NAND_33
Configuring for MPC8313ERDB_NAND_33 - Board: MPC8313ERDB, Options: SYS_33MHZ,NAND_U_BOOT
   text    data     bss     dec     hex filename
 250372   27944   42056  320372   4e374 ./u-boot

No, you don't see it, because you're not building out of tree.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A quarrel is quickly settled when deserted by one party; there is  no
battle unless there be two.                                  - Seneca