From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3386 invoked by alias); 2 Oct 2009 07:15:45 -0000 Received: (qmail 3374 invoked by uid 22791); 2 Oct 2009 07:15:41 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Oct 2009 07:15:35 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n927FTA9034371 ; Fri, 2 Oct 2009 09:15:29 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from mailserver.u-strasbg.fr (ms3.u-strasbg.fr [IPv6:2001:660:2402:d::12]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n927FSs2025897 ; Fri, 2 Oct 2009 09:15:28 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n927FSZc036257 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Fri, 2 Oct 2009 09:15:28 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: "'Pedro Alves'" , References: <001801ca42e7$94c15fe0$be441fa0$@u-strasbg.fr> <200910020029.33291.pedro@codesourcery.com> In-Reply-To: <200910020029.33291.pedro@codesourcery.com> Subject: [RFA-v2] testsuite: avoid compilation error on cygwin/mingw if -nostdlib option is used. Date: Fri, 02 Oct 2009 07:15:00 -0000 Message-ID: <009401ca4330$273730a0$75a591e0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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/msg00049.txt.bz2 Thanks Pedro for the feedback. Here is an updated version Is this OK? Pierre 2009-10-02 Pierre Muller Pedro Alves * lib/gdb.exp (gdb_compile): Avoid adding=20 gdb_saved_unbuffered_mode_obj if -nostdlib option is used. Index: lib/gdb.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.119 diff -u -p -r1.119 gdb.exp --- lib/gdb.exp 13 Jul 2009 19:24:18 -0000 1.119 +++ lib/gdb.exp 2 Oct 2009 07:08:40 -0000 @@ -1824,7 +1824,11 @@ 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=3D$gdb_saved_set_unbuffered_mode_obj" + # This object can only be added if standard libraries are + # used. Thus, we need to disable it if -nostdlib option is used + if {[lsearch -regexp $options "-nostdlib"] < 0 } { + lappend options "ldflags=3D$gdb_saved_set_unbuffered_mode_obj" + } } } =20 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Pedro Alves > Envoy=E9=A0: Friday, October 02, 2009 1:30 AM > =C0=A0: gdb-patches@sourceware.org > Cc=A0: Pierre Muller > Objet=A0: Re: [RFA] testsuite: avoid compilation error on cygwin/mingw if > -nostdlib option is used. >=20 > Seems reasonable. This is okay, with nits below. >=20 > On Thursday 01 October 2009 23:36:12, Pierre Muller wrote: >=20 > > + set add_unbuffered_object 1; > > + if {[lsearch -regexp $options ".*-nostdlib.*"] >=3D 0 } { > > + verbose "No set_unbuffered_mode for -nostdlib option"; > > + set add_unbuffered_object 0; > > + } >=20 > The ';' are unnecessary. The '.*' are also unnecessary. >=20 > > if { $gdb_saved_set_unbuffered_mode_obj =3D=3D "" } { > > 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=3D$gdb_saved_set_unbuffered_mode_obj" > > + if { $add_unbuffered_object =3D=3D 1 } { >=20 > Works too: >=20 > if { $add_unbuffered_object } { >=20 > Or, why not drop the extra variable, and just: >=20 > if {[lsearch -regexp $options "-nostdlib"] < 0 } { > lappend options "ldflags=3D$gdb_saved_set_unbuffered_mode_obj" > } >=20 > a suitable small comment would be nice too. >=20 > > + lappend options > "ldflags=3D$gdb_saved_set_unbuffered_mode_obj" > > + } > > } > > } >=20 > -- > Pedro Alves