# extract and print the version number of ld
#
proc default_ld_version { ld } {
+ global host_triplet
+
if { [which $ld] == 0 } then {
perror "$ld does not exist"
exit 1
}
- set tmp [exec $ld --version]
+ catch "exec $ld --version" tmp
+ set tmp [prune_system_crud $host_triplet $tmp]
regexp "version.*$" $tmp version
if [info exists version] then {
# link an object using relocation
#
proc default_ld_relocate { ld target objects } {
-
global HOSTING_EMU
+ global host_triplet
if { [which $ld] == 0 } then {
perror "$ld does not exist"
verbose "$ld $HOSTING_EMU -o $target -r $objects"
catch "exec $ld $HOSTING_EMU -o $target -r $objects" exec_output
+ set exec_output [prune_system_crud $host_triplet $exec_output]
if [string match "" $exec_output] then {
return 1
} else {
# link a program using ld
#
proc default_ld_link { ld target objects } {
-
global HOSTING_EMU
global HOSTING_CRT0
global HOSTING_LIBS
+ global host_triplet
set objs "$HOSTING_CRT0 $objects"
set libs "$HOSTING_LIBS"
verbose "$ld $HOSTING_EMU -o $target $objs $libs"
catch "exec $ld $HOSTING_EMU -o $target $objs $libs" exec_output
+ set exec_output [prune_system_crud $host_triplet $exec_output]
if [string match "" $exec_output] then {
return 1
} else {
# link a program using ld, without including any libraries
#
proc default_ld_simple_link { ld target objects } {
+ global host_triplet
if { [which $ld] == 0 } then {
perror "$ld does not exist"
verbose "$ld -o $target $objects"
catch "exec $ld -o $target $objects" exec_output
+ set exec_output [prune_system_crud $host_triplet $exec_output]
if [string match "" $exec_output] then {
return 1
} else {
global CFLAGS
global srcdir
global subdir
+ global host_triplet
set cc_prog $cc
if {[llength $cc_prog] > 1} then {
verbose "$cc -I$srcdir$subdir -c $CFLAGS $source -o $object"
catch "exec $cc -I$srcdir$subdir -c $CFLAGS $source -o $object" exec_output
+ set exec_output [prune_system_crud $host_triplet $exec_output]
if [string match "" $exec_output] then {
if {![file exists $object]} then {
regexp ".*/(\[^/\]*)$" $source all dobj
send_log "mv $realobj $object\n"
verbose "mv $realobj $object"
catch "exec mv $realobj $object" exec_output
+ set exec_output [prune_system_crud $host_triplet $exec_output]
if {![string match "" $exec_output]} then {
send_log "$exec_output\n"
verbose "$exec_output"
#
proc default_ld_assemble { as source object } {
global ASFLAGS
+ global host_triplet
if {[which $as] == 0} then {
perror "$as does not exist"
verbose "$as $ASFLAGS -o $object $source"
catch "exec $as $ASFLAGS -o $object $source" exec_output
+ set exec_output [prune_system_crud $host_triplet $exec_output]
if [string match "" $exec_output] then {
return 1
} else {
proc default_ld_nm { nm object } {
global NMFLAGS
global nm_output
+ global host_triplet
if {[which $nm] == 0} then {
perror "$nm does not exist"
verbose "$nm $NMFLAGS $object >tmpdir/nm.out"
catch "exec $nm $NMFLAGS $object >tmpdir/nm.out" exec_output
+ set exec_output [prune_system_crud $host_triplet $exec_output]
if [string match "" $exec_output] then {
set file [open tmpdir/nm.out r]
while { [gets $file line] != -1 } {