From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94002 invoked by alias); 26 Mar 2015 12:41:31 -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 Received: (qmail 93968 invoked by uid 48); 26 Mar 2015 12:41:27 -0000 From: "rainer@emrich-ebersheim.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65581] [5 Regression] testsuite lto issue: multiple definition of `main', undefined reference to `WinMain' Date: Thu, 26 Mar 2015 12:59:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rainer@emrich-ebersheim.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg02954.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65581 --- Comment #3 from Rainer Emrich --- (In reply to Richard Biener from comment #2) > Can you try reducing to a minimal example? it would seem that int main() { > return 0; } should already fail this way? test.c: int main() { return 0; } Installed gcc: gcc test.c -fno-diagnostics-show-caret -fdiagnostics-color=never -O2 -flto -lm -o test.exe D:\msys64\tmp\ccNrn9pc.lto.o::(.text.startup+0x0): multiple definition of `main' D:/x86_64-w64-trunk/mingw/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):D:/opt/devel/gnu/src/gcc-mingw-w64/mingw-w64-runtime.git/mingw-w64-crt/crt/crt0_c.c:17: first defined here D:/x86_64-w64-trunk/mingw/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): In function `main': D:/opt/devel/gnu/src/gcc-mingw-w64/mingw-w64-runtime.git/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain' collect2.exe: error: ld returned 1 exit status Yeah, there's a real problem!