This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: Tweak collect2 for mingw32
- From: Danny Smith <danny_smith_0000 at yahoo dot co dot nz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 30 Mar 2005 14:07:26 +1200 (NZST)
- Subject: Patch: Tweak collect2 for mingw32
- Reply-to: dannysmith at users dot sourceforge dot net
Hello
The following tweak, already on csl-arm branch, is needed for collect2 on
windows host.
Apply from csl-arm-branch.
2004-02-12 Mark Mithchell <mmitchel@gcc.gnu.org>
* tlink.c (recompile_files): Do not assume that "rename" can
overwrite an existing file.
Index: gcc/gcc/tlink.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tlink.c,v
retrieving revision 1.59
diff -c -3 -p -r1.59 tlink.c
*** gcc/gcc/tlink.c 9 Nov 2004 10:12:19 -0000 1.59
--- gcc/gcc/tlink.c 29 Mar 2005 05:50:44 -0000
*************** recompile_files (void)
*** 468,474 ****
}
fclose (stream);
fclose (output);
! rename (outname, f->key);
if (!f->args)
{
--- 468,480 ----
}
fclose (stream);
fclose (output);
! /* On Windows "rename" returns -1 and sets ERRNO to EACCESS if
! the new file name already exists. Therefore, we explicitly
! remove the old file first. */
! if (remove (f->key) == -1)
! fatal_perror ("removing .rpo file");
! if (rename (outname, f->key) == -1)
! fatal_perror ("renaming .rpo file");
if (!f->args)
{
Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com