From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29060 invoked by alias); 1 Oct 2009 23:29:47 -0000 Received: (qmail 29050 invoked by uid 22791); 1 Oct 2009 23:29:46 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Oct 2009 23:29:42 +0000 Received: (qmail 4320 invoked from network); 1 Oct 2009 23:29:40 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 1 Oct 2009 23:29:40 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFA] testsuite: avoid compilation error on cygwin/mingw if -nostdlib option is used. Date: Thu, 01 Oct 2009 23:29:00 -0000 User-Agent: KMail/1.9.10 Cc: "Pierre Muller" References: <001801ca42e7$94c15fe0$be441fa0$@u-strasbg.fr> In-Reply-To: <001801ca42e7$94c15fe0$be441fa0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910020029.33291.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00040.txt.bz2 Seems reasonable. This is okay, with nits below. On Thursday 01 October 2009 23:36:12, Pierre Muller wrote: > + set add_unbuffered_object 1; > + if {[lsearch -regexp $options ".*-nostdlib.*"] >= 0 } { > + verbose "No set_unbuffered_mode for -nostdlib option"; > + set add_unbuffered_object 0; > + } The ';' are unnecessary. The '.*' are also unnecessary. > if { $gdb_saved_set_unbuffered_mode_obj == "" } { > verbose "compiling gdb_saved_set_unbuffered_obj" > set unbuf_src ${srcdir}/lib/set_unbuffered_mode.c > @@ -1824,7 +1881,9 @@ proc gdb_compile {source dest type optio > # reverse link order. In that case, we can use ldflags to > # avoid copying the object file to the host multiple > # times. > - lappend options "ldflags=$gdb_saved_set_unbuffered_mode_obj" > + if { $add_unbuffered_object == 1 } { Works too: if { $add_unbuffered_object } { Or, why not drop the extra variable, and just: if {[lsearch -regexp $options "-nostdlib"] < 0 } { lappend options "ldflags=$gdb_saved_set_unbuffered_mode_obj" } a suitable small comment would be nice too. > + lappend options "ldflags=$gdb_saved_set_unbuffered_mode_obj" > + } > } > } -- Pedro Alves