From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2488 invoked by alias); 3 Nov 2010 20:49:29 -0000 Received: (qmail 2473 invoked by uid 22791); 3 Nov 2010 20:49:27 -0000 X-SWARE-Spam-Status: No, hits=-2.7 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; Wed, 03 Nov 2010 20:49:23 +0000 From: "davek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/46291] [4.6 Regression] Failed to bootstrap-lto 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: 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: 4.6.0 X-Bugzilla-Changed-Fields: Status Last reconfirmed AssignedTo Ever Confirmed 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, 03 Nov 2010 20:49: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/msg00426.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46291 Dave Korn changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2010.11.03 20:49:18 AssignedTo|unassigned at gcc dot |davek at gcc dot gnu.org |gnu.org | Ever Confirmed|0 |1 --- Comment #2 from Dave Korn 2010-11-03 20:49:18 UTC --- I have found the problem. There is an ambiguity in the plugin interface spec. http://gcc.gnu.org/wiki/whopr/driver says " Input Files [ ... ] struct ld_plugin_input_file { const char *name; int fd; [ ... ] }; [ ... ] fd: An open file descriptor for the input file. The current position in the file is undefined (i.e., the plug-in must call lseek before reading). If the plug-in ^^^^^^^^^^^^^^ claims the file, it will then own the file descriptor and has the responsibility ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ for closing it. If the plug-in does not claim the file, it must leave it open, but ^^^^^^^^^^^^^^^ it is not required to maintain the current position in the file. " However it also says: " Plugin Interfaces [ ... ] 4. [ ... ] Whether the file is claimed or not, the linker maintains responsibility for ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ opening and closing the file as necessary." ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Oops. Guess which way LD does it? Guess which way GOLD does it? Ian? Which way should this really be? While we decide, I have a patch that will fix lto-bootstrap by detecting which linker is calling onload and deciding whether or not to close the fd on that basis.