From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1280 invoked by alias); 9 Feb 2011 03:32:40 -0000 Received: (qmail 1271 invoked by uid 22791); 9 Feb 2011 03:32:39 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_YP X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Feb 2011 03:32:34 +0000 From: "coolypf at qq dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/47241] lto not work on mingw32, reporting 'ld.exe: could not unlink output file' X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: coolypf at qq dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Resolution Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 09 Feb 2011 03:57:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg01129.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47241 coolypf changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution| |FIXED --- Comment #3 from coolypf 2011-02-09 03:32:28 UTC --- (In reply to comment #2) > Hmm, this could be related to wrapper and file-removing there. > > Does this patch fixes the issue you have? > > Index: lto-plugin.c > =================================================================== > --- lto-plugin.c (revision 169926) > +++ lto-plugin.c (working copy) > @@ -660,12 +660,14 @@ > if (arguments_file_name) > { > t = unlink (arguments_file_name); > + if (t != 0 && errno == ENOENT) t = 0; > check (t == 0, LDPL_FATAL, "could not unlink arguments file"); > } > > for (i = 0; i < num_output_files; i++) > { > t = unlink (output_files[i]); > + if (t != 0 && errno == ENOENT) t = 0; > check (t == 0, LDPL_FATAL, "could not unlink output file"); > } It does not fix the problem. But the following code WORKS: if (t != 0 && errno == 13) t = 0; Something related to unlink is not implemented in mingw.