From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122507 invoked by alias); 26 Nov 2015 10:23:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 122496 invoked by uid 89); 26 Nov 2015 10:23:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 26 Nov 2015 10:23:00 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 10142AB13; Thu, 26 Nov 2015 10:21:17 +0000 (UTC) Date: Thu, 26 Nov 2015 10:33:00 -0000 From: Richard Biener To: Jan Hubicka cc: Andi Kleen , gcc-patches@gcc.gnu.org, hongjiu.lu@intel.com, ccoutant@google.com, iant@google.com Subject: Re: [RFC] Getting LTO incremental linking work In-Reply-To: <20151126003828.GH20593@kam.mff.cuni.cz> Message-ID: References: <20151125085912.GD58491@kam.mff.cuni.cz> <20151125235858.GI8438@tassilo.jf.intel.com> <20151126003828.GH20593@kam.mff.cuni.cz> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2015-11/txt/msg03200.txt.bz2 On Thu, 26 Nov 2015, Jan Hubicka wrote: > > > Moreover we do have all infrastructure ready to implement 3). Our tree merging > > > and symbol table handling is fuly incremental and I think made a patch to > > > implement it today. The scheme is easy: > > > > What happens when .S (assembler) files are part of the incremential object? > > The kernel does that. Your patch would do the final generation in this case, > > right? > > Yes, it will spit out warning (which can be silenced -Wl,-rnolto is used) and turn > the whole object into non-LTO one. > > > > In theory we could change the build system to avoid that case though, but > > it would need some changes. > > > > It would be better if that could be handled somehow. The final output of the incremental link would need to be two objects, one with the LTO IL and one with the incrementally linked non-LTO objects. The only way to make it "one" object is a static archive? Or extend ELF to behave as a "container" for multiple sub-objects... > How does this work with your patchset? Ideally we should have way to claim > only portions of object files, but we don't have that. If we claim the file, > the symbols in real symbol table are not visible. > > I suppose we could play a games here with slim LTO: claim the file, see if > there are any symbols defined in the non-LTO symbol table and if so, interpret > read the symbol table and tell linker about the symbols and at the very end > include the offending object file in the list of objects returned back to > linker. This is what I was trying with early-LTO-debug btw... the slim object also contains early debug sections which I don't "claim" and I feed the objects back to the linker (as plugin output), expecting it to drop the LTO IL and take the early debug sections... > The linker then should take the symbols it wants. There would be some fun > involved, because the resolution info we get will consider the symbols > defined in that object file to be IR which would need to be compensated for. A sensible option might be to simply error on incrementally linking slim-LTO with non-LTO objects. For fat objects we could either drop LTO or error as well. Fixing this on the user (Makefile) side would be easiest. But it has to use two incrementally linked objects in this case of course so it wouldn't be very transparent. Richard.