From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7169 invoked by alias); 1 Oct 2009 22:36:03 -0000 Received: (qmail 7151 invoked by uid 22791); 1 Oct 2009 22:36:02 -0000 X-SWARE-Spam-Status: No, hits=-2.2 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; Thu, 01 Oct 2009 22:35:57 +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 n91MZsYU071465 for ; Fri, 2 Oct 2009 00:35:54 +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 n91MZrYm039152 for ; Fri, 2 Oct 2009 00:35:53 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n91MZrMG068262 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 2 Oct 2009 00:35:53 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: Subject: [RFA] testsuite: avoid compilation error on cygwin/mingw if -nostdlib option is used. Date: Thu, 01 Oct 2009 22:36:00 -0000 Message-ID: <001801ca42e7$94c15fe0$be441fa0$@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/msg00037.txt.bz2 To get useful output of the testsuite for cygwin/mingw/djgpp, we need to force the compiled programs in the testsuite to act as it they were on a terminal, which usually results into disabling buffering for stdout and stderr. This does not work for cygwin, and thus we added set_unbuffered_mode.c code. This works almost always, unless -nostdlib option is given at link time, as in that case setvbuf function call will not be resolved. The patch below disables adding the set_unbuffered_mode object if -nostdlib option is given. Pierre Muller Pascal language support maintainer for GDB 2009-10-02 Pierre Muller * lib/gdb.exp (gdb_compile): Avoid adding gdb_saved_unbuffered_mode_obj if -nostdlib option is used. 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 1 Oct 2009 21:56:14 -0000 @@ -1802,6 +1854,11 @@ proc gdb_compile {source dest type optio # which is time consuming, especially if we're remote # host testing. # + set add_unbuffered_object 1; + if {[lsearch -regexp $options ".*-nostdlib.*"] >= 0 } { + verbose "No set_unbuffered_mode for -nostdlib option"; + set add_unbuffered_object 0; + } 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 } { + lappend options "ldflags=$gdb_saved_set_unbuffered_mode_obj" + } } }