Re: PATCH: 2 stage BFD linker for LTO plugin

2011-01-24 Thread Ian Lance Taylor
Ian Lance Taylor i...@google.com writes: 2011-01-18 Ian Lance Taylor i...@google.com * plugin.cc (class Plugin_rescan): Define new class. (Plugin_manager::claim_file): Set any_claimed_. (Plugin_manager::save_archive): New function.

Re: PATCH: 2 stage BFD linker for LTO plugin

2011-01-19 Thread Richard Guenther
On Wed, Jan 19, 2011 at 1:27 AM, Ian Lance Taylor i...@google.com wrote: After some discussion on IRC, here is another approach to resolving the issue with static linking and LTO. In this approach, the linker keeps track of all archives found after the first file claimed by the plugin.  If

Re: PATCH: 2 stage BFD linker for LTO plugin

2011-01-19 Thread Ian Lance Taylor
Richard Guenther richard.guent...@gmail.com writes: Nice. Can we on the GCC side somehow identify Gold versions that support this and avoid -pass-through handling in that case? Sure. The LDPT_GOLD_VERSION tag, which lto-plugin currently ignores, will return the version of gold. I can bump

Re: PATCH: 2 stage BFD linker for LTO plugin

2011-01-19 Thread Jan Hubicka
On Wed, Jan 19, 2011 at 1:27 AM, Ian Lance Taylor i...@google.com wrote: After some discussion on IRC, here is another approach to resolving the issue with static linking and LTO. In this approach, the linker keeps track of all archives found after the first file claimed by the plugin.  

Re: PATCH: 2 stage BFD linker for LTO plugin

2011-01-19 Thread Cary Coutant
I'm not sure if with your patch the add_input_library or add_input_file plugin hooks are completely useless (and thus gold could simply ignore those at all). The plugin does need to use the add_input_file callback.  In any case I'm not sure it's a great idea for gold to ignore a hook, there

Re: PATCH: 2 stage BFD linker for LTO plugin

2011-01-18 Thread Ian Lance Taylor
After some discussion on IRC, here is another approach to resolving the issue with static linking and LTO. In this approach, the linker keeps track of all archives found after the first file claimed by the plugin. If the plugin adds any object files, and the object files refer to any symbols

Re: PATCH: 2 stage BFD linker for LTO plugin

