[U-Boot] [PATCH] ARM: compiler options cleanup - improve tool chain support

Simon Kagstrom simon.kagstrom at netinsight.net
Mon Aug 24 14:59:09 CEST 2009


On Mon, 24 Aug 2009 05:41:59 -0700
Prafulla Wadaskar <prafulla at marvell.com> wrote:

> I get following erro only if I execute following build command
> make mrproper; make sheevaplug_config; make USE_PRIVATE_LIBGCC=no
> CROSS_COMPILE=armv5tel-redhat-linux-gnueabi- 2> warn.txt
> 
> And cat warn.txt 
> armv5tel-redhat-linux-gnueabi-ld: cannot find -lgcc
> make: *** [u-boot] Error 1
> 
> Whereas,
> if I unset first USE_PRIVATE_LIBGCC then I do not get this error and build is through
> My invocation may be wrong but shouldn't it treat USE_PRIVATE_LIBGCC=no as unset?

Well, I also got confused by this, but went through Wolfgangs exercise
program. The top-level Makefile treats USE_PRIVATE_LIBGCC like this:

   # Add GCC lib
   ifdef USE_PRIVATE_LIBGCC
   ifeq ("$(USE_PRIVATE_LIBGCC)", "yes")
   PLATFORM_LIBGCC = -L $(OBJTREE)/lib_$(ARCH) -lgcc
   else
   PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc
   endif
   else
   PLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
   endif
   PLATFORM_LIBS += $(PLATFORM_LIBGCC)
   export PLATFORM_LIBS

and in this case, since USE_PRIVATE_LIBGCC is defined, but is not
"yes", we will use it to set the linker search path. And indeed, it
tries to link with

   arm-unknown-linux-gnu-ld -Bstatic -T u-boot.lds [...] -L no -lgcc -Map u-boot.map -o u-boot

which ... will fail.

// Simon


More information about the U-Boot mailing list