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

dongsheng.song at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Feb 15 01:25:00 GMT 2011


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

--- Comment #14 from Dongsheng Song <dongsheng.song at gmail dot com> 2011-02-15 01:24:02 UTC ---
(In reply to comment #13)
> So, necessary patch is now committed to binutils. Could you please retest this
> issue with a recent binutils/HEAD version?
> 
> Thanks in advance,
> Kai

Thanks, gcc/g++ can link no erros. but during a simple test,
Hello.cpp.exe can run as expected,
Hello.c.exe runing error with NULL pointer.

C:\>g++ -pipe -O2 -flto -o Hello.c.exe Hello.c

C:\>g++ -pipe -O2 -flto -o Hello.cpp.exe Hello.cpp

C:\>Hello.cpp.exe
Hello, Wolrd!

C:\>Hello.c.exe
<Pop up a NULL pointer dialog>

C:\>type Hello.cpp
#include <iostream>
int main()
{
    std::cout << "Hello, Wolrd!" << std::endl;
    return 0;
}

C:\>type Hello.c
#include <stdio.h>
int main()
{
    printf("Hello, World!\n");
    return 0;
}



More information about the Gcc-bugs mailing list