2011-01-18 Thread H.J. Lu
On Tue, Jan 18, 2011 at 4:27 PM, Ian Lance Taylor i...@google.com wrote: After some discussion on IRC, here is another approach to resolving the issue with static linking and LTO. In this approach, the linker keeps track of all archives found after the first file claimed by the plugin.  If

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-13 Thread Ian Lance Taylor
Alan Modra amo...@gmail.com writes: On Mon, Dec 06, 2010 at 09:57:14AM -0800, H.J. Lu wrote: Personally, I think 2 stage linking is one way to fix this issue. Ian has stated that he thinks this is a really bad idea. I haven't approved the patch because I value Ian's opinion, and can see why

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-13 Thread Cary Coutant
Here is an alternative proposal, with a patch for gold. We add a new plugin vector: LDPT_REGISTER_RESCAN_ARCHIVE_HOOK.  Like LDPT_REGISTER_CLAIM_FILE_HOOK, this gives the plugin the address of a function which can register a plugin function: rescan_archive. typedef enum ld_plugin_status

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-07 Thread Tristan Gingold
On Dec 6, 2010, at 6:23 PM, Dave Korn wrote: Tristan, sorry, you must be sick of hearing from me by now, No, not really :-) but I notice the branch was still labile a couple of hours ago... it would be really good if we could get HJ's patch approved and backported before you spin the

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-07 Thread Dave Korn
On 07/12/2010 08:33, Tristan Gingold wrote: On Dec 6, 2010, at 6:23 PM, Dave Korn wrote: Tristan, sorry, you must be sick of hearing from me by now, No, not really :-) but I notice the branch was still labile a couple of hours ago... it would be really good if we could get HJ's patch

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-07 Thread H.J. Lu
On Mon, Dec 6, 2010 at 9:20 AM, H.J. Lu hjl.to...@gmail.com wrote: On Mon, Dec 6, 2010 at 9:23 AM, Dave Korn dave.korn.cyg...@gmail.com wrote: On 06/12/2010 02:20, H.J. Lu wrote: BTW, the new linker passed bootstrap-lto with all default languages. I am planning to include this patch in the

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-07 Thread H.J. Lu
On Tue, Dec 7, 2010 at 12:12 PM, H.J. Lu hjl.to...@gmail.com wrote: On Mon, Dec 6, 2010 at 9:20 AM, H.J. Lu hjl.to...@gmail.com wrote: On Mon, Dec 6, 2010 at 9:23 AM, Dave Korn dave.korn.cyg...@gmail.com wrote: On 06/12/2010 02:20, H.J. Lu wrote: BTW, the new linker passed bootstrap-lto with

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread Dave Korn
On 06/12/2010 02:20, H.J. Lu wrote: BTW, the new linker passed bootstrap-lto with all default languages. I am planning to include this patch in the next Linux binutils. I missed the IR object in an archive: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690#c34 This updated patch fixed it.

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread H.J. Lu
On Mon, Dec 6, 2010 at 9:23 AM, Dave Korn dave.korn.cyg...@gmail.com wrote: On 06/12/2010 02:20, H.J. Lu wrote: BTW, the new linker passed bootstrap-lto with all default languages. I am planning to include this patch in the next Linux binutils. I missed the IR object in an archive:

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread H.J. Lu
On Mon, Dec 6, 2010 at 9:23 AM, Dave Korn dave.korn.cyg...@gmail.com wrote:  Well, I reckon this patch is great (but don't have the approval rights). It's passed an lto-bootstrap of gcc on i686-pc-cygwin and the tests are well underway without anything abnormal showing up. Can we close

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread Dave Korn
On 06/12/2010 17:44, H.J. Lu wrote: On Mon, Dec 6, 2010 at 9:23 AM, Dave Korn dave.korn.cyg...@gmail.com wrote: Well, I reckon this patch is great (but don't have the approval rights). It's passed an lto-bootstrap of gcc on i686-pc-cygwin and the tests are well underway without anything

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread H.J. Lu
On Mon, Dec 6, 2010 at 10:19 AM, Dave Korn dave.korn.cyg...@gmail.com wrote: On 06/12/2010 17:44, H.J. Lu wrote: On Mon, Dec 6, 2010 at 9:23 AM, Dave Korn dave.korn.cyg...@gmail.com wrote:  Well, I reckon this patch is great (but don't have the approval rights). It's passed an lto-bootstrap of

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread Alan Modra
On Mon, Dec 06, 2010 at 09:57:14AM -0800, H.J. Lu wrote: Personally, I think 2 stage linking is one way to fix this issue. Ian has stated that he thinks this is a really bad idea. I haven't approved the patch because I value Ian's opinion, and can see why he thinks it is the wrong way to go.

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread H.J. Lu
On Mon, Dec 6, 2010 at 3:29 PM, Alan Modra amo...@gmail.com wrote: On Mon, Dec 06, 2010 at 09:57:14AM -0800, H.J. Lu wrote: Personally, I think 2 stage linking is one way to fix this issue. Ian has stated that he thinks this is a really bad idea.  I haven't approved the patch because I value

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread Ian Lance Taylor
Alan Modra amo...@gmail.com writes: On Mon, Dec 06, 2010 at 09:57:14AM -0800, H.J. Lu wrote: Personally, I think 2 stage linking is one way to fix this issue. Ian has stated that he thinks this is a really bad idea. I haven't approved the patch because I value Ian's opinion, and can see why

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread Ian Lance Taylor
H.J. Lu hjl.to...@gmail.com writes: I don't have such programs at hand. Will timings from gccgo, which is written in C++, help? gccgo by itself is not really a large C++ program. It's only about 50,000 lines of C++. Building gcc with --enable-build-with-cxx would get you a large C++ program,

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread H.J. Lu
On Mon, Dec 6, 2010 at 3:54 PM, Ian Lance Taylor i...@google.com wrote: Alan Modra amo...@gmail.com writes: On Mon, Dec 06, 2010 at 09:57:14AM -0800, H.J. Lu wrote: Personally, I think 2 stage linking is one way to fix this issue. Ian has stated that he thinks this is a really bad idea.  I

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread H.J. Lu
On Mon, Dec 6, 2010 at 3:55 PM, Ian Lance Taylor i...@google.com wrote: H.J. Lu hjl.to...@gmail.com writes: I don't have such programs at hand. Will timings from gccgo, which is written in C++, help? gccgo by itself is not really a large C++ program.  It's only about 50,000 lines of C++.

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread Ian Lance Taylor
H.J. Lu hjl.to...@gmail.com writes: On Mon, Dec 6, 2010 at 3:54 PM, Ian Lance Taylor i...@google.com wrote: Alan Modra amo...@gmail.com writes: On Mon, Dec 06, 2010 at 09:57:14AM -0800, H.J. Lu wrote: Personally, I think 2 stage linking is one way to fix this issue. Ian has stated that he

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread H.J. Lu
On Mon, Dec 6, 2010 at 4:08 PM, Ian Lance Taylor i...@google.com wrote: H.J. Lu hjl.to...@gmail.com writes: On Mon, Dec 6, 2010 at 3:54 PM, Ian Lance Taylor i...@google.com wrote: Alan Modra amo...@gmail.com writes: On Mon, Dec 06, 2010 at 09:57:14AM -0800, H.J. Lu wrote: Personally, I

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread H.J. Lu
On Mon, Dec 6, 2010 at 5:02 PM, H.J. Lu hjl.to...@gmail.com wrote: On Mon, Dec 6, 2010 at 4:08 PM, Ian Lance Taylor i...@google.com wrote: H.J. Lu hjl.to...@gmail.com writes: On Mon, Dec 6, 2010 at 3:54 PM, Ian Lance Taylor i...@google.com wrote: Alan Modra amo...@gmail.com writes: On Mon,

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread Cary Coutant
I see no particular reason why that should be the case.  The issues are conceptually simple. I'd like to a gold implementation which works on all known cases. You'd like to what? BTW, gold LTO plugin miscompiled 416.gamess in SPEC CPU 2006:

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-06 Thread H.J. Lu
On Mon, Dec 6, 2010 at 5:19 PM, Cary Coutant ccout...@google.com wrote: I see no particular reason why that should be the case.  The issues are conceptually simple. I'd like to a gold implementation which works on all known cases. You'd like to what? I'd like to see gold implementation

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-05 Thread H.J. Lu
corner cases. In the meantime, you can clone my git tree and do a git diff. Hi, This patch implements 2 stage BFD linker for LTO plugin. It works with current LTO API on all cases I tested. Known issue:  --whole-archive will call plugin on archives with IR in stage 2 linking. But ld never

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-05 Thread H.J. Lu
a complete diff? I will submit a complete diff after I fix a few corner cases. In the meantime, you can clone my git tree and do a git diff. Hi, This patch implements 2 stage BFD linker for LTO plugin. It works with current LTO API on all cases I tested. Known issue:  --whole-archive

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-05 Thread H.J. Lu
to work, including gcc -static ... -lm.  Any chance you could send a complete diff? I will submit a complete diff after I fix a few corner cases. In the meantime, you can clone my git tree and do a git diff. Hi, This patch implements 2 stage BFD linker for LTO plugin. It works with current

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-04 Thread H.J. Lu
linking. Everything seems to work, including gcc -static ... -lm.  Any chance you could send a complete diff? I will submit a complete diff after I fix a few corner cases. In the meantime, you can clone my git tree and do a git diff. Hi, This patch implements 2 stage BFD linker for LTO

Re: PATCH: 2 stage BFD linker for LTO plugin

2010-12-04 Thread H.J. Lu
diff. Hi, This patch implements 2 stage BFD linker for LTO plugin. It works with current LTO API on all cases I tested. Known issue:  --whole-archive will call plugin on archives with IR in stage 2 linking. But ld never calls plugin to get back object files. I will try to avoid

PATCH: 2 stage BFD linker for LTO plugin

2010-12-03 Thread H.J. Lu
chance you could send a complete diff? I will submit a complete diff after I fix a few corner cases. In the meantime, you can clone my git tree and do a git diff. Hi, This patch implements 2 stage BFD linker for LTO plugin. It works with current LTO API on all cases I tested. Known issue