From patchwork Fri Mar 9 15:38:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ludovic =?iso-8859-1?Q?Court=E8s?= X-Patchwork-Id: 145731 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]) by ozlabs.org (Postfix) with SMTP id 0A697B6F9F for ; Sat, 10 Mar 2012 02:38:45 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1331912326; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:To:From:Subject:Date:Lines:Message-ID:Mime-Version: Content-Type:User-Agent:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=A2+Hhu8iVFeRRLi4zXFo5v6CBYM=; b=k5MEMRcrmjETUI3 0rPSHVwql9vG0HSvKJRb0kwxfeLPFqULq4RG16arQJyXNgVkbpmRJ7kKArq0KM5p 4L231oy7kJqnTw0k/c9pRjwWE0HGwoKH3Es9kQDJDm7jWGyhS/tKX/i4teuu4hkz JNjGgIhdTtovw8aGSm16ty4zA8J4= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:To:From:Subject:Date:Lines:Message-ID:Mime-Version:Content-Type:X-URL:X-Revolutionary-Date:X-PGP-Key-ID:X-PGP-Key:X-PGP-Fingerprint:X-OS:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=IFkoSg9GxDX3vE2Ublso44wHV38cxh//S+2ka2h8E+MaNnZTzLuQBpxbNNuQPx hWX7TvNqhzWztJ8rIY0YmhPH3VzXwB6gbIg49uuz7lcjPcnF4n9QbArMNObsFfAD tBQA6A8o942gCAhZ6pc/A6jALIwif9tbnNmghqAzRjFXw=; Received: (qmail 20002 invoked by alias); 9 Mar 2012 15:38:40 -0000 Received: (qmail 19994 invoked by uid 22791); 9 Mar 2012 15:38:39 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, RCVD_NUMERIC_HELO, SARE_HEAD_8BIT_SPAM, SARE_SUB_ENC_UTF8, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from plane.gmane.org (HELO plane.gmane.org) (80.91.229.3) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Mar 2012 15:38:26 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1S61tg-0000al-S6 for gcc-patches@gcc.gnu.org; Fri, 09 Mar 2012 16:38:24 +0100 Received: from 193.50.110.167 ([193.50.110.167]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Mar 2012 16:38:24 +0100 Received: from ludovic.courtes by 193.50.110.167 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Mar 2012 16:38:24 +0100 To: gcc-patches@gcc.gnu.org From: ludovic.courtes@inria.fr (Ludovic =?iso-8859-1?Q?Court=E8s?=) Subject: [PATCH] =?utf-8?Q?Don=E2=80=99t?= insert white space in =?utf-8?Q?=E2=80=98orig=5Foption=5Fwith=5Fargs=5Ftext=E2=80=99?= for OPT_l Date: Fri, 09 Mar 2012 16:38:10 +0100 Lines: 85 Message-ID: <87ipidvl7h.fsf@inria.fr> Mime-Version: 1.0 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 =?iso-8859-1?Q?Vent=F4se?= an 220 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux) X-IsSubscribed: yes 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 Hi, This patch changes ‘generate_option’ to not insert any white spaces after ‘-l’. This fixes a problem introduced in GCC 4.6 (r163459) whereby ‘gfortran -v’ would emit erroneous strings like this: Driving: […] -l gfortran -l m -shared-libgcc […] Note the space after ‘-l’. (In turn, that would confuse Libtool’s ‘_LT_SYS_HIDDEN_LIBDEPS’ macro, which would determine something like this: postdeps="[…] -L/nix/store/wnzgsfhmb3ys5ssfgpcpwjnmdzn717mk-gfortran-4.6.3/lib -l -l […]" eventually leading to a link command-line like this: libtool: link: gfortran -shared […] -l -L/nix/store/blsdhiik2lk4zmz3hbzf77g6hcrq7ckx-gfortran-wrapper-4.6.3/bin […] leading to an error like: ld: cannot find -l-L/nix/store/blsdhiik2lk4zmz3hbzf77g6hcrq7ckx-gfortran-wrapper-4.6.3/bin Ouch!) Thanks, Ludo’. 2012-03-09 Ludovic Courtès * gcc/opts-common.c (generate_option): Don't insert white space in `canonical_option' when OPT_INDEX is OPT_l. diff --git a/gcc/opts-common.c b/gcc/opts-common.c index 354bce0..60ec02d 100644 --- a/gcc/opts-common.c +++ b/gcc/opts-common.c @@ -931,6 +931,12 @@ generate_option (size_t opt_index, const char *arg, int value, break; case 2: + if (opt_index == OPT_l) + /* Don't insert any white spaces between `-l' and its argument. */ + decoded->orig_option_with_args_text + = concat (decoded->canonical_option[0], + decoded->canonical_option[1], NULL); + else decoded->orig_option_with_args_text = concat (decoded->canonical_option[0], " ", decoded->canonical_option[1], NULL);