public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc-4.7.0 error "ar: Cannot find plugin"
@ 2012-04-25 15:17 Maxim Yegorushkin
  2012-04-25 23:12 ` Ian Lance Taylor
  0 siblings, 1 reply; 7+ messages in thread
From: Maxim Yegorushkin @ 2012-04-25 15:17 UTC (permalink / raw)
  To: gcc-help

Hi gents,

I've just configured and compiled gcc-4.7.0. I can compile, link and
run code with the new g++, however, whenever I run the new ar or nm it
responds with the following error message:

    $ /usr/local/ots/gcc/bin/ar
    /usr/local/ots/gcc/bin/ar: Cannot find plugin

My configure invocation was:

../gcc-4.7.0-src/configure --prefix=/usr/local/ots/gcc
--enable-languages=c,c++,fortran --program-suffix=47
--disable-libunwind-exceptions --with-system-zlib
--enable-__cxa_atexit --enable-checking=release --disable-multilib
--with-gmp-include=/usr/local/ots/gcc/include
--with-mpfr-include=/usr/local/ots/gcc/include
--with-mpc-include=/usr/local/ots/gcc/include
--with-ppl-include=/usr/local/ots/gcc/include
--with-cloog-ppl-include=/usr/local/ots/gcc/include
--with-gmp-lib=/usr/local/ots/gcc/lib64
--with-mpfr-lib=/usr/local/ots/gcc/lib64
--with-mpc-lib=/usr/local/ots/gcc/lib64
--with-ppl-lib=/usr/local/ots/gcc/lib64
--with-cloog-ppl-lib=/usr/local/ots/gcc/lib64

Am I doing anything wrong? Any clues how to fix the error?

Maxim

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

* Re: gcc-4.7.0 error "ar: Cannot find plugin"
  2012-04-25 15:17 gcc-4.7.0 error "ar: Cannot find plugin" Maxim Yegorushkin
@ 2012-04-25 23:12 ` Ian Lance Taylor
  2012-04-26  7:47   ` Maxim Yegorushkin
  2012-04-26  8:26   ` Maxim Yegorushkin
  0 siblings, 2 replies; 7+ messages in thread
From: Ian Lance Taylor @ 2012-04-25 23:12 UTC (permalink / raw)
  To: Maxim Yegorushkin; +Cc: gcc-help

Maxim Yegorushkin <maxim.yegorushkin@gmail.com> writes:

> I've just configured and compiled gcc-4.7.0. I can compile, link and
> run code with the new g++, however, whenever I run the new ar or nm it
> responds with the following error message:
>
>     $ /usr/local/ots/gcc/bin/ar
>     /usr/local/ots/gcc/bin/ar: Cannot find plugin

That error is coming from a wrapper for "ar" that GCC installs.  GCC
wants the wrapper to use the LTO plugin.  The wrapper is normally
installed under the name "gcc-ar".  I don't know why you are seeing the
name "ar".

Other than that, it looks like a bug that gcc-ar is unable to find the
plugin.  The code is written to assume that make_relative_prefix will
return non-NULL.  But if gcc-ar is installed in the expected location,
then I think it will return NULL.

So I think this is a bug.  I would encourage you to report it.

Ian

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

* Re: gcc-4.7.0 error "ar: Cannot find plugin"
  2012-04-25 23:12 ` Ian Lance Taylor
@ 2012-04-26  7:47   ` Maxim Yegorushkin
  2012-04-26 14:56     ` Ian Lance Taylor
  2012-04-26  8:26   ` Maxim Yegorushkin
  1 sibling, 1 reply; 7+ messages in thread
From: Maxim Yegorushkin @ 2012-04-26  7:47 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

On 26 April 2012 00:12, Ian Lance Taylor <iant@google.com> wrote:
> Maxim Yegorushkin <maxim.yegorushkin@gmail.com> writes:
>
>> I've just configured and compiled gcc-4.7.0. I can compile, link and
>> run code with the new g++, however, whenever I run the new ar or nm it
>> responds with the following error message:
>>
>>     $ /usr/local/ots/gcc/bin/ar
>>     /usr/local/ots/gcc/bin/ar: Cannot find plugin
>
> That error is coming from a wrapper for "ar" that GCC installs.  GCC
> wants the wrapper to use the LTO plugin.  The wrapper is normally
> installed under the name "gcc-ar".  I don't know why you are seeing the
> name "ar".

My bad, I made ar a hard link to gcc-ar47. Invoking it as
/usr/local/ots/gcc/bin/gcc-ar47 produces the same error.

> Other than that, it looks like a bug that gcc-ar is unable to find the
> plugin.  The code is written to assume that make_relative_prefix will
> return non-NULL.  But if gcc-ar is installed in the expected location,
> then I think it will return NULL.

I stepped through ar in gdb and indeed make_relative_prefix() returns NULL.

Could you let me know what command line this wrapper is trying to
build as it's not clear from the code and there is no comment. Is it
something like:

    /usr/local/ots/gcc/bin/gcc-ar47 --plugin
