From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 1 Nov 2012 00:45:40 +0100 Subject: [U-Boot] [PATCH] common: Link with GCC instead of LD In-Reply-To: <20121031233257.5F3F32005BD@gemini.denx.de> References: <1351701168-7293-1-git-send-email-marex@denx.de> <201210312351.35977.marex@denx.de> <20121031233257.5F3F32005BD@gemini.denx.de> Message-ID: <201211010045.40817.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Wolfgang Denk, > Dear Marek, > > In message <201210312351.35977.marex@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? It's all the rage now (better ignore this point) ;-) > > 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... We've been digging with Albert, but nothing we can release just yet. This is a groundwork patch. > > 3) Usage of LLVM/CLANG is now much more straightforward > > Please elucidate? Now you can simply replace gcc with clang and that _should_ work. Sure, I expect more work will be needed here, but this patch gives you all the ground to do that. > > 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. GCC can do all the optimization magic (LTO ...) and then just let linker do the linking. > > 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. No, I won't, I don't have that part ready yet. Besides, the sandbox target already uses gcc linking. Shall we also convert it to use LD instead then ? Best regards, Marek Vasut