public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug plugins/53126] New: gcc-4.7.0 error "gcc-ar: Cannot find plugin"
@ 2012-04-26  8:19 maxim.yegorushkin at gmail dot com
  2012-04-26  8:25 ` [Bug plugins/53126] " maxim.yegorushkin at gmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: maxim.yegorushkin at gmail dot com @ 2012-04-26  8:19 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53126
           Summary: gcc-4.7.0 error "gcc-ar: Cannot find plugin"
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: plugins
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: maxim.yegorushkin@gmail.com


I am compiling gcc-4.7.0 from sources following instructions from
http://gcc.gnu.org/install/. 

I can compile, link and run code with the newly built g++, however, whenever I
run the new ar or nm they respond with the following error message:

$ /usr/local/ots/gcc/bin/gcc-ar47 
/usr/local/ots/gcc/bin/gcc-ar47: Cannot find plugin 
$ /usr/local/ots/gcc/bin/gcc-nm47 
/usr/local/ots/gcc/bin/gcc-nm47: Cannot find plugin 

Ian Lance Taylor in http://gcc.gnu.org/ml/gcc-help/2012-04/msg00286.html
suggested that make_relative_prefix() returns NULL and that causes the problem.

My configure invocation is as follows:

../gcc-4.7.0-src/configure --prefix=/usr/local/ots/gcc --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-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-lib=/usr/local/ots/gcc/lib64 --enable-languages=c,c++,fortran,lto
--enable-plugin --enable-initfini-array


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

* [Bug plugins/53126] gcc-4.7.0 error "gcc-ar: Cannot find plugin"
  2012-04-26  8:19 [Bug plugins/53126] New: gcc-4.7.0 error "gcc-ar: Cannot find plugin" maxim.yegorushkin at gmail dot com
@ 2012-04-26  8:25 ` maxim.yegorushkin at gmail dot com
  2012-04-26  8:36 ` markus at trippelsdorf dot de
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: maxim.yegorushkin at gmail dot com @ 2012-04-26  8:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Maxim Yegorushkin <maxim.yegorushkin at gmail dot com> 2012-04-26 08:24:43 UTC ---
Created attachment 27245
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27245
The Makefile I use to download gcc and libs, build and install it.

Usage:

  make download
  make -j8

It downloads gcc, gmp, mpfr, mpc, ppl, cloog into ~/Downloads. Builds them and
installs into /usr/local/ots/gcc. /usr/local/ots/gcc must be writeable by the
invoking user.


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

* [Bug plugins/53126] gcc-4.7.0 error "gcc-ar: Cannot find plugin"
  2012-04-26  8:19 [Bug plugins/53126] New: gcc-4.7.0 error "gcc-ar: Cannot find plugin" maxim.yegorushkin at gmail dot com
  2012-04-26  8:25 ` [Bug plugins/53126] " maxim.yegorushkin at gmail dot com
