120 |
return "" |
return "" |
121 |
} |
} |
122 |
|
|
123 |
set ld_script_path [lookfor_file ${tool_root_dir} "ld/ldscripts"]; |
set ld_script_path [lookfor_file ${tool_root_dir} "ld/ldscripts"] |
124 |
if { $ld_script_path != "" } { |
if { $ld_script_path != "" } { |
125 |
set result "-L[file dirname $ld_script_path]" |
set result "-L[file dirname $ld_script_path]" |
126 |
} else { |
} else { |
176 |
set gccpath "[get_multilibs]" |
set gccpath "[get_multilibs]" |
177 |
|
|
178 |
if { $gccpath == "" } { |
if { $gccpath == "" } { |
179 |
set gccpath "$tool_root_dir"; |
set gccpath "$tool_root_dir" |
180 |
} |
} |
181 |
|
|
182 |
set libio_bin_dir [lookfor_file ${gccpath} libio/_G_config.h]; |
set libio_bin_dir [lookfor_file ${gccpath} libio/_G_config.h] |
183 |
|
|
184 |
# linux doesn't build _G_config.h and the test above fails, so |
# linux doesn't build _G_config.h and the test above fails, so |
185 |
# we search for iostream.list too. |
# we search for iostream.list too. |
186 |
if { $libio_bin_dir == "" } { |
if { $libio_bin_dir == "" } { |
187 |
set libio_bin_dir [lookfor_file ${gccpath} libio/iostream.list]; |
set libio_bin_dir [lookfor_file ${gccpath} libio/iostream.list] |
188 |
} |
} |
189 |
|
|
190 |
set libio_src_dir [lookfor_file ${srcdir} libio/Makefile.in] |
set libio_src_dir [lookfor_file ${srcdir} libio/Makefile.in] |
191 |
if { $libio_bin_dir != "" && $libio_src_dir != "" } { |
if { $libio_bin_dir != "" && $libio_src_dir != "" } { |
192 |
set libio_src_dir [file dirname ${libio_src_dir}] |
set libio_src_dir [file dirname ${libio_src_dir}] |
193 |
set libio_bin_dir [file dirname ${libio_bin_dir}]; |
set libio_bin_dir [file dirname ${libio_bin_dir}] |
194 |
return " -isystem ${libio_src_dir} -isystem ${libio_bin_dir}" |
return " -isystem ${libio_src_dir} -isystem ${libio_bin_dir}" |
195 |
} else { |
} else { |
196 |
return "" |
return "" |
252 |
global srcdir |
global srcdir |
253 |
global ld_library_path |
global ld_library_path |
254 |
|
|
255 |
set gccpath [get_multilibs]; |
set gccpath [get_multilibs] |
256 |
set libio_dir "" |
set libio_dir "" |
257 |
set flags "" |
set flags "" |
258 |
set ld_library_path "." |
set ld_library_path "." |
280 |
append flags "-L${gccpath}/librx " |
append flags "-L${gccpath}/librx " |
281 |
} |
} |
282 |
} else { |
} else { |
283 |
global tool_root_dir; |
global tool_root_dir |
284 |
|
|
285 |
set libgpp [lookfor_file ${tool_root_dir} libg++]; |
set libgpp [lookfor_file ${tool_root_dir} libg++] |
286 |
if { $libgpp != "" } { |
if { $libgpp != "" } { |
287 |
append flags "-L${libgpp} "; |
append flags "-L${libgpp} " |
288 |
append ld_library_path ":${libgpp}" |
append ld_library_path ":${libgpp}" |
289 |
} |
} |
290 |
set libstdcpp [lookfor_file ${tool_root_dir} libstdc++]; |
set libstdcpp [lookfor_file ${tool_root_dir} libstdc++] |
291 |
if { $libstdcpp != "" } { |
if { $libstdcpp != "" } { |
292 |
append flags "-L${libstdcpp} "; |
append flags "-L${libstdcpp} " |
293 |
append ld_library_path ":${libstdcpp}" |
append ld_library_path ":${libstdcpp}" |
294 |
} |
} |
295 |
set libiberty [lookfor_file ${tool_root_dir} libiberty]; |
set libiberty [lookfor_file ${tool_root_dir} libiberty] |
296 |
if { $libiberty != "" } { |
if { $libiberty != "" } { |
297 |
append flags "-L${libiberty} "; |
append flags "-L${libiberty} " |
298 |
} |
} |
299 |
set librx [lookfor_file ${tool_root_dir} librx]; |
set librx [lookfor_file ${tool_root_dir} librx] |
300 |
if { $librx != "" } { |
if { $librx != "" } { |
301 |
append flags "-L${librx} "; |
append flags "-L${librx} " |
302 |
} |
} |
303 |
} |
} |
304 |
return "$flags" |
return "$flags" |
341 |
global srcdir |
global srcdir |
342 |
global ld_library_path |
global ld_library_path |
343 |
|
|
344 |
set gccpath [get_multilibs]; |
set gccpath [get_multilibs] |
345 |
set libio_dir "" |
set libio_dir "" |
346 |
set flags "" |
set flags "" |
347 |
|
|
357 |
append flags "-L${gccpath}/librx " |
append flags "-L${gccpath}/librx " |
358 |
} |
} |
359 |
} else { |
} else { |
360 |
global tool_root_dir; |
global tool_root_dir |
361 |
|
|
362 |
set libstdcpp [lookfor_file ${tool_root_dir} libstdc++]; |
set libstdcpp [lookfor_file ${tool_root_dir} libstdc++] |
363 |
if { $libstdcpp != "" } { |
if { $libstdcpp != "" } { |
364 |
append flags "-L${libstdcpp} "; |
append flags "-L${libstdcpp} " |
365 |
append ld_library_path ":${libstdcpp}" |
append ld_library_path ":${libstdcpp}" |
366 |
} |
} |
367 |
set libiberty [lookfor_file ${tool_root_dir} libiberty]; |
set libiberty [lookfor_file ${tool_root_dir} libiberty] |
368 |
if { $libiberty != "" } { |
if { $libiberty != "" } { |
369 |
append flags "-L${libiberty} "; |
append flags "-L${libiberty} " |
370 |
} |
} |
371 |
set librx [lookfor_file ${tool_root_dir} librx]; |
set librx [lookfor_file ${tool_root_dir} librx] |
372 |
if { $librx != "" } { |
if { $librx != "" } { |
373 |
append flags "-L${librx} "; |
append flags "-L${librx} " |
374 |
} |
} |
375 |
} |
} |
376 |
return "$flags" |
return "$flags" |
394 |
} |
} |
395 |
|
|
396 |
if [info exists board] { |
if [info exists board] { |
397 |
set target_board $board; |
set target_board $board |
398 |
} else { |
} else { |
399 |
set target_board [target_info name]; |
set target_board [target_info name] |
400 |
} |
} |
401 |
|
|
402 |
if { [llength $args] == 0 } { |
if { [llength $args] == 0 } { |
403 |
if [board_info $target_board exists multitop] { |
if [board_info $target_board exists multitop] { |
404 |
return "[board_info $target_board multitop]"; |
return "[board_info $target_board multitop]" |
405 |
} |
} |
406 |
|
|
407 |
set board_info($target_board,multitop) "" |
set board_info($target_board,multitop) "" |
408 |
} |
} |
409 |
|
|
410 |
if { [board_info $target_board exists compiler] } { |
if { [board_info $target_board exists compiler] } { |
411 |
set compiler [board_info $target_board compiler]; |
set compiler [board_info $target_board compiler] |
412 |
} else { |
} else { |
413 |
set compiler [find_gcc]; |
set compiler [find_gcc] |
414 |
} |
} |
415 |
|
|
416 |
if { $compiler == "" } { |
if { $compiler == "" } { |
417 |
return ""; |
return "" |
418 |
} |
} |
419 |
|
|
420 |
foreach x "$compiler" { |
foreach x "$compiler" { |
421 |
if [regexp "^-B" "$x"] { |
if [regexp "^-B" "$x"] { |
422 |
regsub "^-B" "$x" "" comp_base_dir; |
regsub "^-B" "$x" "" comp_base_dir |
423 |
set comp_base_dir [file dirname $comp_base_dir]; |
set comp_base_dir [file dirname $comp_base_dir] |
424 |
break; |
break |
425 |
} |
} |
426 |
} |
} |
427 |
|
|
430 |
verbose "compiler is $compiler" |
verbose "compiler is $compiler" |
431 |
|
|
432 |
if { [which $compiler] == 0 } { |
if { [which $compiler] == 0 } { |
433 |
return ""; |
return "" |
434 |
} |
} |
435 |
|
|
436 |
if { [llength $args] > 0 } { |
if { [llength $args] > 0 } { |
437 |
set mopts [lindex $args 0]; |
set mopts [lindex $args 0] |
438 |
} else { |
} else { |
439 |
if { [board_info $target_board exists multilib_flags] } { |
if { [board_info $target_board exists multilib_flags] } { |
440 |
set mopts [board_info $target_board multilib_flags]; |
set mopts [board_info $target_board multilib_flags] |
441 |
} else { |
} else { |
442 |
set mopts "" |
set mopts "" |
443 |
} |
} |
444 |
} |
} |
445 |
|
|
446 |
set default_multilib [exec $compiler --print-multi-lib] |
set default_multilib [exec $compiler --print-multi-lib] |
447 |
set default_multilib [lindex $default_multilib 0]; |
set default_multilib [lindex $default_multilib 0] |
448 |
set extra [string trimleft $default_multilib ".;@@"] |
set extra [string trimleft $default_multilib ".;@@"] |
449 |
|
|
450 |
# extract the options and their directory names as know by gcc |
# extract the options and their directory names as know by gcc |
485 |
} |
} |
486 |
|
|
487 |
if ![info exists comp_base_dir] { |
if ![info exists comp_base_dir] { |
488 |
set comp_base_dir [file dirname [file dirname [file dirname [file dirname [file dirname [exec $compiler --print-prog-name=cc1]]]]]]; |
set comp_base_dir [file dirname [file dirname [file dirname [file dirname [file dirname [exec $compiler --print-prog-name=cc1]]]]]] |
489 |
} |
} |
490 |
|
|
491 |
# search for the top level multilib directory |
# search for the top level multilib directory |
495 |
if { $multitop == "" } { |
if { $multitop == "" } { |
496 |
set multitop "[lookfor_file ${comp_base_dir} gcc/xgcc]" |
set multitop "[lookfor_file ${comp_base_dir} gcc/xgcc]" |
497 |
if { $multitop != "" } { |
if { $multitop != "" } { |
498 |
set multitop [file dirname [file dirname $multitop]]; |
set multitop [file dirname [file dirname $multitop]] |
499 |
} else { |
} else { |
500 |
return "" |
return "" |
501 |
} |
} |
502 |
} |
} |
503 |
} |
} |
504 |
|
|
505 |
set gccpath [eval exec "$compiler" --print-multi-directory $mopts]; |
set gccpath [eval exec "$compiler" --print-multi-directory $mopts] |
506 |
set gccpath [lindex $gccpath 0]; |
set gccpath [lindex $gccpath 0] |
507 |
if { $gccpath != "" } { |
if { $gccpath != "" } { |
508 |
verbose "GCC path is $gccpath"; |
verbose "GCC path is $gccpath" |
509 |
if { [llength $args] == 0 } { |
if { [llength $args] == 0 } { |
510 |
set board_info($target_board,multitop) "$multitop/$gccpath" |
set board_info($target_board,multitop) "$multitop/$gccpath" |
511 |
} |
} |
512 |
return "$multitop/$gccpath"; |
return "$multitop/$gccpath" |
513 |
} |
} |
514 |
|
|
515 |
# extract the MULTILIB_MATCHES from dumpspecs |
# extract the MULTILIB_MATCHES from dumpspecs |
553 |
|
|
554 |
# compare the lists of gcc options with the list of support multilibs |
# compare the lists of gcc options with the list of support multilibs |
555 |
verbose "Supported multilibs are: $multilibs" 3 |
verbose "Supported multilibs are: $multilibs" 3 |
556 |
set best 0; |
set best 0 |
557 |
foreach i "$multilibs" { |
foreach i "$multilibs" { |
558 |
set hits 0 |
set hits 0 |
559 |
set opts [lindex $i 1]; |
set opts [lindex $i 1] |
560 |
if { [llength $opts] <= [llength $moptions] } { |
if { [llength $opts] <= [llength $moptions] } { |
561 |
foreach j "$moptions" { |
foreach j "$moptions" { |
562 |
# see if all the -m<foo> options match any of the multilibs |
# see if all the -m<foo> options match any of the multilibs |
569 |
if { $hits > $best } { |
if { $hits > $best } { |
570 |
verbose "[lindex $i 0] is better, using as gcc path" 2 |
verbose "[lindex $i 0] is better, using as gcc path" 2 |
571 |
set gccpath "[lindex $i 0]" |
set gccpath "[lindex $i 0]" |
572 |
set best $hits; |
set best $hits |
573 |
} |
} |
574 |
} |
} |
575 |
} |
} |
576 |
if ![info exists multitop] { |
if ![info exists multitop] { |
577 |
return ""; |
return "" |
578 |
} |
} |
579 |
|
|
580 |
verbose "gccpath is $gccpath" 3 |
verbose "gccpath is $gccpath" 3 |
595 |
} |
} |
596 |
|
|
597 |
proc find_binutils_prog { name } { |
proc find_binutils_prog { name } { |
598 |
global tool_root_dir; |
global tool_root_dir |
599 |
|
|
600 |
if ![is_remote host] { |
if ![is_remote host] { |
601 |
|
|
602 |
set file [lookfor_file $tool_root_dir $name]; |
set file [lookfor_file $tool_root_dir $name] |
603 |
if { $file == "" } { |
if { $file == "" } { |
604 |
set file [lookfor_file $tool_root_dir ${name}-new]; |
set file [lookfor_file $tool_root_dir ${name}-new] |
605 |
} |
} |
606 |
if { $file == "" } { |
if { $file == "" } { |
607 |
set file [lookfor_file $tool_root_dir binutils/$name]; |
set file [lookfor_file $tool_root_dir binutils/$name] |
608 |
} |
} |
609 |
if { $file == "" } { |
if { $file == "" } { |
610 |
set file [lookfor_file $tool_root_dir binutils/${name}-new]; |
set file [lookfor_file $tool_root_dir binutils/${name}-new] |
611 |
} |
} |
612 |
if { $file != "" } { |
if { $file != "" } { |
613 |
set NAME "$file"; |
set NAME "$file" |
614 |
} else { |
} else { |
615 |
set NAME [transform $name]; |
set NAME [transform $name] |
616 |
} |
} |
617 |
} else { |
} else { |
618 |
set NAME [transform $name] |
set NAME [transform $name] |
619 |
} |
} |
620 |
return $NAME; |
return $NAME |
621 |
} |
} |
622 |
|
|
623 |
proc find_gcc {} { |
proc find_gcc {} { |
624 |
global tool_root_dir |
global tool_root_dir |
625 |
|
|
626 |
if ![is_remote host] { |
if ![is_remote host] { |
627 |
set file [lookfor_file $tool_root_dir xgcc]; |
set file [lookfor_file $tool_root_dir xgcc] |
628 |
if { $file == "" } { |
if { $file == "" } { |
629 |
set file [lookfor_file $tool_root_dir gcc/xgcc]; |
set file [lookfor_file $tool_root_dir gcc/xgcc] |
630 |
} |
} |
631 |
if { $file != "" } { |
if { $file != "" } { |
632 |
set CC "$file -B[file dirname $file]/"; |
set CC "$file -B[file dirname $file]/" |
633 |
} else { |
} else { |
634 |
set CC [transform gcc]; |
set CC [transform gcc] |
635 |
} |
} |
636 |
} else { |
} else { |
637 |
set CC [transform gcc] |
set CC [transform gcc] |
638 |
} |
} |
639 |
return $CC; |
return $CC |
640 |
} |
} |
641 |
|
|
642 |
proc find_gcj {} { |
proc find_gcj {} { |
643 |
global tool_root_dir |
global tool_root_dir |
644 |
|
|
645 |
if ![is_remote host] { |
if ![is_remote host] { |
646 |
set file [lookfor_file $tool_root_dir gcj]; |
set file [lookfor_file $tool_root_dir gcj] |
647 |
if { $file == "" } { |
if { $file == "" } { |
648 |
set file [lookfor_file $tool_root_dir gcc/gcj]; |
set file [lookfor_file $tool_root_dir gcc/gcj] |
649 |
} |
} |
650 |
if { $file != "" } { |
if { $file != "" } { |
651 |
set CC "$file -B[file dirname $file]/"; |
set CC "$file -B[file dirname $file]/" |
652 |
} else { |
} else { |
653 |
set CC [transform gcj]; |
set CC [transform gcj] |
654 |
} |
} |
655 |
} else { |
} else { |
656 |
set CC [transform gcj] |
set CC [transform gcj] |
657 |
} |
} |
658 |
return $CC; |
return $CC |
659 |
} |
} |
660 |
|
|
661 |
proc find_g++ {} { |
proc find_g++ {} { |
662 |
global tool_root_dir |
global tool_root_dir |
663 |
|
|
664 |
if ![is_remote host] { |
if ![is_remote host] { |
665 |
set file [lookfor_file $tool_root_dir g++]; |
set file [lookfor_file $tool_root_dir g++] |
666 |
if { $file == "" } { |
if { $file == "" } { |
667 |
set file [lookfor_file $tool_root_dir gcc/g++]; |
set file [lookfor_file $tool_root_dir gcc/g++] |
668 |
} |
} |
669 |
if { $file != "" } { |
if { $file != "" } { |
670 |
set CC "$file -B[file dirname $file]/"; |
set CC "$file -B[file dirname $file]/" |
671 |
} else { |
} else { |
672 |
set CC [transform g++]; |
set CC [transform g++] |
673 |
} |
} |
674 |
} else { |
} else { |
675 |
set CC [transform g++] |
set CC [transform g++] |
676 |
} |
} |
677 |
return $CC; |
return $CC |
678 |
} |
} |
679 |
|
|
680 |
proc find_g77 {} { |
proc find_g77 {} { |
681 |
global tool_root_dir |
global tool_root_dir |
682 |
|
|
683 |
if ![is_remote host] { |
if ![is_remote host] { |
684 |
set file [lookfor_file $tool_root_dir g77]; |
set file [lookfor_file $tool_root_dir g77] |
685 |
if { $file == "" } { |
if { $file == "" } { |
686 |
set file [lookfor_file $tool_root_dir gcc/g77]; |
set file [lookfor_file $tool_root_dir gcc/g77] |
687 |
} |
} |
688 |
if { $file != "" } { |
if { $file != "" } { |
689 |
set CC "$file -B[file dirname $file]/"; |
set CC "$file -B[file dirname $file]/" |
690 |
} else { |
} else { |
691 |
set CC [transform g77]; |
set CC [transform g77] |
692 |
} |
} |
693 |
} else { |
} else { |
694 |
set CC [transform g77] |
set CC [transform g77] |
695 |
} |
} |
696 |
return $CC; |
return $CC |
697 |
} |
} |
698 |
|
|
699 |
proc find_nm {} { |
proc find_nm {} { |
707 |
} |
} |
708 |
} |
} |
709 |
if { $NM == ""} { |
if { $NM == ""} { |
710 |
set NM [transform nm]; |
set NM [transform nm] |
711 |
} |
} |
712 |
return $NM; |
return $NM |
713 |
} |
} |
714 |
|
|
715 |
proc process_multilib_options { args } { |
proc process_multilib_options { args } { |
716 |
global board; |
global board |
717 |
global board_variant_list; |
global board_variant_list |
718 |
global is_gdb_remote; |
global is_gdb_remote |
719 |
|
|
720 |
set is_gdb_remote 0; |
set is_gdb_remote 0 |
721 |
|
|
722 |
if [board_info $board exists multilib_flags] { |
if [board_info $board exists multilib_flags] { |
723 |
return; |
return |
724 |
} |
} |
725 |
eval add_multilib_option $args; |
eval add_multilib_option $args |
726 |
|
|
727 |
set multilib_flags ""; |
set multilib_flags "" |
728 |
|
|
729 |
foreach x $board_variant_list { |
foreach x $board_variant_list { |
730 |
regsub -all "^\[ \t\]*" "$x" "" x; |
regsub -all "^\[ \t\]*" "$x" "" x |
731 |
regsub -all "\[ \t\]*$" "$x" "" x; |
regsub -all "\[ \t\]*$" "$x" "" x |
732 |
|
|
733 |
if { $x == "" } { |
if { $x == "" } { |
734 |
continue; |
continue |
735 |
} |
} |
736 |
case $x in { |
case $x in { |
737 |
{ aout } { |
{ aout } { |
738 |
set_board_info obj_format "a.out"; |
set_board_info obj_format "a.out" |
739 |
} |
} |
740 |
{ elf } { |
{ elf } { |
741 |
set_board_info obj_format "elf"; |
set_board_info obj_format "elf" |
742 |
} |
} |
743 |
{ pe } { |
{ pe } { |
744 |
set_board_info obj_format "pe"; |
set_board_info obj_format "pe" |
745 |
} |
} |
746 |
{ ecoff } { |
{ ecoff } { |
747 |
set_board_info obj_format "ecoff"; |
set_board_info obj_format "ecoff" |
748 |
} |
} |
749 |
{ stabs } { |
{ stabs } { |
750 |
set_board_info debug_flags "-gstabs"; |
set_board_info debug_flags "-gstabs" |
751 |
} |
} |
752 |
{ dwarf2 } { |
{ dwarf2 } { |
753 |
set_board_info debug_flags "-gdwarf2"; |
set_board_info debug_flags "-gdwarf2" |
754 |
} |
} |
755 |
{ gdb:*=* } { |
{ gdb:*=* } { |
756 |
regsub "^gdb:\[^=\]*=(.*)$" "$x" "\\1" value; |
regsub "^gdb:\[^=\]*=(.*)$" "$x" "\\1" value |
757 |
regsub "^gdb:(\[^=\]*)=.*$" "$x" "\\1" variable; |
regsub "^gdb:(\[^=\]*)=.*$" "$x" "\\1" variable |
758 |
set_board_info $variable "$value"; |
set_board_info $variable "$value" |
759 |
} |
} |
760 |
{ gdb*remote } { |
{ gdb*remote } { |
761 |
set is_gdb_remote 1; |
set is_gdb_remote 1 |
762 |
} |
} |
763 |
{ little*endian el EL } { |
{ little*endian el EL } { |
764 |
append multilib_flags " -EL"; |
append multilib_flags " -EL" |
765 |
} |
} |
766 |
{ big*endian eb EB } { |
{ big*endian eb EB } { |
767 |
append multilib_flags " -EB"; |
append multilib_flags " -EB" |
768 |
} |
} |
769 |
{ "soft*float" } { |
{ "soft*float" } { |
770 |
append multilib_flags " -msoft-float" |
append multilib_flags " -msoft-float" |
771 |
} |
} |
772 |
{ "-*" } { |
{ "-*" } { |
773 |
append multilib_flags " $x"; |
append multilib_flags " $x" |
774 |
} |
} |
775 |
default { |
default { |
776 |
append multilib_flags " -m$x"; |
append multilib_flags " -m$x" |
777 |
} |
} |
778 |
} |
} |
779 |
} |
} |
780 |
set_board_info multilib_flags $multilib_flags; |
set_board_info multilib_flags $multilib_flags |
781 |
} |
} |
782 |
|
|
783 |
proc add_multilib_option { args } { |
proc add_multilib_option { args } { |
786 |
if ![info exists board_variant_list] { |
if ![info exists board_variant_list] { |
787 |
set board_variant_list "" |
set board_variant_list "" |
788 |
} |
} |
789 |
set board_variant_list [concat $args $board_variant_list]; |
set board_variant_list [concat $args $board_variant_list] |
790 |
} |
} |
791 |
|
|
792 |
proc find_gas { } { |
proc find_gas { } { |
795 |
set AS "" |
set AS "" |
796 |
|
|
797 |
if ![is_remote host] { |
if ![is_remote host] { |
798 |
set AS [lookfor_file $tool_root_dir as-new]; |
set AS [lookfor_file $tool_root_dir as-new] |
799 |
if { $AS == "" } { |
if { $AS == "" } { |
800 |
set AS [lookfor_file $tool_root_dir gas/as-new]; |
set AS [lookfor_file $tool_root_dir gas/as-new] |
801 |
} |
} |
802 |
} |
} |
803 |
if { $AS == "" } { |
if { $AS == "" } { |
804 |
set AS [transform as]; |
set AS [transform as] |
805 |
} |
} |
806 |
return $AS; |
return $AS |
807 |
} |
} |
808 |
|
|
809 |
proc find_ld { } { |
proc find_ld { } { |
812 |
set LD "" |
set LD "" |
813 |
|
|
814 |
if ![is_remote host] { |
if ![is_remote host] { |
815 |
set LD [lookfor_file $tool_root_dir ld-new]; |
set LD [lookfor_file $tool_root_dir ld-new] |
816 |
if { $LD == "" } { |
if { $LD == "" } { |
817 |
set LD [lookfor_file $tool_root_dir ld/ld-new]; |
set LD [lookfor_file $tool_root_dir ld/ld-new] |
818 |
} |
} |
819 |
} |
} |
820 |
if { $LD == "" } { |
if { $LD == "" } { |
821 |
set LD [transform ld]; |
set LD [transform ld] |
822 |
} |
} |
823 |
return $LD; |
return $LD |
824 |
} |
} |
825 |
|
|
826 |
proc build_wrapper { gluefile } { |
proc build_wrapper { gluefile } { |
828 |
global tool |
global tool |
829 |
|
|
830 |
if [target_info exists wrap_m68k_aout] { |
if [target_info exists wrap_m68k_aout] { |
831 |
set flags "additional_flags=-DWRAP_M68K_AOUT"; |
set flags "additional_flags=-DWRAP_M68K_AOUT" |
832 |
set result ""; |
set result "" |
833 |
} elseif [target_info exists uses_underscores] { |
} elseif [target_info exists uses_underscores] { |
834 |
set flags "additional_flags=-DUNDERSCORES"; |
set flags "additional_flags=-DUNDERSCORES" |
835 |
set result "-Wl,-wrap,_exit -Wl,-wrap,__exit -Wl,-wrap,_main -Wl,-wrap,_abort"; |
set result "-Wl,-wrap,_exit -Wl,-wrap,__exit -Wl,-wrap,_main -Wl,-wrap,_abort" |
836 |
|
|
837 |
} else { |
} else { |
838 |
set flags ""; |
set flags "" |
839 |
if [target_info exists is_vxworks] { |
if [target_info exists is_vxworks] { |
840 |
set flags "additional_flags=-DVXWORKS"; |
set flags "additional_flags=-DVXWORKS" |
841 |
set result "-Wl,-wrap,exit -Wl,-wrap,main -Wl,-wrap,abort"; |
set result "-Wl,-wrap,exit -Wl,-wrap,main -Wl,-wrap,abort" |
842 |
set result "-Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort"; |
set result "-Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort" |
843 |
} else { |
} else { |
844 |
set result "-Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort"; |
set result "-Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort" |
845 |
} |
} |
846 |
} |
} |
847 |
if [target_info exists wrap_compile_flags] { |
if [target_info exists wrap_compile_flags] { |
848 |
lappend flags "additional_flags=[target_info wrap_compile_flags]"; |
lappend flags "additional_flags=[target_info wrap_compile_flags]" |
849 |
} |
} |
850 |
if { [target_compile ${libdir}/testglue.c ${gluefile} object $flags] == "" } { |
if { [target_compile ${libdir}/testglue.c ${gluefile} object $flags] == "" } { |
851 |
set gluefile [remote_download host ${gluefile} ${tool}_tg.o]; |
set gluefile [remote_download host ${gluefile} ${tool}_tg.o] |
852 |
return [list $gluefile $result]; |
return [list $gluefile $result] |
853 |
} else { |
} else { |
854 |
return "" |
return "" |
855 |
} |
} |