[U-Boot] [PATCH] common: Link with GCC instead of LD

Wolfgang Denk wd at denx.de
Thu Nov 1 00:32:57 CET 2012


Dear Marek,

In message <201210312351.35977.marex at denx.de> you wrote:
> 
> > Could you please explain these supposed benefits in a bit more detail?
> 
> Yes, thanks for the review (I really needed one from you on this)!
> 
> So, here comes the list:
> 1) It's cool to link with gcc, duh ;-)

Is it - and why exactly?

> 2) You can enable LTO eventually -- long term plan -- which proved can shrink 
> the code size a bit

Do you have a workign example?  You know, we don;t like adding dead
code...

> 3) Usage of LLVM/CLANG is now much more straightforward

Please elucidate?

> 4) Binutils usually lag behind the GCC development a bit, by using GCC to do the 
> link, we can remedy this problem

Grrrrghhhg.  I lost you here.  By not calling ld directly (where we
know exactly what we are doing), but through a (somewhat unknown) GCC
framework, we can magicly adjust any (claimed - by you) version
differences?   I cannot parse this.

> But actually, the 2) is the most important part. LTO will hopefully help us 
> optimize U-Boot for size even better than it is now. But that will still need 
> much more research. So this is only a patch that shall prepare the groundwork 
> for this further research.

As is, it's just unused or dead code that adds a lot of complexity and
buys nothing.  Please submit as part of a patch series that makes
successfull (and tested) use of LTO.


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
To understand a program you must become  both  the  machine  and  the
program.


More information about the U-Boot mailing list