diff -Naurb gcc-3.3.3.orig/gcc/c-aux-info.c gcc-3.3.3/gcc/c-aux-info.c --- gcc-3.3.3.orig/gcc/c-aux-info.c Sun Sep 22 03:03:14 2002 +++ gcc-3.3.3/gcc/c-aux-info.c Fri Mar 5 21:41:20 2004 @@ -581,7 +581,7 @@ /* Write the actual line of auxiliary info. */ - fprintf (aux_info_file, "/* %s:%d:%c%c */ %s;", + fprintf (aux_info_file, "/* %s(%d):%c%c */ %s;", DECL_SOURCE_FILE (fndecl), DECL_SOURCE_LINE (fndecl), (is_implicit) ? 'I' : (is_prototyped) ? 'N' : 'O', diff -Naurb gcc-3.3.3.orig/gcc/collect2.c gcc-3.3.3/gcc/collect2.c --- gcc-3.3.3.orig/gcc/collect2.c Mon Dec 8 19:02:40 2003 +++ gcc-3.3.3/gcc/collect2.c Fri Mar 5 21:41:20 2004 @@ -161,6 +161,63 @@ #define SCAN_LIBRARIES #endif +#ifdef __MINGW32__ +/* We are being compiled with mingw32 as host, so we should prepare some + win32 replaces for pipe(), kill(getpid(),...) and vfork() + execv() +*/ +#include +#include + +#define pipe(fildes) _pipe((fildes),1024*16,_O_BINARY) + +#define WIN32_LEAN_AND_MEAN +#include + +int vfork_execv(char *cmdname, char **argv, int fdout); + +/* Helper function for vfork() + execv() replacement. */ +int vfork_execv(char *cmdname, char **argv, int fdout) +{ + STARTUPINFO SI; + PROCESS_INFORMATION PI; + char *params; + int plen = 0; + int i; + BOOL bRes; + + /* Prepare one line with arguments */ + for(i=0;argv[i];i++) plen += strlen(argv[i]) + 1; + plen++; + params = xmalloc(plen); + strcpy(params,argv[0]); + for(i=1;argv[i];i++) strcat(strcat(params," "),argv[i]); + + /* Prepare startup info -- for pipes redirection */ + memset(&SI,0,sizeof(SI)); + SI.cb = sizeof(SI); + SI.dwFlags = STARTF_USESTDHANDLES; + SI.hStdInput = GetStdHandle(STD_INPUT_HANDLE); + SI.hStdOutput = (HANDLE)_get_osfhandle(fdout); + SI.hStdError = GetStdHandle(STD_ERROR_HANDLE); + + /* Create new process in same console, with redirected (piped) stdout */ + bRes = CreateProcess(cmdname,params, + NULL,NULL, /* Security attributes */ + FALSE, /* Handle inheritance */ + 0, /* Flags -- default, in this console, etc */ + NULL, /* Invironment */ + NULL, /* CWD */ + &SI, /* Startup info */ + &PI); /* Process info */ + if(!bRes) return -1; + CloseHandle(PI.hProcess); + CloseHandle(PI.hThread); + return 0; +} + +/* END-OF-WIN32-SECTION */ +#endif + #ifdef USE_COLLECT2 int do_collecting = 1; #else @@ -444,7 +501,11 @@ #endif signal (signo, SIG_DFL); +#ifndef __MINGW32__ kill (getpid (), signo); +#else + ExitProcess(signo); +#endif } @@ -2111,6 +2172,7 @@ fflush (stderr); /* Spawn child nm on pipe */ +#ifndef __MINGW32__ pid = vfork (); if (pid == -1) fatal_perror (VFORK_STRING); @@ -2130,6 +2192,11 @@ execv (nm_file_name, real_nm_argv); fatal_perror ("execv %s", nm_file_name); } +#else + if(vfork_execv(nm_file_name, real_nm_argv, pipe_fd[1])) { + fatal_perror ("vfork+execv %s", nm_file_name); + } +#endif /* Parent context from here on. */ int_handler = (void (*) PARAMS ((int))) signal (SIGINT, SIG_IGN); @@ -2552,6 +2619,7 @@ fflush (stderr); /* Spawn child ldd on pipe */ +#ifndef __MINGW32__ pid = vfork (); if (pid == -1) fatal_perror (VFORK_STRING); @@ -2571,6 +2639,11 @@ execv (ldd_file_name, real_ldd_argv); fatal_perror ("execv %s", ldd_file_name); } +#else + if(vfork_execv(ldd_file_name, real_ldd_argv, pipe_fd[1])) { + fatal_perror ("vfork+execv %s", nm_file_name); + } +#endif /* Parent context from here on. */ int_handler = (void (*) PARAMS ((int))) signal (SIGINT, SIG_IGN); diff -Naurb gcc-3.3.3.orig/gcc/config/arm/arm.h gcc-3.3.3/gcc/config/arm/arm.h --- gcc-3.3.3.orig/gcc/config/arm/arm.h Fri Nov 15 11:21:36 2002 +++ gcc-3.3.3/gcc/config/arm/arm.h Fri Mar 5 21:41:21 2004 @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for ARM. Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 Free Software Foundation, Inc. + 2001, 2002, 2004 Free Software Foundation, Inc. Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) and Martin Simmons (@harleqn.co.uk). More major hacks by Richard Earnshaw (rearnsha@arm.com) @@ -2180,6 +2180,7 @@ goto WIN; \ } \ else if (GET_MODE_CLASS (MODE) != MODE_FLOAT \ + && GET_MODE_SIZE (mode) == 4 \ && GET_CODE (X) == SYMBOL_REF \ && CONSTANT_POOL_ADDRESS_P (X) \ && ! (flag_pic \ diff -Naurb gcc-3.3.3.orig/gcc/config/arm/arm.md gcc-3.3.3/gcc/config/arm/arm.md --- gcc-3.3.3.orig/gcc/config/arm/arm.md Sun Jun 15 22:11:32 2003 +++ gcc-3.3.3/gcc/config/arm/arm.md Fri Mar 5 21:41:21 2004 @@ -1,6 +1,6 @@ ;;- Machine description for ARM for GNU compiler ;; Copyright 1991, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, 2000, -;; 2001, 2002 Free Software Foundation, Inc. +;; 2001, 2002, 2004 Free Software Foundation, Inc. ;; Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) ;; and Martin Simmons (@harleqn.co.uk). ;; More major hacks by Richard Earnshaw (rearnsha@arm.com). @@ -4585,8 +4585,8 @@ ) (define_insn "*thumb_movhi_insn" - [(set (match_operand:HI 0 "nonimmediate_operand" "=l,l, m,*r,*h,l") - (match_operand:HI 1 "general_operand" "l,mn,l,*h,*r,I"))] + [(set (match_operand:HI 0 "nonimmediate_operand" "=l,l,m,*r,*h,l") + (match_operand:HI 1 "general_operand" "l,m,l,*h,*r,I"))] "TARGET_THUMB && ( register_operand (operands[0], HImode) || register_operand (operands[1], HImode))" @@ -4618,8 +4618,7 @@ return \"ldrh %0, %1\"; }" [(set_attr "length" "2,4,2,2,2,2") - (set_attr "type" "*,load,store1,*,*,*") - (set_attr "pool_range" "*,64,*,*,*,*")] + (set_attr "type" "*,load,store1,*,*,*")] ) diff -Naurb gcc-3.3.3.orig/gcc/config/arm/t-arm-elf gcc-3.3.3/gcc/config/arm/t-arm-elf --- gcc-3.3.3.orig/gcc/config/arm/t-arm-elf Wed May 8 16:01:14 2002 +++ gcc-3.3.3/gcc/config/arm/t-arm-elf Fri Mar 5 21:41:21 2004 @@ -38,9 +38,9 @@ # MULTILIB_DIRNAMES += 32bit 26bit # MULTILIB_EXCEPTIONS += *mthumb/*mapcs-26* # -# MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork -# MULTILIB_DIRNAMES += normal interwork -# MULTILIB_EXCEPTIONS += *mapcs-26/*mthumb-interwork* +MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork +MULTILIB_DIRNAMES += normal interwork +MULTILIB_EXCEPTIONS += *mapcs-26/*mthumb-interwork* # # MULTILIB_OPTIONS += fno-leading-underscore/fleading-underscore # MULTILIB_DIRNAMES += elf under diff -Naurb gcc-3.3.3.orig/gcc/config/i386/mingw32-1.c gcc-3.3.3/gcc/config/i386/mingw32-1.c --- gcc-3.3.3.orig/gcc/config/i386/mingw32-1.c Thu Jan 1 00:00:00 1970 +++ gcc-3.3.3/gcc/config/i386/mingw32-1.c Sat Mar 6 10:03:08 2004 @@ -0,0 +1,44 @@ +/* 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 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. */ + +#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 *, const char *); + +int +w32_file_id_cmp (src, dst) + 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)); +} diff -Naurb gcc-3.3.3.orig/gcc/config/i386/x-mingw32 gcc-3.3.3/gcc/config/i386/x-mingw32 --- gcc-3.3.3.orig/gcc/config/i386/x-mingw32 Thu Jan 1 00:00:00 1970 +++ gcc-3.3.3/gcc/config/i386/x-mingw32 Sat Mar 6 09:42:12 2004 @@ -0,0 +1,11 @@ +# +# For HOST_FILE_ID_CMP for mingw32. +# +EXTRA_GCC_OBJS = mingw32-1.o + +mingw32-1.o: $(srcdir)/config/i386/mingw32-1.c + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $? + + +local_includedir=$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include +STMP_FIXINC = diff -Naurb gcc-3.3.3.orig/gcc/config/i386/xm-mingw32.h gcc-3.3.3/gcc/config/i386/xm-mingw32.h --- gcc-3.3.3.orig/gcc/config/i386/xm-mingw32.h Thu Jan 10 22:21:40 2002 +++ gcc-3.3.3/gcc/config/i386/xm-mingw32.h Sat Mar 6 09:44:41 2004 @@ -1,6 +1,6 @@ /* 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. + Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU CC. @@ -31,3 +31,10 @@ #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 PARAMS((const char *, const char *)); +#define HOST_FILE_ID_CMP(SRC,DST) w32_file_id_cmp (SRC, DST) diff -Naurb gcc-3.3.3.orig/gcc/config.gcc gcc-3.3.3/gcc/config.gcc --- gcc-3.3.3.orig/gcc/config.gcc Wed Jan 21 06:06:00 2004 +++ gcc-3.3.3/gcc/config.gcc Fri Mar 5 21:41:21 2004 @@ -1352,6 +1352,7 @@ xm_defines=POSIX xm_file=i386/xm-mingw32.h tmake_file="i386/t-cygwin i386/t-mingw32" + xmake_file=i386/x-mingw32 extra_objs=winnt.o if test x$enable_threads = xyes; then thread_file='win32' diff -Naurb gcc-3.3.3.orig/gcc/gcc.c gcc-3.3.3/gcc/gcc.c --- gcc-3.3.3.orig/gcc/gcc.c Sat Dec 6 03:53:02 2003 +++ gcc-3.3.3/gcc/gcc.c Sat Mar 6 09:44:14 2004 @@ -4075,7 +4075,9 @@ 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. */ @@ -4540,6 +4542,9 @@ *((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. */ @@ -4559,6 +4564,7 @@ || 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);