diff options
Diffstat (limited to 'gdb/testsuite/lib/gdb.exp')
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 25d370e..57866da 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3832,11 +3832,16 @@ proc gdb_compile_shlib {sources dest options} { set outdir [file dirname $dest] set objects "" foreach source $sources { - set sourcebase [file tail $source] - if {[gdb_compile $source "${outdir}/${sourcebase}.o" object $obj_options] != ""} { - return -1 - } - lappend objects ${outdir}/${sourcebase}.o + set sourcebase [file tail $source] + if {[file extension $source] == ".o"} { + # Already a .o file. + lappend objects $source + } elseif {[gdb_compile $source "${outdir}/${sourcebase}.o" object \ + $obj_options] != ""} { + return -1 + } else { + lappend objects ${outdir}/${sourcebase}.o + } } set link_options $options |