This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Add --plugin-gcc option to ar/nm

On 15/10/2011 23:44, H.J. Lu wrote:
> Hi,
> ---plugin option for ar/nm is very long.  I am proposing to add
> a  --plugin-gcc option.  It can be implemented with
> 1. Move LTOPLUGINSONAME from gcc to config/plugins.m4.
> 2. Define LTOPLUGINSONAME for ar/nm.
> 3. For --plugin-gcc, ar/nm call popen using environment variable GCC if set,
> or gcc with -print-prog-name=$LTOPLUGINSONAM to get
> plugin name.
> Any comments?

  Given the general "environment variables are bad and to be avoided where
possible" rule we tend to follow, and the fact that it might often be more
useful to check $CC rather than $GCC, how about letting --plugin-gcc take an
optional argument, which is used in preference to both $GCC and plain "gcc"
when provided?  i.e.

3. For --plugin-gcc, ar/nm calls popen using
        - the optional argument to --plugin-gcc, if provided, or
        - environment variable GCC if set, or
        - "gcc"
as the executable to launch, and with "-print-prog-name=$LTOPLUGINSONAME" as
the sole command-line argument, to get the full path to the plugin.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]