/usr/local/ots/gcc/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/<???>
<argv[1:]>

So that I hardcode it for now to fix the problem.

> So I think this is a bug.  I would encourage you to report it.

Will do.

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

* Re: gcc-4.7.0 error "ar: Cannot find plugin"
  2012-04-25 23:12 ` Ian Lance Taylor
  2012-04-26  7:47   ` Maxim Yegorushkin
@ 2012-04-26  8:26   ` Maxim Yegorushkin
  1 sibling, 0 replies; 7+ messages in thread
From: Maxim Yegorushkin @ 2012-04-26  8:26 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

On 26 April 2012 00:12, Ian Lance Taylor <iant@google.com> wrote:

[]

> So I think this is a bug.  I would encourage you to report it.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53126

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

* Re: gcc-4.7.0 error "ar: Cannot find plugin"
  2012-04-26  7:47   ` Maxim Yegorushkin
@ 2012-04-26 14:56     ` Ian Lance Taylor
  2012-04-26 21:29       ` Maxim Yegorushkin
  0 siblings, 1 reply; 7+ messages in thread
From: Ian Lance Taylor @ 2012-04-26 14:56 UTC (permalink / raw)
  To: Maxim Yegorushkin; +Cc: gcc-help

Maxim Yegorushkin <maxim.yegorushkin@gmail.com> writes:

> Could you let me know what command line this wrapper is trying to
> build as it's not clear from the code and there is no comment. Is it
> something like:
>
>     /usr/local/ots/gcc/bin/gcc-ar47 --plugin
> /usr/local/ots/gcc/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/<???>
> <argv[1:]>
>
> So that I hardcode it for now to fix the problem.

Yes, something like that.  The <???> is liblto_plugin.so.

Ian

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

* Re: gcc-4.7.0 error "ar: Cannot find plugin"
  2012-04-26 14:56     ` Ian Lance Taylor
@ 2012-04-26 21:29       ` Maxim Yegorushkin
  2012-04-27  5:22         ` Ian Lance Taylor
  0 siblings, 1 reply; 7+ messages in thread
From: Maxim Yegorushkin @ 2012-04-26 21:29 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

On 26 April 2012 15:56, Ian Lance Taylor <iant@google.com> wrote:
> Maxim Yegorushkin <maxim.yegorushkin@gmail.com> writes:
>
>> Could you let me know what command line this wrapper is trying to
>> build as it's not clear from the code and there is no comment. Is it
>> something like:
>>
>>     /usr/local/ots/gcc/bin/gcc-ar47 --plugin
>> /usr/local/ots/gcc/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/<???>
>> <argv[1:]>
>>
>> So that I hardcode it for now to fix the problem.
>
> Yes, something like that.  The <???> is liblto_plugin.so.

As a temporary fix my build script creates ar, nm and ranlib as the
following bash script:

    #!/bin/bash

    exe=$0
    exe=${exe##*/} # basename
    cmd="$1"
    shift

    exec PREFIX/x86_64-unknown-linux-gnu/bin/$exe "$cmd" --plugin
PREFIX/libexec/gcc/x86_64-unknown-linux-gnu/GCC_VERSION/liblto_plugin.so
"$@"

(where PREFIX and GCC_VERSION get replaced with the corresponding
values using `sed`)

I'd like to know whether such an approach can cause any issues please?

Maxim

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

* Re: gcc-4.7.0 error "ar: Cannot find plugin"
  2012-04-26 21:29       ` Maxim Yegorushkin
@ 2012-04-27  5:22         ` Ian Lance Taylor
  0 siblings, 0 replies; 7+ messages in thread
From: Ian Lance Taylor @ 2012-04-27  5:22 UTC (permalink / raw)
  To: Maxim Yegorushkin; +Cc: gcc-help

Maxim Yegorushkin <maxim.yegorushkin@gmail.com> writes:

> As a temporary fix my build script creates ar, nm and ranlib as the
> following bash script:
>
>     #!/bin/bash
>
>     exe=$0
>     exe=${exe##*/} # basename
>     cmd="$1"
>     shift
>
>     exec PREFIX/x86_64-unknown-linux-gnu/bin/$exe "$cmd" --plugin
> PREFIX/libexec/gcc/x86_64-unknown-linux-gnu/GCC_VERSION/liblto_plugin.so
> "$@"
>
> (where PREFIX and GCC_VERSION get replaced with the corresponding
> values using `sed`)
>
> I'd like to know whether such an approach can cause any issues please?

Should be fine.

Ian

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

end of thread, other threads:[~2012-04-27  5:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-25 15:17 gcc-4.7.0 error "ar: Cannot find plugin" Maxim Yegorushkin
2012-04-25 23:12 ` Ian Lance Taylor
2012-04-26  7:47   ` Maxim Yegorushkin
2012-04-26 14:56     ` Ian Lance Taylor
2012-04-26 21:29       ` Maxim Yegorushkin
2012-04-27  5:22         ` Ian Lance Taylor
2012-04-26  8:26   ` Maxim Yegorushkin

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).