@ 2012-04-26  8:36 ` markus at trippelsdorf dot de
  2012-05-02 19:40 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: markus at trippelsdorf dot de @ 2012-04-26  8:36 UTC (permalink / raw)
  To: gcc-bugs

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

Markus Trippelsdorf <markus at trippelsdorf dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andi-gcc at firstfloor dot
                   |                            |org, markus at trippelsdorf
                   |                            |dot de

--- Comment #2 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-04-26 08:36:21 UTC ---
Same thing here. I'm still using the old wrapper scripts.

 % cat =ar
#!/bin/sh
cmd=$1
shift
/usr/bin/ar $cmd --plugin
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.0/liblto_plugin.so $*

CC'ing Andy Kleen.


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

* [Bug plugins/53126] gcc-4.7.0 error "gcc-ar: Cannot find plugin"
  2012-04-26  8:19 [Bug plugins/53126] New: gcc-4.7.0 error "gcc-ar: Cannot find plugin" maxim.yegorushkin at gmail dot com
  2012-04-26  8:25 ` [Bug plugins/53126] " maxim.yegorushkin at gmail dot com
  2012-04-26  8:36 ` markus at trippelsdorf dot de
@ 2012-05-02 19:40 ` jakub at gcc dot gnu.org
  2012-05-02 20:05 ` andi-gcc at firstfloor dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-05-02 19:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-05-02 19:39:11 UTC ---
Created attachment 27290
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27290
gcc48-pr53126.patch

Ugh, what gcc-ar does isn't even remotely matching to what gcc does.

If GCC_EXEC_PREFIX isn't in the environment, then it will
      gcc_libexec_prefix = get_relative_prefix (decoded_options[0].arg,
                                             standard_bindir_prefix,
                                             standard_libexec_prefix);
and when it is there, it will:
      /* make_relative_prefix requires a program name, but
         GCC_EXEC_PREFIX is typically a directory name with a trailing
         / (which is ignored by make_relative_prefix), so append a
         program name.  */
      char *tmp_prefix = concat (gcc_exec_prefix, "gcc", NULL);
      gcc_libexec_prefix = get_relative_prefix (tmp_prefix,
                                                standard_exec_prefix,
                                                standard_libexec_prefix);

      /* The path is unrelocated, so fallback to the original setting.  */
      if (!gcc_libexec_prefix)
        gcc_libexec_prefix = standard_libexec_prefix;

Even if GCC_EXEC_PREFIX isn't in the environment, and gcc_libexec_prefix is
NULL after this, we end up doing
  /* If we don't know where the toolchain has been installed, use the
     configured-in locations.  */
  if (!gcc_exec_prefix)
    {
#ifndef OS2
      add_prefix (&exec_prefixes, standard_libexec_prefix, "GCC",
                  PREFIX_PRIORITY_LAST, 1, 0);
      add_prefix (&exec_prefixes, standard_libexec_prefix, "BINUTILS",
                  PREFIX_PRIORITY_LAST, 2, 0);
...
so I'd say what this patch does brings it at least a little bit closer to what
gcc driver does.  Having make_relative_prefix return NULL is actually the
common case where the compiler is installed where it has been configured.


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

* [Bug plugins/53126] gcc-4.7.0 error "gcc-ar: Cannot find plugin"
  2012-04-26  8:19 [Bug plugins/53126] New: gcc-4.7.0 error "gcc-ar: Cannot find plugin" maxim.yegorushkin at gmail dot com
                   ` (2 preceding siblings ...)
  2012-05-02 19:40 ` jakub at gcc dot gnu.org
@ 2012-05-02 20:05 ` andi-gcc at firstfloor dot org
  2012-05-02 20:16 ` law at redhat dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: andi-gcc at firstfloor dot org @ 2012-05-02 20:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andi Kleen <andi-gcc at firstfloor dot org> 2012-05-02 20:04:50 UTC ---
Patch looks good. Thanks Jakub.


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

* [Bug plugins/53126] gcc-4.7.0 error "gcc-ar: Cannot find plugin"
  2012-04-26  8:19 [Bug plugins/53126] New: gcc-4.7.0 error "gcc-ar: Cannot find plugin" maxim.yegorushkin at gmail dot com
                   ` (3 preceding siblings ...)
  2012-05-02 20:05 ` andi-gcc at firstfloor dot org
@ 2012-05-02 20:16 ` law at redhat dot com
  2012-05-03 10:42 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: law at redhat dot com @ 2012-05-02 20:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jeffrey A. Law <law at redhat dot com> 2012-05-02 20:15:23 UTC ---
This code should generally follow the logic from gcc.c.   We may not need to
support all the environment variables that gcc.c handles.  But for those we do
need to support, the overall structure should look like gcc.c.

Jakub's change definitely looks more correct than the current code in gcc-ar to
me.  I think we should go ahead with it and iterate if further changes are
needed.


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

* [Bug plugins/53126] gcc-4.7.0 error "gcc-ar: Cannot find plugin"
  2012-04-26  8:19 [Bug plugins/53126] New: gcc-4.7.0 error "gcc-ar: Cannot find plugin" maxim.yegorushkin at gmail dot com
                   ` (4 preceding siblings ...)
  2012-05-02 20:16 ` law at redhat dot com
