From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: "'Pedro Alves'" <pedro@codesourcery.com>, <gdb-patches@sourceware.org>
Subject: [RFA-v2] testsuite: avoid compilation error on cygwin/mingw if -nostdlib option is used.
Date: Fri, 02 Oct 2009 07:15:00 -0000 [thread overview]
Message-ID: <009401ca4330$273730a0$75a591e0$@u-strasbg.fr> (raw)
In-Reply-To: <200910020029.33291.pedro@codesourcery.com>
Thanks Pedro for the feedback.
Here is an updated version
Is this OK?
Pierre
2009-10-02 Pierre Muller <muller@ics.u-strasbg.fr>
Pedro Alves <pedro@codesourcery.com>
* 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 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=$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=$gdb_saved_set_unbuffered_mode_obj"
+ }
}
}
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pedro Alves
> Envoyé : Friday, October 02, 2009 1:30 AM
> À : gdb-patches@sourceware.org
> Cc : Pierre Muller
> Objet : Re: [RFA] testsuite: avoid compilation error on cygwin/mingw if
> -nostdlib option is used.
>
> 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
next prev parent reply other threads:[~2009-10-02 7:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-01 22:36 [RFA] " Pierre Muller
2009-10-01 23:29 ` Pedro Alves
2009-10-02 7:15 ` Pierre Muller [this message]
2009-10-02 16:58 ` [RFA-v2] " Pedro Alves
2009-10-02 21:30 ` Pierre Muller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='009401ca4330$273730a0$75a591e0$@u-strasbg.fr' \
--to=muller@ics.u-strasbg.fr \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox