GCC_EXEC_PREFIX doesn't work

Bryan Henderson bryanh@giraffe-data.com
Tue Mar 28 12:37:00 GMT 2000


Gcc cannot find my specs file when I identify its location with the 
GCC_EXEC_PREFIX environment variable:

$GCC_EXEC_PREFIX=/tmp/ gcc --verbose
Using builtin specs.
gcc version 2.95.2 19991024 (release)

A trace shows that it's because gcc is removing the trailing slash.
It does that in the function translate_name() in prefix.c under the
comment "/* Remove any trailing directory separator from what we got.
*/".  I haven't a clue as to why this would ever be the right thing to
do.

I can circumvent the bug by using two trailing slashes:

$GCC_EXEC_PREFIX=/tmp// gcc --verbose
Reading specs from /tmp/i686-pc-linux-gnulibc1/2.95.2/specs
gcc version 2.95.2 19991024 (release)

The system is as described by gcc above.  The shell is Bash.


By the way, as I read through the code analyzing this, I discovered a
lot of sophisticated path editing that contradicts the simple
explanation of GCC_EXEC_PREFIX in the info file (The "Environment
Variables" node).  Shouldn't the full function be documented?

-- 
Bryan Henderson                                    Phone 415-505-3367
Olympia, Washington


More information about the Gcc-bugs mailing list