WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

gcc-4.7.0 error "ar: Cannot find plugin"

View: New views
7 Messages — Rating Filter:   Alert me  

gcc-4.7.0 error "ar: Cannot find plugin"

by Bugzilla from maxim.yegorushkin@gmail.com :: Rate this Message:

| View Threaded | Show Only this Message

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

Re: gcc-4.7.0 error "ar: Cannot find plugin"

by Ian Lance Taylor-3 :: Rate this Message:

| View Threaded | Show Only this Message

Maxim Yegorushkin <maxim.yegorushkin@...> 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

Re: gcc-4.7.0 error "ar: Cannot find plugin"

by Bugzilla from maxim.yegorushkin@gmail.com :: Rate this Message:

| View Threaded | Show Only this Message

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

> Maxim Yegorushkin <maxim.yegorushkin@...> 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.

Re: gcc-4.7.0 error "ar: Cannot find plugin"

by Bugzilla from maxim.yegorushkin@gmail.com :: Rate this Message:

| View Threaded | Show Only this Message

On 26 April 2012 00:12, Ian Lance Taylor <iant@...> 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

Re: gcc-4.7.0 error "ar: Cannot find plugin"

by Ian Lance Taylor-3 :: Rate this Message:

| View Threaded | Show Only this Message

Maxim Yegorushkin <maxim.yegorushkin@...> 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

Re: gcc-4.7.0 error "ar: Cannot find plugin"

by Bugzilla from maxim.yegorushkin@gmail.com :: Rate this Message:

| View Threaded | Show Only this Message

On 26 April 2012 15:56, Ian Lance Taylor <iant@...> wrote:

> Maxim Yegorushkin <maxim.yegorushkin@...> 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

Re: gcc-4.7.0 error "ar: Cannot find plugin"

by Ian Lance Taylor-3 :: Rate this Message:

| View Threaded | Show Only this Message

Maxim Yegorushkin <maxim.yegorushkin@...> 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