Bug 25584 - ar and ranlib should not call lto-wrapper for LTO bytecode
Summary: ar and ranlib should not call lto-wrapper for LTO bytecode
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.35
: P2 normal
Target Milestone: 2.35
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-21 11:42 UTC by Martin Liška
Modified: 2020-02-25 11:38 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2020-02-21 00:00:00


Attachments
Please try this (1.21 KB, patch)
2020-02-21 12:12 UTC, H.J. Lu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2020-02-21 11:42:00 UTC
It's a follow up of PR25355:
https://sourceware.org/bugzilla/show_bug.cgi?id=25355#c63
Comment 1 H.J. Lu 2020-02-21 12:12:34 UTC
Created attachment 12310 [details]
Please try this
Comment 2 Martin Liška 2020-02-21 12:46:45 UTC
I can confirm the patch works.
Comment 3 H.J. Lu 2020-02-21 12:59:50 UTC
(In reply to Martin Liška from comment #2)
> I can confirm the patch works.

Are you 100% sure?
Comment 4 Martin Liška 2020-02-21 13:14:06 UTC
Yes, I used the updated binutils to build a LTO project.
Comment 5 Sourceware Commits 2020-02-25 11:34:23 UTC
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ecda90163e2b0a6f0be96e3fc262c28820a27211

commit ecda90163e2b0a6f0be96e3fc262c28820a27211
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Feb 25 03:30:33 2020 -0800

    Don't call lto-wrapper for ar and ranlib
    
    Since ar and ranlib don't need to know symbol types to work properly,
    we should avoid calling lto-wrapper for them to speed them up.
    
    bfd/
    
    	PR binutils/25584
    	* plugin.c (need_lto_wrapper_p): New.
    	(bfd_plugin_set_program_name): Add an int argument to set
    	need_lto_wrapper_p.
    	(get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
    	set.
    	* plugin.h (bfd_plugin_set_program_name): Add an int argument.
    
    binutils/
    
    	PR binutils/25584
    	* ar.c (main): Pass 0 to bfd_plugin_set_program_name.
    	* nm.c (main): Pass 1 to bfd_plugin_set_program_name.
Comment 6 Sourceware Commits 2020-02-25 11:38:21 UTC
The binutils-2_34-branch branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=42b2380cdced1f828ede6fa1c7c7d1fdf0e331ca

commit 42b2380cdced1f828ede6fa1c7c7d1fdf0e331ca
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Feb 25 03:30:33 2020 -0800

    Don't call lto-wrapper for ar and ranlib
    
    Since ar and ranlib don't need to know symbol types to work properly,
    we should avoid calling lto-wrapper for them to speed them up.
    
    bfd/
    
    	PR binutils/25584
    	* plugin.c (need_lto_wrapper_p): New.
    	(bfd_plugin_set_program_name): Add an int argument to set
    	need_lto_wrapper_p.
    	(get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
    	set.
    	* plugin.h (bfd_plugin_set_program_name): Add an int argument.
    
    binutils/
    
    	PR binutils/25584
    	* ar.c (main): Pass 0 to bfd_plugin_set_program_name.
    	* nm.c (main): Pass 1 to bfd_plugin_set_program_name.
    
    (cherry picked from commit ecda90163e2b0a6f0be96e3fc262c28820a27211)
Comment 7 H.J. Lu 2020-02-25 11:38:49 UTC
Fixed for 2.35 and 2.34 branch.