[U-Boot] [PATCH] Fix build failure in examples/standalone

Premi, Sanjeev premi at ti.com
Fri Nov 6 16:00:13 CET 2009


> -----Original Message-----
> From: u-boot-bounces at lists.denx.de 
> [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Premi, Sanjeev
> Sent: Friday, November 06, 2009 8:21 PM
> To: Wolfgang Denk
> Cc: u-boot at lists.denx.de
> Subject: Re: [U-Boot] [PATCH] Fix build failure in examples/standalone
> 
> > -----Original Message-----
> > From: Wolfgang Denk [mailto:wd at denx.de] 
> > Sent: Friday, November 06, 2009 6:15 PM
> > To: Premi, Sanjeev
> > Cc: u-boot at lists.denx.de
> > Subject: Re: [U-Boot] [PATCH] Fix build failure in 
> examples/standalone
> > 
> > Dear Sanjeev Premi,
> > 
> > In message <1257499011-28064-1-git-send-email-premi at ti.com> 
> you 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:
> 
> diff --git a/examples/standalone/Makefile 
> b/examples/standalone/Makefile
> index 5e2f2bc..e9c3a54 100644
> --- 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
> for dir in tools examples/standalone examples/api ; do make 
> -C $dir _depend ; done
> make[1]: Entering directory `/home/sanjeev/u-boot/tools'
> make[1]: Nothing to be done for `_depend'.
> make[1]: Leaving directory `/home/sanjeev/u-boot/tools'
> make[1]: Entering directory `/home/sanjeev/u-boot/examples/standalone'
> Makefile:47: *** *** COBJS evaluates to [hello_world.o 
> smc911x_eeprom.o   .o].  Stop.
> make[1]: Leaving directory `/home/sanjeev/u-boot/examples/standalone'
> make[1]: Entering directory `/home/sanjeev/u-boot/examples/api'
> make[1]: Nothing to be done for `_depend'.
> make[1]: Leaving directory `/home/sanjeev/u-boot/examples/api'
> make -C tools all
> make[1]: Entering directory `/home/sanjeev/u-boot/tools'
> make[1]: Leaving directory `/home/sanjeev/u-boot/tools'
> make -C examples/standalone all
> make[1]: Entering directory `/home/sanjeev/u-boot/examples/standalone'
> Makefile:47: *** *** COBJS evaluates to [hello_world.o 
> smc911x_eeprom.o   .o].  Stop.
> make[1]: Leaving directory `/home/sanjeev/u-boot/examples/standalone'
> make: *** [examples/standalone] Error 2
> 
> 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.

Best regards,
Sanjeev

> > 
> > 
> > Can you please let me know which exact versions of "make" (output of
> > "make --version") and cross-gcc (output of
> > "arm-none-linux-gnueabi-gcc --version") you are running?
> > 
> 
> premi # make --version
> GNU Make 3.80
> Copyright (C) 2002  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.
> premi #
> premi #
> premi # arm-none-linux-gnueabi-gcc --version
> arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q1-203) 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.
> 
> Best regards,
> Sanjeev
> 
> > 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
> > The Gates in my computer are AND, OR and NOT; they are not Bill.
> > 
> > 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
> 
> 


More information about the U-Boot mailing list