summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-03 11:09:07 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-03 11:09:07 +0000
commit2bccd0d36750a015c00278e6a0ec30f3cba96c9a (patch)
tree073ac43455c93eb5fe0d4c3b350184290ca2d668
parent8aeee4eb9936e6711c02daed6a6449fd442510ea (diff)
downloadgcc-2bccd0d36750a015c00278e6a0ec30f3cba96c9a.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187090 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/gcc-ar.c13
2 files changed, 17 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 75df2531e02..f857a8e94cc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2012-05-03 Jakub Jelinek <jakub@redhat.com>
+ 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.
+
PR debug/53174
* tree-predcom.c (remove_stmt): Call reset_debug_uses on stmts being
removed.
diff --git a/gcc/gcc-ar.c b/gcc/gcc-ar.c
index 706b2f389e5..d832b08c69a 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,