From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15166 invoked by alias); 7 Feb 2002 02:06:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 15102 invoked by uid 71); 7 Feb 2002 02:06:01 -0000 Resent-Date: 7 Feb 2002 02:06:01 -0000 Resent-Message-ID: <20020207020601.15101.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, danny_r_smith_2001@yahoo.co.nz Received:(qmail 12410 invoked by uid 61); 7 Feb 2002 02:03:20 -0000 Message-Id:<20020207020320.12409.qmail@sources.redhat.com> Date: Wed, 06 Feb 2002 18:06:00 -0000 From: danny_r_smith_2001@yahoo.co.nz Reply-To: danny_r_smith_2001@yahoo.co.nz To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: other/5620: [3.1] GCC -save-temps foo.c fails to build foo.o X-SW-Source: 2002-02/txt/msg00170.txt.bz2 List-Id: >Number: 5620 >Category: other >Synopsis: [3.1] GCC -save-temps foo.c fails to build foo.o >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Wed Feb 06 18:06:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Danny Smith >Release: GCC version, gcc version 3.1 20020202 (experimental) >Organization: >Environment: NT4sp6, i386-pc-mingw32 >Description: Compile foo.c (below) with "gcc -o foo -save-temps foo.c" GCC builds foo.i and foo.s but not object file foo.o. Hence, the exe fails to build. Here is the verbose output. Note that although gcc outputs foo.s it sends the tempname "D:\TEMP/ccSaaaaa.s" to as.exe: Reading specs from D:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1/specs Configured with: ../gcc/configure --with-gcc-version-trigger=/develop/gcc/gcc/gcc/version.c --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-sjlj-exceptions --enable-threads --disable-nls --enable-languages=f77,c++,objc,ada --disable-win32-registry --enable-shared --enable-objc-gc : (reconfigured) ../gcc/configure --with-gcc-version-trigger=/develop/gcc/gcc/gcc/version.c --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-sjlj-exceptions --enable-threads --disable-nls --enable-languages=f77,c++,objc,ada --disable-win32-registry --enable-shared --enable-objc-gc Thread model: win32 gcc version 3.1 20020202 (experimental) D:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1/cpp0.exe -lang-c -v -iprefix D:\MINGW\BIN/../lib/gcc-lib/mingw32/3.1/ -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -D_WIN32 -D__WIN32 -D__WIN32__ -DWINNT -DWIN32 -D__MINGW32__ -D__MSVCRT__ -D_X86_=1 -D_WIN32 -D__WIN32 -D__WIN32__ -D__WINNT__ -D__WIN32__ -D__MINGW32__ -D__MSVCRT__ -D_X86_=1 -D__WINNT -D__WIN32 -Asystem=winnt -D__NO_INLINE__ -D__STDC_HOSTED__=1 -remap -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i586__ -D__tune_pentium__ -D__stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__)) -D__fastcall=__attribute__((__fastcall__)) -D_stdcall=__attribute__((__stdcall__)) -D_cdecl=__attribute__((__cdecl__)) -D_fastcall=__attribute__((__fastcall__)) -D__declspec(x)=__attribute__((x)) foo.c foo.i GNU CPP version 3.1 20020202 (experimental) (cpplib) (80386, BSD syntax) ignoring nonexistent directory "/usr/local/mingw32/include" #include "..." search starts here: #include <...> search starts here: D:/MINGW/include D:/MINGW/lib/gcc-lib/mingw32/3.1/include D:/MINGW/mingw32/include /mingw/include /mingw/include /mingw/lib/gcc-lib/mingw32/3.1/include /mingw/mingw32/include End of search list. D:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1/cc1.exe -fpreprocessed foo.i -quiet -dumpbase foo.c -version -o foo.s GNU CPP version 3.1 20020202 (experimental) (cpplib) (80386, BSD syntax) GNU C version 3.1 20020202 (experimental) (mingw32) compiled by GNU C version 3.1 20020117 (experimental). D:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1/../../../../mingw32/bin/as.exe -o foo.o D:\TEMP/ccSaaaaa.s D:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1/../../../../mingw32/bin/ld.exe -Bdynamic -o foo.exe D:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1/../../../../mingw32/lib/crt2.o -LD:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1 -LD:/MINGW/BIN/../lib/gcc-lib -L/mingw/lib/gcc-lib/mingw32/3.1 -LD:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1/../../../../mingw32/lib -L/mingw/lib/gcc-lib/mingw32/3.1/../../../../mingw32/lib -LD:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1/../../.. -L/mingw/lib/gcc-lib/mingw32/3.1/../../.. foo.o -lmingw32 -lgcc -lmoldname -lisocext -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lisocext -lmsvcrt D:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1/../../../../mingw32/lib/libmingw32.a(main.o)(.text+0x96):main.c: undefined reference to `WinMain@16' If I repeat the same command (after foo.i and foo.s are built), it outputs a temp .s file and sends it to as.exe to make foo.o and all is fine, D:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1/cc1.exe -fpreprocessed foo.i -quiet -dumpbase foo.c -version -o D:\TEMP/cckdaaaa.s GNU CPP version 3.1 20020202 (experimental) (cpplib) (80386, BSD syntax) GNU C version 3.1 20020202 (experimental) (mingw32) compiled by GNU C version 3.1 20020117 (experimental). D:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1/../../../../mingw32/bin/as.exe -o foo.o D:\TEMP/cckdaaaa.s D:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1/../../../../mingw32/bin/ld.exe -Bdynamic -o foo.exe D:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1/../../../../mingw32/lib/crt2.o -LD:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1 -LD:/MINGW/BIN/../lib/gcc-lib -L/mingw/lib/gcc-lib/mingw32/3.1 -LD:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1/../../../../mingw32/lib -L/mingw/lib/gcc-lib/mingw32/3.1/../../../../mingw32/lib -LD:/MINGW/BIN/../lib/gcc-lib/mingw32/3.1/../../.. -L/mingw/lib/gcc-lib/mingw32/3.1/../../.. foo.o -lmingw32 -lgcc -lmoldname -lisocext -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lisocext -lmsvcrt >How-To-Repeat: Compile the following with "gcc -o foo -save-temps foo.c /* foo.c * / int main()(return 0;} >Fix: revert this change: 2001-12-14 Ira Ruben Fix to no allow -save-temps to clobber user's source file. * gcc.c: Add static globals input_stat and input_stat_set. (do_spec_1): For 'g', 'u', 'U' case with save_temps_flag set, check that user's input file is not overwritten. (set_input): Reset input_stat_set for each new file. >Release-Note: >Audit-Trail: >Unformatted: