On Sun, Mar 13, 2011 at 12:39:26PM +0100, Jan Hubicka wrote: > > With release of Xcode 3.2.6/4.0 this week, an unfortunate change was > > made to > > the darwin assembler which effectively breaks LTO support for darwin. The > > design > > of LTO on darwin was based on the fact that mach-o object files tolerated > > additional > > sections as long as they didin't contain symbols. With Xcode 3.2.6/4.0, the > > assembler > > appears to be strictly counting sections and objecting when these exceed > > 255. This > > breaks huge sections of the lto testsuite and prevents larger projects like > > xplor-nih > > to compile if Xcode 3.2.6/4.0 is installed. I am afraid that unless Apple > > reverts this > > change, our only recourse would be to resort to an elf object container for > > the lto > > sections within the mach-o files (introducing an undesired dependency on > > libelf for > > FSF gcc on darwin). My understanding was that the lto design did not allow > > the number > > of sections required in the lto files to be reduced. > > If the problem is not fixed, we could always pack all the LTO sections into > one section containing > our own subsections. > > Honza
Jan, It appears this change is highly unlikely to be fixed. Chris Lattner said... > Jack, various datastructures in the toolchain and the .o file only store the > section number as a byte. > Allowing it to overflow just masks bugs because section id's will be silently > truncated. You > should fix the GCC LTO model to store one big section with its own > subcontents if you want more granularity. So lto-object.c needs a rewrite to use only a single section for GNU_LTO with subsections. Unfortunately I can't find any documentation for using subsections in mach-o which may imply we will be forced to use an elf container to obtain those, no? Jack > > Jack