This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[BUG] gcc 2.95.2 strips trailing slash from GCC_EXEC_PREFIX


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

gcc-output


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]