@ 2012-05-03 10:42 ` rguenth at gcc dot gnu.org
  2012-05-03 11:09 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-05-03 10:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-05-03 10:40:58 UTC ---
And eventually split out the code to avoid bogus duplicates?


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

* [Bug plugins/53126] gcc-4.7.0 error "gcc-ar: Cannot find plugin"
  2012-04-26  8:19 [Bug plugins/53126] New: gcc-4.7.0 error "gcc-ar: Cannot find plugin" maxim.yegorushkin at gmail dot com
                   ` (5 preceding siblings ...)
  2012-05-03 10:42 ` rguenth at gcc dot gnu.org
@ 2012-05-03 11:09 ` jakub at gcc dot gnu.org
  2012-05-03 11:10 ` jakub at gcc dot gnu.org
  2013-06-20  8:40 ` doko at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-05-03 11:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-05-03 11:09:12 UTC ---
Author: jakub
Date: Thu May  3 11:09:07 2012
New Revision: 187090

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187090
Log:
    PR plugins/53126
    * gcc-ar.c (main): If GCC_EXEC_PREFIX is set in env,
    append program name to it and pass that as first argument
    to make_relative_prefix.  Always pass standard_libexec_prefix
    as last argument to make_relative_prefix.  If
    make_relative_prefix returns NULL, fall back to
    standard_libexec_prefix.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gcc-ar.c


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

* [Bug plugins/53126] gcc-4.7.0 error "gcc-ar: Cannot find plugin"
  2012-04-26  8:19 [Bug plugins/53126] New: gcc-4.7.0 error "gcc-ar: Cannot find plugin" maxim.yegorushkin at gmail dot com
                   ` (6 preceding siblings ...)
  2012-05-03 11:09 ` jakub at gcc dot gnu.org
@ 2012-05-03 11:10 ` jakub at gcc dot gnu.org
  2013-06-20  8:40 ` doko at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-05-03 11:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-05-03 11:09:51 UTC ---
Author: jakub
Date: Thu May  3 11:09:46 2012
New Revision: 187091

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187091
Log:
    PR plugins/53126
    * gcc-ar.c (main): If GCC_EXEC_PREFIX is set in env,
    append program name to it and pass that as first argument
    to make_relative_prefix.  Always pass standard_libexec_prefix
    as last argument to make_relative_prefix.  If
    make_relative_prefix returns NULL, fall back to
    standard_libexec_prefix.

Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/gcc-ar.c


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

* [Bug plugins/53126] gcc-4.7.0 error "gcc-ar: Cannot find plugin"
  2012-04-26  8:19 [Bug plugins/53126] New: gcc-4.7.0 error "gcc-ar: Cannot find plugin" maxim.yegorushkin at gmail dot com
                   ` (7 preceding siblings ...)
  2012-05-03 11:10 ` jakub at gcc dot gnu.org
@ 2013-06-20  8:40 ` doko at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: doko at gcc dot gnu.org @ 2013-06-20  8:40 UTC (permalink / raw)
  To: gcc-bugs

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

Matthias Klose <doko at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |doko at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #9 from Matthias Klose <doko at gcc dot gnu.org> ---
PR57651 is now fixed, which should address this issue too. please reopen the
issue, if not.


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

end of thread, other threads:[~2013-06-20  8:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-26  8:19 [Bug plugins/53126] New: gcc-4.7.0 error "gcc-ar: Cannot find plugin" maxim.yegorushkin at gmail dot com
2012-04-26  8:25 ` [Bug plugins/53126] " maxim.yegorushkin at gmail dot com
2012-04-26  8:36 ` markus at trippelsdorf dot de
2012-05-02 19:40 ` jakub at gcc dot gnu.org
2012-05-02 20:05 ` andi-gcc at firstfloor dot org
2012-05-02 20:16 ` law at redhat dot com
2012-05-03 10:42 ` rguenth at gcc dot gnu.org
2012-05-03 11:09 ` jakub at gcc dot gnu.org
2012-05-03 11:10 ` jakub at gcc dot gnu.org
2013-06-20  8:40 ` doko at gcc dot gnu.org

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