This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: other/5620: [3.1] GCC -save-temps foo.c fails to build foo.o
- From: Christopher Faylor <cgf at redhat dot com>
- To: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 11 Dec 2002 20:22:09 -0500
- Subject: Re: other/5620: [3.1] GCC -save-temps foo.c fails to build foo.o
- References: <20021211114447.13902.qmail@web21414.mail.yahoo.com>
On Wed, Dec 11, 2002 at 10:44:47PM +1100, Danny Smith wrote:
>Hello
>
>Re:
>http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5620
>
>On mingw32 PR is due to the implementation of stat() by the msvcrt C lib
>used by mingw32: Inodes are meaningless on windows and the value of
>stat.st_ino set by stat() is undefined. Using stat to determine if
>files were the same was causing strange results. The driver was telling
>cc1 to generate new file foo.s from foo.c (which cc1.did), but telling
>the assembler to use <tmpdir>/<tmpnam>.s as input.
>
>This patch replaces the use of stat for determining if files are the
>same with a simple comparison of full (canonical) pathnames on mingw32
>host, and provides a mechanism for other hosts(?) with similar problem.
>
>I don't know if this (using EXTRA_GCC_OBJS and x-make fragment) is the
>best way to implement this, but is the only way I could think of
>without adding __MINGW32__ specific code to gcc.c
This all looks good but I can't approve the change to gcc.c, unfortunately.
cgf
>2002-12-11 Danny Smith <dannysmith@users.sourceforge.net>
>
> PR other/5620
> * config/i386/mingw32-1.c: New file.
> ((w32_file_id_cmp): Define.
> * config/i386/xm-mingw32.h (w32_file_id_cmp): Declare.
> (HOST_FILE_ID_CMP): Define as w32_file_id_cmp.
> Update copyright.
> * config/i386/x-mingw32: New file. Set EXTRA_GCC_OBJS
> to mingw32-1.o. Set rule for compiling mingw32-1.o.
> * config.gcc (i[34567]86-*-mingw32*): Set xmake-file to
> x-mingw32.
> Correct typo.
> * gcc.c (do_spec_1): Use (HOST_FILE_ID_CMP) rather than stat,
> if defined.