From patchwork Mon Jun 10 12:01:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 250227 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 9224A2C00A6 for ; Mon, 10 Jun 2013 22:02:15 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=ZVMBrxvrh7zMegRyHsVuBRrRlstwmZczA3GRMVK+PXmVim20qX R5I82cELroffcF/g+9y9H9XYXS+A1JBtfyYiVTI6giwxhHXJQqfMxhOMmVWKbb7N v/i4cSnVt58w8BRh7qVl2T+loZqIZ93+m9IIN3Gejlx+ThjSoKofUovas= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=kiIjJuxsShhzqed7Nhf0td6p++s=; b=F30Jrv1UeS8n2vI2N21K erX5ZFotKnG+pots3qqmBkpXbO6luj5nF4S2V852Xdg0Mw+GmTwm1Vdog0zFiCqx NBJ2wQcV0S2BUSPjf8hC+qQVjbK7pcweikQLzrP2F9ZpRqi1un5SW5XGX5/IznBt NNQ56bYD209Q/XfbxZwTUxE= Received: (qmail 15612 invoked by alias); 10 Jun 2013 12:02:09 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 15603 invoked by uid 89); 10 Jun 2013 12:02:09 -0000 X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, TW_FW autolearn=ham version=3.3.1 Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 10 Jun 2013 12:01:56 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 62714A398F; Mon, 10 Jun 2013 14:01:54 +0200 (CEST) Date: Mon, 10 Jun 2013 14:01:53 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Cc: "Joseph S. Myers" Subject: [PATCH] Do not redirect ld stdout/stderr in collect2 with -debug Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 This fixes one very annoying thing collect2 does when trying to debug LTO WPA issues. Even with -v you need to wait until all LTRANS stages completed to see the lto1 -fwpa invocation which is because collect2 buffers and replays stdout/stderr of ld (to avoid duplicating that in some cases). But I really want to see the output immediately but there is no way to do that. The easiest is to disable the buffering with -debug (that is, -Wl,-debug to the -flto driver command line). Tested with/without -debug. Ok for trunk? Thanks, Richard. 2013-06-10 Richard Biener * collect2.c (main): Do not redirect ld stdout/stderr when debugging. Index: gcc/collect2.c =================================================================== --- gcc/collect2.c (revision 199732) +++ gcc/collect2.c (working copy) @@ -1189,8 +1189,11 @@ main (int argc, char **argv) #ifdef COLLECT_EXPORT_LIST export_file = make_temp_file (".x"); #endif - ldout = make_temp_file (".ld"); - lderrout = make_temp_file (".le"); + if (!debug) + { + ldout = make_temp_file (".ld"); + lderrout = make_temp_file (".le"); + } *c_ptr++ = c_file_name; *c_ptr++ = "-x"; *c_ptr++ = "c";