Bug 11561 - PCH driver incorrectly adding TARGET_EXECUTABLE_SUFFIX when -o specified
Summary: PCH driver incorrectly adding TARGET_EXECUTABLE_SUFFIX when -o specified
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: driver (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-17 14:10 UTC by Kelley Cook
Modified: 2008-11-28 07:45 UTC (History)
2 users (show)

See Also:
Host: i686-pc-cygwin
Target: i686-pc-cygwin
Build: i686-pc-cygwin
Known to work:
Known to fail:
Last reconfirmed: 2005-12-31 20:30:11


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kelley Cook 2003-07-17 14:10:56 UTC
When TARGET_EXECUTABLE_SUFFIX is specified (ex: Cygwin) and you attempt to
precompile a .h file by overriding the default command line to a file with no
suffix, gcc.exe will happily, albeit incorrectly, appends
TARGET_EXECUTABLE_SUFFIX to the name.

In my opinion, it should either leave it blank or append a .gch.

In addition regardless of TARGET_EXECUTABLE_SUFFIX, it always puts a space
between --output-pch= and the filename when -o is specified.

$ t/gcc/xgcc -v -B t/gcc rate.h -o rate
                                       ^^^ note no suffix specified
Reading specs from t/gcc/specs
Configured with: ../gcc-snapshot/configure --enable-sjlj-exceptions
--disable-checking --disable-libstdcxx-pch
Thread model: single
gcc version 3.4 20030716 (experimental)
 t/gcc/cc1.exe -quiet -v -iprefix
/home/kcook34/t/gcc/../lib/gcc-lib/i686-pc-cygwin/3.4/ -isystem t/gcc/include
-D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D
__unix -idirafter /usr/lib/../include/w32api -idirafter
/usr/local/lib/../../include/w32api rate.h -quiet -dumpbase rate.h
-mtune=pentiumpro -auxbase rate -version -o /tmp/ccdFvehU.s --output-pch= rate.exe
                                                                            
^^^^ note the appended ".exe" s/b nothing or ".gch"
ignoring nonexistent directory
"/home/kcook34/t/lib/gcc-lib/i686-pc-cygwin/3.4/include"
ignoring nonexistent directory
"/home/kcook34/t/lib/gcc-lib/i686-pc-cygwin/3.4/../../../../i686-pc-cygwin/include"
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/lib/gcc-lib/i686-pc-cygwin/3.4/include"
ignoring nonexistent directory "/usr/local/i686-pc-cygwin/include"
ignoring duplicate directory "/usr/include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 t/gcc/include
 /usr/local/include
 /usr/include
 /usr/include/w32api
End of search list.
GNU C version 3.4 20030716 (experimental) (i686-pc-cygwin)
        compiled by GNU C version 3.4 20030716 (experimental).
GGC heuristics: --param ggc-min-expand=31 --param ggc-min-heapsize=4096
Comment 1 Andrew Pinski 2003-07-20 13:02:20 UTC
I can confirm this in the mainline sources (20030720).  The problem is in gcc.c where it 
processes the -o option and adding TARGET_EXECUTABLE_SUFFIX if it is defined.
Comment 2 Andrew Pinski 2004-01-10 23:27:19 UTC
not a regression and it looks like no one is fixing this at all.