aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc-ar.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-05-03 13:09:07 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2012-05-03 13:09:07 +0200
commit68d23306934e79d3a40068349d7eb8507da806c6 (patch)
tree073ac43455c93eb5fe0d4c3b350184290ca2d668 /gcc/gcc-ar.c
parentf95052cce5f939b66cc0e7c3b00f7ea8f2c3ed87 (diff)
downloadgcc-68d23306934e79d3a40068349d7eb8507da806c6.zip
gcc-68d23306934e79d3a40068349d7eb8507da806c6.tar.gz
gcc-68d23306934e79d3a40068349d7eb8507da806c6.tar.bz2
re PR plugins/53126 (gcc-4.7.0 error "gcc-ar: Cannot find plugin")
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. From-SVN: r187090
Diffstat (limited to 'gcc/gcc-ar.c')
-rw-r--r--gcc/gcc-ar.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/gcc-ar.c b/gcc/gcc-ar.c
index 706b2f3..d832b08 100644
--- a/gcc/gcc-ar.c
+++ b/gcc/gcc-ar.c
@@ -1,5 +1,5 @@
/* Wrapper for ar/ranlib/nm to pass the LTO plugin.
- Copyright (C) 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011, 2012 Free Software Foundation, Inc.
Contributed by Andi Kleen.
This file is part of GCC.
@@ -52,11 +52,16 @@ main(int ac, char **av)
/* XXX implement more magic from gcc.c? */
nprefix = getenv ("GCC_EXEC_PREFIX");
if (!nprefix)
+ nprefix = av[0];
+ else
+ nprefix = concat (nprefix, "gcc-" PERSONALITY, NULL);
+
+ nprefix = make_relative_prefix (nprefix,
+ standard_bin_prefix,
+ standard_libexec_prefix);
+ if (nprefix == NULL)
nprefix = standard_libexec_prefix;
- nprefix = make_relative_prefix (av[0],
- standard_bin_prefix,
- nprefix);
plugin = concat (nprefix,
dir_separator,
DEFAULT_TARGET_MACHINE,