public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: danny_r_smith_2001@yahoo.co.nz
To: gcc-gnats@gcc.gnu.org
Subject: other/5620: [3.1] GCC -save-temps foo.c fails to build foo.o
Date: Wed, 06 Feb 2002 18:06:00 -0000	[thread overview]
Message-ID: <20020207020320.12409.qmail@sources.redhat.com> (raw)


>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,
<snip>
 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	<ira@apple.com>

	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:


             reply	other threads:[~2002-02-07  2:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-06 18:06 danny_r_smith_2001 [this message]
2002-05-11 10:17 rodrigc
2002-06-09 12:56 hp
2002-12-10 17:01 bangerth
2002-12-10 17:16 Danny Smith
2002-12-10 17:16 Wolfgang Bangerth
2003-05-13  1:16 Dara Hazeghi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020207020320.12409.qmail@sources.redhat.com \
    --to=danny_r_smith_2001@yahoo.co.nz \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).