This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] LTO support for Mach-O (apple-darwin)



On 2 May 2010, at 03:53, Steven Bosscher wrote:
This patch adds support for LTO on Mach-O targets, i.e. darwin.

Bravo!


There are a couple of funny things this patch does to make LTO work on
Mach-O. The most noticeable is that I had to capture assembler output
in the LTO generate phase and redirect it to a temporary file. The
reason is that you can only define relocations in a relocatable Mach-O
object for the first 255 sections, although there doesn't seem to be a
limit to the number of sections you can add. So I want all non-LTO
sections output before the LTO sections.

I want to understand this better -- I don't think we name anything like 255 distinct sections (even with OBJC2 ones in place).


and appear to work, but I run into some issues with Mach-O PIC on
32-bits darwin that I don't know (yet?) how to fix. So 32-bits Mach-O
LTO support is left as an exercise for the interested reader ;-)

I've applied your patch on top of all my patches (I.m on vacation and don't have the luxury of several independent trees) .. and bootstrapped on i686.


I've a hunch that the issue is that variables are being optimized away by the lto - but the references need to be re-written .. but that's a thought-experiment and I won't be able to do much more until back in the office.

I'll also try powerpc and ppc64 at some stage,,,,

great stuff!
Iain


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]