This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug plugins/53126] gcc-4.7.0 error "gcc-ar: Cannot find plugin"
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 02 May 2012 19:39:11 +0000
- Subject: [Bug plugins/53126] gcc-4.7.0 error "gcc-ar: Cannot find plugin"
- Auto-submitted: auto-generated
- References: <bug-53126-4@http.gcc.gnu.org/bugzilla/>
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.