This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] testsuite: avoid compilation error on cygwin/mingw if -nostdlib option is used.
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: "Pierre Muller" <muller at ics dot u-strasbg dot fr>
- Date: Fri, 2 Oct 2009 00:29:32 +0100
- Subject: Re: [RFA] testsuite: avoid compilation error on cygwin/mingw if -nostdlib option is used.
- References: <001801ca42e7$94c15fe0$be441fa0$@u-strasbg.fr>
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