aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-10-27 21:31:50 +0000
committerIan Lance Taylor <ian@airs.com>1994-10-27 21:31:50 +0000
commitb5bd927ce52d56229e4ae3f389cdfd2fdb3f84cd (patch)
tree7a2dffb7c63784fef7ad8d617d731148d9ccb28c /ld
parent14cac507a88e921a16b8847ffe8ade8e7e8160b3 (diff)
downloadgdb-b5bd927ce52d56229e4ae3f389cdfd2fdb3f84cd.zip
gdb-b5bd927ce52d56229e4ae3f389cdfd2fdb3f84cd.tar.gz
gdb-b5bd927ce52d56229e4ae3f389cdfd2fdb3f84cd.tar.bz2
* lib/ld.exp (default_ld_compile): If the compilation worked, but
no object file was created, check to see if the compiler foolishly ignored the -o switch when compiling, and move the resulting object if it did.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/lib/ld.exp19
1 files changed, 19 insertions, 0 deletions
diff --git a/ld/testsuite/lib/ld.exp b/ld/testsuite/lib/ld.exp
index 039bee6..d01f074 100644
--- a/ld/testsuite/lib/ld.exp
+++ b/ld/testsuite/lib/ld.exp
@@ -117,6 +117,25 @@ proc default_ld_compile { cc source object } {
catch "exec $cc -I$srcdir$subdir -c $CFLAGS $source -o $object" exec_output
if [string match "" $exec_output] then {
+ if {![file exists $object]} then {
+ regexp ".*/(\[^/\]*)$" $source all dobj
+ regsub "\\.c" $dobj ".o" realobj
+ verbose "looking for $realobj"
+ if {[file exists $realobj]} then {
+ send_log "mv $realobj $object\n"
+ verbose "mv $realobj $object"
+ catch "exec mv $realobj $object" exec_output
+ if {![string match "" $exec_output]} then {
+ send_log "$exec_output\n"
+ verbose "$exec_output"
+ perror "could not move $realobj to $object"
+ return 0
+ }
+ } else {
+ perror "$object not found after compilation"
+ return 0
+ }
+ }
return 1
} else {
send_log "$exec_output\n"