public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RFC: Add --plugin-gcc option to ar/nm
@ 2011-10-16 10:32 H.J. Lu
  2011-10-16 14:30 ` Andi Kleen
  2011-10-18  5:12 ` Dave Korn
  0 siblings, 2 replies; 3+ messages in thread
From: H.J. Lu @ 2011-10-16 10:32 UTC (permalink / raw)
  To: GCC Development, Binutils

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?

-- 
H.J.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RFC: Add --plugin-gcc option to ar/nm
  2011-10-16 10:32 RFC: Add --plugin-gcc option to ar/nm H.J. Lu
@ 2011-10-16 14:30 ` Andi Kleen
  2011-10-18  5:12 ` Dave Korn
  1 sibling, 0 replies; 3+ messages in thread
From: Andi Kleen @ 2011-10-16 14:30 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GCC Development, Binutils

"H.J. Lu" <hjl.tools@gmail.com> writes:

> 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?

I had some old patches for gcc-ar, gcc-nm etc. That's similar how 
other compilers do it.

http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02471.html

With that it doesn't matter how long the option is.

The original feedback was that shell wrapper were not portable enough.
I actually did C based wrappers recently, but haven't submitted them
yet.

I think wrappers are preferable over shorter options because they
are easier to use and easier to fit into existing makefiles.

The best long term direction probably would be to put a reference
to the plugin into the object files and let BFD find it itself. This
would be most compatible with existing Makefiles. But that would need
more work.

-andi

-- 
ak@linux.intel.com -- Speaking for myself only

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RFC: Add --plugin-gcc option to ar/nm
  2011-10-16 10:32 RFC: Add --plugin-gcc option to ar/nm H.J. Lu
  2011-10-16 14:30 ` Andi Kleen
@ 2011-10-18  5:12 ` Dave Korn
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Korn @ 2011-10-18  5:12 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GCC Development, Binutils

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.

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-18  4:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-16 10:32 RFC: Add --plugin-gcc option to ar/nm H.J. Lu
2011-10-16 14:30 ` Andi Kleen
2011-10-18  5:12 ` Dave Korn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).