* lib/gdb.exp (gdb_compile): Avoid adding
authorPierre Muller <muller@sourceware.org>
Fri, 2 Oct 2009 21:28:34 +0000 (21:28 +0000)
committerPierre Muller <muller@sourceware.org>
Fri, 2 Oct 2009 21:28:34 +0000 (21:28 +0000)
gdb_saved_unbuffered_mode_obj if -nostdlib option is used.

gdb/testsuite/ChangeLog
gdb/testsuite/lib/gdb.exp

index 2f4799e..957cf90 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2009-10-01  Pierre Muller  <muller@ics.u-strasbg.fr>
 
        * src/gdb/testsuite/gdb.base/shr1.c: Use %p in format string.
index 0c93a73..af69c68 100644 (file)
@@ -1824,7 +1824,11 @@ proc gdb_compile {source dest type options} {
            # 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"
+           }
        }
     }