From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7810 invoked by alias); 2 Oct 2009 07:29:25 -0000 Received: (qmail 7797 invoked by uid 22791); 2 Oct 2009 07:29:22 -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.152) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Oct 2009 07:29:16 +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 n927TAoR033663 ; Fri, 2 Oct 2009 09:29:10 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [IPv6:2001:660:2402:d::11]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n927TAFq037565 ; Fri, 2 Oct 2009 09:29:10 +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 n927TA6m066627 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Fri, 2 Oct 2009 09:29:10 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: "'Pedro Alves'" , References: <000f01ca42e3$e13cad60$a3b60820$@u-strasbg.fr> <200910020123.53952.pedro@codesourcery.com> In-Reply-To: <200910020123.53952.pedro@codesourcery.com> Subject: [RFA-v2] testsuite: Avoid auto-import warning on cygwin/mingw Date: Fri, 02 Oct 2009 07:29:00 -0000 Message-ID: <009701ca4332$114bda50$33e38ef0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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/msg00050.txt.bz2 > > Is this OK? > > > > I _think_ the idea is fine. Thanks, > IWBN to have basic tests covering > printing auto-imported vs dllimported variables, > and covering stepping into import-lib'ed dll functions (through > the __imp_ trampolines). Not sure, I really get this, sorry. > > --- lib/gdb.exp 13 Jul 2009 19:24:18 -0000 1.119 > > +++ lib/gdb.exp 1 Oct 2009 22:03:25 -0000 > > @@ -1731,7 +1731,10 @@ proc gdb_compile {source dest type optio > > lappend options "additional_flags=-L${outdir}" > > } elseif { [istarget "mips-sgi-irix*"] } { > > lappend options "additional_flags=-rpath > ${outdir}" > > - } > > + } elseif { ([istarget "*-*-mingw*"] > > + || [istarget *-*-cygwin*]) } { > > + lappend new_options > > "additional_flags=-Wl,--enable-auto-import" > > Did you mean 'lappend options'? No, appending to options would mean that this addition would be parsed by the loop 'foreach opt $options {' of line 1713, while adding it to new_options like it is done also below for 'shlib_load'. Furthermore, I always feel uncomfortable when code inside a loop changes the variable on which the loop is performed (options in that case.) Wouldn't it be better to also append to new_options for the two conditions above? So, what about this? 2009-10-02 Pierre Muller * lib/gdb.exp (gdb_compile): Append added options directly to new_options variable. Add --enable-auto-import option for mingw and cygwin targets. Index: lib/gdb.exp =================================================================== 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:26:54 -0000 @@ -1728,10 +1728,13 @@ proc gdb_compile {source dest type optio if { ([test_compiler_info "gcc-*"] && ([istarget "powerpc*-*-aix*"] || [istarget "rs6000*-*-aix*"] )) } { - lappend options "additional_flags=-L${outdir}" + lappend new_options "additional_flags=-L${outdir}" } elseif { [istarget "mips-sgi-irix*"] } { - lappend options "additional_flags=-rpath ${outdir}" - } + lappend new_options "additional_flags=-rpath ${outdir}" + } elseif { ([istarget "*-*-mingw*"] + || [istarget *-*-cygwin*]) } { + lappend new_options "additional_flags=-Wl,--enable-auto-import" + } } } elseif { $opt == "shlib_load" } { if { ([istarget "*-*-mingw*"]