[Bug lto/47241] lto not work on mingw32, reporting 'ld.exe: could not unlink output file'

coolypf at qq dot com gcc-bugzilla@gcc.gnu.org
Wed Feb 9 03:57:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47241

coolypf <coolypf at qq dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from coolypf <coolypf at qq dot com> 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.



More information about the Gcc-bugs mailing list