From c7370b83758695690f4b4f1874b26130ae234d26 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 28 Apr 2006 13:15:36 +0100 Subject: [PATCH] gcc.c (process_command): Add program name to GCC_EXEC_PREFIX value before passing to make_relative_prefix. * gcc.c (process_command): Add program name to GCC_EXEC_PREFIX value before passing to make_relative_prefix. From-SVN: r113345 --- gcc/ChangeLog | 5 +++++ gcc/gcc.c | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9bf62794e8a..6d7d201c431 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2006-04-28 Joseph S. Myers + + * gcc.c (process_command): Add program name to GCC_EXEC_PREFIX + value before passing to make_relative_prefix. + 2006-04-28 Alan Modra PR middle-end/27260 diff --git a/gcc/gcc.c b/gcc/gcc.c index f23b5f3e97c..4b628ef4384 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -3376,9 +3376,17 @@ process_command (int argc, const char **argv) putenv (concat ("GCC_EXEC_PREFIX=", gcc_exec_prefix, NULL)); } else - gcc_libexec_prefix = make_relative_prefix (gcc_exec_prefix, - standard_exec_prefix, - standard_libexec_prefix); + { + /* 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 = make_relative_prefix (tmp_prefix, + standard_exec_prefix, + standard_libexec_prefix); + free (tmp_prefix); + } #else #endif