[BUG] gcc 2.95.2 strips trailing slash from GCC_EXEC_PREFIX

J. David Bryan jdbryan@acm.org
Fri Mar 17 01:32:00 GMT 2000


This report is filed against GCC 2.95.2, compiled for i386-mingw32msvc and 
running on Windows NT 4.0 SP6 (Intel x86).  

GCC strips a trailing directory separator from the GCC_EXEC_PREFIX string.  
For example, if GCC_EXEC_PREFIX is set to "F:\aaa\bbb\", the actual prefix 
used will be "F:\aaa\bbb" (no trailing slash).

Example:

  set GCC_EXEC_PREFIX=F:\aaa\bbb\
  gcc -print-search-dirs
  install: /gcc-2.95.2/lib/gcc-lib/i386-mingw32msvc\2.95.2\
  programs: F:\aaa\bbbi386-mingw32msvc\2.95.2\;F:\aaa\bbb; ...
  libraries: F:\aaa\bbbi386-mingw32msvc\2.95.2\;F:\aaa\bbb; ...

(Example output truncated for clarity; full output attached.)

Note the merging of the prefix in the first entry in each of the "programs" 
and "libraries" paths.  It is therefore impossible to specify a directory 
as the prefix.  In fact, setting GCC_EXEC_PREFIX to either "F:\aaa\bbb" or 
"F:\aaa\bbb\" produces exactly the same result.

This behavior is contrary to the GCC manual, "Environment Variables 
Affecting GCC" subsection:

  "If GCC_EXEC_PREFIX is set, it specifies a prefix to use in the names of
   the subprograms executed by the compiler.  No slash is added when this
   prefix is combined with the name of a subprogram, but you can specify a
   prefix that ends with a slash if you wish."

The trouble appears to be in lines 282-288 of gcc/prefix.c.

If I may clarify any aspect of this report, please do not hesitate to 
contact me.

                                      -- Dave Bryan
-------------- next part --------------
install: /gcc-2.95.2/lib/gcc-lib/i386-mingw32msvc\2.95.2\
programs: F:\aaa\bbbi386-mingw32msvc\2.95.2\;F:\aaa\bbb;\gcc-2.95.2\lib\gcc-lib\i386-mingw32msvc\2.95.2\;\gcc-2.95.2\lib\gcc-lib\i386-mingw32msvc\;\usr\lib\gcc\i386-mingw32msvc\2.95.2\;\usr\lib\gcc\i386-mingw32msvc\;F:\aaa\bbb\i386-mingw32msvc\2.95.2\..\..\..\..\i386-mingw32msvc\bin\i386-mingw32msvc\2.95.2\;F:\aaa\bbb\i386-mingw32msvc\2.95.2\..\..\..\..\i386-mingw32msvc\bin\;\gcc-2.95.2\lib\gcc-lib\i386-mingw32msvc\2.95.2\..\..\..\..\i386-mingw32msvc\bin\i386-mingw32msvc\2.95.2\;\gcc-2.95.2\lib\gcc-lib\i386-mingw32msvc\2.95.2\..\..\..\..\i386-mingw32msvc\bin\
libraries: F:\aaa\bbbi386-mingw32msvc\2.95.2\;F:\aaa\bbb;\gcc-2.95.2\lib\gcc-lib\i386-mingw32msvc\2.95.2\;\usr\lib\gcc\i386-mingw32msvc\2.95.2\;F:\aaa\bbb\i386-mingw32msvc\2.95.2\..\..\..\..\i386-mingw32msvc\lib\i386-mingw32msvc\2.95.2\;F:\aaa\bbb\i386-mingw32msvc\2.95.2\..\..\..\..\i386-mingw32msvc\lib\;\gcc-2.95.2\lib\gcc-lib\i386-mingw32msvc\2.95.2\..\..\..\..\i386-mingw32msvc\lib\i386-mingw32msvc\2.95.2\;\gcc-2.95.2\lib\gcc-lib\i386-mingw32msvc\2.95.2\..\..\..\..\i386-mingw32msvc\lib\;F:\aaa\bbb\i386-mingw32msvc\2.95.2\..\..\..\i386-mingw32msvc\2.95.2\;F:\aaa\bbb\i386-mingw32msvc\2.95.2\..\..\..\;\gcc-2.95.2\lib\gcc-lib\i386-mingw32msvc\2.95.2\..\..\..\i386-mingw32msvc\2.95.2\;\gcc-2.95.2\lib\gcc-lib\i386-mingw32msvc\2.95.2\..\..\..\;\lib\i386-mingw32msvc\2.95.2\;\lib\;\usr\lib\i386-mingw32msvc\2.95.2\;\usr\lib\


More information about the Gcc-bugs mailing list