This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Handle AR_NM_RANLIB_DEFAULT_PLUGIN environment variable
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Markus Trippelsdorf <markus at trippelsdorf dot de>
- Cc: binutils at sourceware dot org
- Date: Thu, 4 Oct 2012 09:53:51 -0700
- Subject: Re: [PATCH] Handle AR_NM_RANLIB_DEFAULT_PLUGIN environment variable
- References: <20120919102302.GA12179@x4>
On Wed, Sep 19, 2012 at 3:23 AM, Markus Trippelsdorf
<markus@trippelsdorf.de> wrote:
> This patch introduces a new environment variable:
> AR_NM_RANLIB_DEFAULT_PLUGIN
>
> It allows one to easily switch from one LTO plugin to another without
> the need to use wrappers (scripts, gcc-ar, etc.).
>
> (For example if one wants to build a project with clang using link time
> optimizations one simply points it to /usr/local/lib/LLVMgold.so.
> If one wants to use gcc with slim LTO on simply points it to e.g.:
> /usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.0/liblto_plugin.so)
>
> An explicit "--plugin" command line switch overrides the environment
> variable (so that existing wrappers keep functioning).
>
> If this looks acceptable it would be nice if someone could commit this,
> because I don't have access.
> Thanks.
>
> 2012-09-19 Markus Trippelsdorf <markus@trippelsdorf.de>
>
> binutils/
> * ar.c (decode_options): Handle AR_NM_RANLIB_DEFAULT_PLUGIN
> environment variable.
> (ranlib_main): Likewise.
> * nm.c (main): Likewise.
>
I would prefer to add automatic plugin support to binutils:
1. Figure out gcc driver name and the plugin DSO name at configure time.
2. If --plugin is used without DSO name, call
popen ($gcc-driver -print-prog-name=$DSO)
to get plugin DSO path.
--
H.J.