mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 12:23:31 +08:00
* 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.
This commit is contained in:
@ -117,6 +117,25 @@ proc default_ld_compile { cc source object } {
|
|||||||
|
|
||||||
catch "exec $cc -I$srcdir$subdir -c $CFLAGS $source -o $object" exec_output
|
catch "exec $cc -I$srcdir$subdir -c $CFLAGS $source -o $object" exec_output
|
||||||
if [string match "" $exec_output] then {
|
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
|
return 1
|
||||||
} else {
|
} else {
|
||||||
send_log "$exec_output\n"
|
send_log "$exec_output\n"
|
||||||
|
Reference in New Issue
Block a user