From: Haiying Wang Date: Thu, 31 Mar 2011 12:06:11 -0400 Subject: [U-Boot] [PATCH] Fix build issues cause by LDFLAGS_FINAL changes In-Reply-To: <20110331153738.C1767F03208@gemini.denx.de> References: <20110331105346.32058F03208@gemini.denx.de> <1301583151-23170-1-git-send-email-wd@denx.de> <1301583985.1991.4.camel@haiying-laptop> <20110331153738.C1767F03208@gemini.denx.de> Message-ID: <1301587571.1991.45.camel@haiying-laptop> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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