From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7020 invoked by alias); 20 Nov 2010 20:53:05 -0000 Received: (qmail 7011 invoked by uid 22791); 20 Nov 2010 20:53:04 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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; Sat, 20 Nov 2010 20:53:00 +0000 From: "davek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: driver X-Bugzilla-Keywords: lto, patch X-Bugzilla-Severity: normal X-Bugzilla-Who: davek at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: davek at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: 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: Sat, 20 Nov 2010 21:04: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: 2010-11/txt/msg02588.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #21 from Dave Korn 2010-11-20 20:52:38 UTC --- (In reply to comment #20) > If we have to pass libgcc archive in GCC driver, what happens to > random archives on command line? Will LTO ignore them? It sounds > like a bad idea. I think the fix should be in linker, not in GCC > driver. Link-time optimisations can only generate new undefined references to functions that GCC knows how to optimise as builtins, so I think this can only happen with libgcc and libc references. In the case of user code and libraries, there should always be undefined references in the LTO symtabs to the required functions.