From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14618 invoked by alias); 17 Jun 2003 00:20:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 14357 invoked from network); 17 Jun 2003 00:20:38 -0000 Received: from unknown (HELO web21403.mail.yahoo.com) (216.136.232.73) by sources.redhat.com with SMTP; 17 Jun 2003 00:20:38 -0000 Message-ID: <20030617002036.97423.qmail@web21403.mail.yahoo.com> Received: from [203.97.2.242] by web21403.mail.yahoo.com via HTTP; Tue, 17 Jun 2003 10:20:36 EST Date: Tue, 17 Jun 2003 00:36:00 -0000 From: =?iso-8859-1?q?Danny=20Smith?= Subject: Re:PR other 5620 [was Unreviewed Patches] To: Dara Hazeghi , Geoff Keating Cc: gcc-patches@gcc.gnu.org In-Reply-To: <20030616194527.98607.qmail@web41110.mail.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-11140637-1055809236=:84559" Content-Transfer-Encoding: 8bit X-SW-Source: 2003-06/txt/msg01877.txt.bz2 --0-11140637-1055809236=:84559 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Id: Content-Disposition: inline Content-length: 1252 --- Dara Hazeghi wrote: > > --- Geoff Keating wrote: > > Dara Hazeghi writes: > > > > > and this patch to fix PR 5620 (issue with stat() > > on > > > win32): > > > > > > http://gcc.gnu.org/ml/gcc-patches/2003-05/msg01261.html > > > > As well as Joseph's comment, > > > , > > the file i386/x-mingw32 seems to be missing from the > > diff. > > Thanks. Danny, would you mind having a look at this? > > Dara Attached is revised patch, addressing Joseph Myers comment and with missing bit (x-mingw32 is now in CVS. This adds the EXTRA_GCC_OBJS to it). 2003-06-16 Danny Smith PR other/5620 * gcc.c (do_spec_1): Use (HOST_FILE_ID_CMP), if defined, rather than stat. * 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 year and GCC notice. * config/i386/x-mingw32: Set EXTRA_GCC_OBJS to mingw32-1.o. Add rule for compiling mingw32-1.o http://mobile.yahoo.com.au - Yahoo! Mobile - Check & compose your email via SMS on your Telstra or Vodafone mobile. --0-11140637-1055809236=:84559 Content-Type: text/plain; name="mingw-save-temps.diff" Content-Description: mingw-save-temps.diff Content-Disposition: inline; filename="mingw-save-temps.diff" Content-length: 7534 2003-06-16 Danny Smith PR other/5620 * gcc.c (do_spec_1): Use (HOST_FILE_ID_CMP), if defined, rather than stat. * 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 year and GCC notice. * config/i386/x-mingw32: Set EXTRA_GCC_OBJS to mingw32-1.o. Add rule for compiling mingw32-1.o Index: gcc/gcc.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/gcc.c,v retrieving revision 1.379 diff -c -3 -p -r1.379 gcc.c *** gcc/gcc.c 4 Jun 2003 17:50:40 -0000 1.379 --- gcc/gcc.c 16 Jun 2003 23:51:02 -0000 *************** static int basename_length; *** 4174,4180 **** --- 4174,4182 ---- static int suffixed_basename_length; static const char *input_basename; static const char *input_suffix; + #ifndef HOST_FILE_ID_CMP static struct stat input_stat; + #endif static int input_stat_set; /* The compiler used to process the current input file. */ *************** do_spec_1 (spec, inswitch, soft_matched_ *** 4733,4739 **** *((char *) temp_filename + temp_filename_length) = '\0'; if (strcmp (temp_filename, input_filename) != 0) { ! struct stat st_temp; /* Note, set_input() resets input_stat_set to 0. */ if (input_stat_set == 0) --- 4735,4744 ---- *((char *) temp_filename + temp_filename_length) = '\0'; if (strcmp (temp_filename, input_filename) != 0) { ! #if defined HOST_FILE_ID_CMP ! if (HOST_FILE_ID_CMP(input_filename, temp_filename) != 0) ! #else ! struct stat st_temp; /* Note, set_input() resets input_stat_set to 0. */ if (input_stat_set == 0) *************** do_spec_1 (spec, inswitch, soft_matched_ *** 4752,4757 **** --- 4757,4763 ---- || stat (temp_filename, &st_temp) < 0 || input_stat.st_dev != st_temp.st_dev || input_stat.st_ino != st_temp.st_ino) + #endif { temp_filename = save_string (temp_filename, temp_filename_length + 1); --- 864,866 ---- Index: gcc/config/i386/x-mingw32 =================================================================== RCS file: /cvs/gcc/gcc/gcc/config/i386/x-mingw32,v retrieving revision 1.2 diff -c -3 -p -r1.2 x-mingw32 *** gcc/config/i386/x-mingw32 28 May 2003 21:06:23 -0000 1.2 --- gcc/config/i386/x-mingw32 16 Jun 2003 23:51:03 -0000 *************** *** 2,4 **** --- 2,15 ---- # Make local_includedir relative to EXEC_PREFIX # local_includedir=$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include + + # + # For HOST_FILE_ID_CMP for mingw32. + # + EXTRA_GCC_OBJS = mingw32-1.o + + mingw32-1.o: $(srcdir)/config/i386/mingw32-1.c \ + $(srcdir)/config/i386/xm-mingw32.h + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/i386/mingw32-1.c + Index: gcc/config/i386/xm-mingw32.h =================================================================== RCS file: /cvs/gcc/gcc/gcc/config/i386/xm-mingw32.h,v retrieving revision 1.15 diff -c -3 -p -r1.15 xm-mingw32.h *** gcc/config/i386/xm-mingw32.h 10 Jan 2002 22:21:39 -0000 1.15 --- gcc/config/i386/xm-mingw32.h 16 Jun 2003 23:51:03 -0000 *************** *** 1,23 **** /* Configuration for GNU C-compiler for hosting on Windows32. using GNU tools and the Windows32 API Library. ! Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc. ! This file is part of GNU CC. ! GNU CC is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU CC is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GNU CC; see the file COPYING. If not, write to ! the Free Software Foundation, 59 Temple Place - Suite 330, ! Boston, MA 02111-1307, USA. */ /* Even though we support "/", allow "\" since everybody tests both. */ #define DIR_SEPARATOR '\\' --- 1,24 ---- /* Configuration for GNU C-compiler for hosting on Windows32. using GNU tools and the Windows32 API Library. ! Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003 Free Software ! Foundation, Inc. ! This file is part of GCC. ! GCC is free software; you can redistribute it and/or modify it under ! the terms of the GNU General Public License as published by the Free ! Software Foundation; either version 2, or (at your option) any later ! version. ! ! GCC is distributed in the hope that it will be useful, but WITHOUT ANY ! WARRANTY; without even the implied warranty of MERCHANTABILITY or ! FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ! for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to the Free ! Software Foundation, 59 Temple Place - Suite 330, Boston, MA ! 02111-1307, USA. */ /* Even though we support "/", allow "\" since everybody tests both. */ #define DIR_SEPARATOR '\\' *************** Boston, MA 02111-1307, USA. */ *** 31,33 **** --- 32,41 ---- #undef PATH_SEPARATOR #define PATH_SEPARATOR ';' + + /* This replaces the use of stat to determine if files are different + in gcc.c (do_spec_1) handling of --save-temps switch. */ + + extern int + w32_file_id_cmp (const char *, const char *); + #define HOST_FILE_ID_CMP(SRC,DST) w32_file_id_cmp (SRC, DST) *** /dev/null Tue Jun 17 00:51:56 2003 --- gcc/config/i386/mingw32-1.c Mon Jun 16 22:26:35 2003 *************** *** 0 **** --- 1,40 ---- + /* This replaces the use of stat and struct stat.st_ino to determine if + files are different in gcc.c (do_spec_1) handling of --save-temps + switch. + Contributed by Danny Smith (dannysmith@users.sourceforge.net) + Copyright 2003 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2, or (at your option) any later + version. + + GCC is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + + #include "i386/xm-mingw32.h" + #define WIN32_LEAN_AND_MEAN + #include + + /* Return non-zero if src and dst filenames do not refer to same files. */ + + int + w32_file_id_cmp (const char * src, const char * dst) + { + char fullpath_src[MAX_PATH]; + char fullpath_dst[MAX_PATH]; + char* pfilename; + + /* Just compare full pathnames, without regard to case. */ + GetFullPathName (src, MAX_PATH, fullpath_src, &pfilename); + GetFullPathName (dst, MAX_PATH, fullpath_dst, &pfilename); + return (lstrcmpi (fullpath_src, fullpath_dst)); + } --0-11140637-1055809236=:84559--