From: Mike Frysinger Date: Fri, 6 Nov 2009 12:22:15 -0400 Subject: [U-Boot] [PATCH] Fix build failure in examples/standalone In-Reply-To: References: <1257499011-28064-1-git-send-email-premi@ti.com> Message-ID: <200911061122.16814.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Friday 06 November 2009 10:00:13 Premi, Sanjeev wrote: > From: Premi, Sanjeev > > From: Wolfgang Denk > > > Sanjeev Premi wrote: > > > > The variable ELF contains many leading spaces. This adds > > > > a 'fake' source file variable COBJS. It leads to build > > > > failure as below: > > > > > > I read about the bug reports, but I cannot reproduce this on any > > > system I'm running. > > > > > > Also, why would any white space matter here? > > > > I was surprised too. It is the first time ever I have seen > > this problem > > with any Makefile over years. > > > > To debug I tried this: > > > > --- a/examples/standalone/Makefile > > +++ b/examples/standalone/Makefile > > @@ -42,7 +42,9 @@ ELF := $(ELF-y) $(ELF-$(ARCH)) > > $(ELF-$(BOARD)) $(ELF-$(CPU)) > > SREC = $(addsuffix .srec,$(ELF)) > > BIN = $(addsuffix .bin,$(ELF)) > > > > + > > COBJS := $(ELF:=.o) > > +$(error *** COBJS evaluates to [$(COBJS)]) > > > > LIB = $(obj)libstubs.a > > > > And the result is: > > > > premi # make > > Makefile:47: *** *** COBJS evaluates to [hello_world.o > > smc911x_eeprom.o .o]. Stop. > > > > Notice the "empty" .o in the output. This prompted me to use > > $(strip ...) > > Just after pressing this "ENTER", I tried the following: > [Moved $(ELF-y) to end of the assignment and kill trailing spaces] > > -ELF := $(ELF-y) $(ELF-$(ARCH)) $(ELF-$(BOARD)) $(ELF-$(CPU)) > +ELF := $(ELF-$(ARCH)) $(ELF-$(BOARD)) $(ELF-$(CPU)) $(ELF-y) > > And it worked! The message for COBJS shows: > > Makefile:47: *** *** COBJS evaluates to [ hello_world.o > smc911x_eeprom.o]. Stop. > > So, maybe "make v3.80" has problems with trailing spaces. > > For the fix, I can resubmit with the change shown above OR we could > keep the original. Let me know your thoughts. i kind of prefer this method. if we go with the first method, it needs to have a comment there explaining why the strip exists: # we need the strip to workaround a bug in make-3.80 and whitespace/:= -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/20091106/f86846fe/attachment.pgp