summaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-28 12:15:36 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-28 12:15:36 +0000
commit01b264393abd6fac2f4ee4cf462c4e1de7e8c9c4 (patch)
tree2435331c718e3492f9de38305794f938289d1a5d /gcc/gcc.c
parent1007f5543cce88883fc79981076bd592891992e8 (diff)
downloadlinaro-gcc-01b264393abd6fac2f4ee4cf462c4e1de7e8c9c4.tar.gz
linaro-gcc-01b264393abd6fac2f4ee4cf462c4e1de7e8c9c4.tar.bz2
linaro-gcc-01b264393abd6fac2f4ee4cf462c4e1de7e8c9c4.zip
* gcc.c (process_command): Add program name to GCC_EXEC_PREFIX
value before passing to make_relative_prefix. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113345 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c14
1 files changed, 11 insertions, 3 deletions
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