aboutsummaryrefslogtreecommitdiff
path: root/lib/libgloss.exp
diff options
context:
space:
mode:
authorRob Savoye <rob@welcomehome.org>2002-03-26 02:41:37 +0000
committerRob Savoye <rob@welcomehome.org>2002-03-26 02:41:37 +0000
commitab02af525d4aea59327a732436639c38658771c9 (patch)
treede97d3f242798e4518709fd05be4beee551f64e6 /lib/libgloss.exp
parent461ef3b5398da777ff09e6c77982c75a33054a98 (diff)
downloaddejagnu-ab02af525d4aea59327a732436639c38658771c9.zip
dejagnu-ab02af525d4aea59327a732436639c38658771c9.tar.gz
dejagnu-ab02af525d4aea59327a732436639c38658771c9.tar.bz2
2002-03-26 Hans-Peter Nilsson <hp@bitrange.com>
* lib/libgloss.exp (build_wrapper): Wrap _exit too, unless wrap_m68k_aout, uses_underscores or is_vxworks are defined in target_info. * testglue.c [!VXWORKS && !UNDERSCORES && !WRAP_M68K_AOUT] (REAL__EXIT): Define. [!UNDERSCORES && !WRAP_M68K_AOUT] (ORIG__EXIT): Define. [REAL__EXIT] (REAL__EXIT): Prototype. [ORIG__EXIT] (ORIG__EXIT): New function wrapper. (done_exit_message): New static variable. (ORIG_EXIT): Set done_exit_message.
Diffstat (limited to 'lib/libgloss.exp')
-rw-r--r--lib/libgloss.exp97
1 files changed, 72 insertions, 25 deletions
diff --git a/lib/libgloss.exp b/lib/libgloss.exp
index 98c8d53..26335a7 100644
--- a/lib/libgloss.exp
+++ b/lib/libgloss.exp
@@ -1,4 +1,5 @@
-# Copyright (C) 92 - 2000, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999, 2000, 2002
+# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -70,6 +71,9 @@ proc libgloss_link_flags { args } {
"d10v*" {
set cpu libnosys
}
+ "xscale*" {
+ set cpu arm
+ }
default {
set cpu $target_cpu
}
@@ -210,6 +214,7 @@ proc libio_link_flags { args } {
proc g++_include_flags { args } {
global srcdir
+ global target_alias
if [is_remote host] {
return ""
@@ -221,12 +226,24 @@ proc g++_include_flags { args } {
set dir [lookfor_file ${srcdir} libg++]
if { ${dir} != "" } {
- append flags "-I${dir} -I${dir}/src "
+ append flags " -I${dir} -I${dir}/src"
+ }
+
+ set dir [lookfor_file ${srcdir} libstdc++-v3]
+ if { ${dir} != "" } {
+ append flags " -I${dir}/include -I${dir}/include/std -I${dir}/include/c_std -I${dir}/libsupc++"
+ }
+
+ set dir [lookfor_file ${gccpath} libstdc++-v3]
+ if { ${dir} != "" } {
+ append flags " -I${dir}/include -I${dir}/include/${target_alias}"
}
+
set dir [lookfor_file ${srcdir} libstdc++]
if { ${dir} != "" } {
- append flags "-I${dir} -I${dir}/stl"
+ append flags " -I${dir} -I${dir}/stl"
}
+
return "$flags"
}
@@ -251,6 +268,10 @@ proc g++_link_flags { args } {
append flags "-L${gccpath}/libstdc++ "
append ld_library_path ":${gccpath}/libstdc++"
}
+ if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.a"] {
+ append flags "-L${gccpath}/libstdc++-v3/src/.libs "
+ append ld_library_path ":${gccpath}/libstdc++-v3/src/.libs"
+ }
if [file exists "${gccpath}/libiberty/libiberty.a"] {
append flags "-L${gccpath}/libiberty "
}
@@ -284,6 +305,7 @@ proc g++_link_flags { args } {
proc libstdc++_include_flags { args } {
global srcdir
+ global target_alias
if [is_remote host] {
return ""
@@ -293,10 +315,23 @@ proc libstdc++_include_flags { args } {
set libio_dir ""
set flags ""
+ set dir [lookfor_file ${srcdir} libstdc++-v3]
+ if { ${dir} != "" } {
+ append flags " -I${dir}/include -I${dir}/include/std -I${dir}/include/c_std -I${dir}/libsupc++"
+ }
+
+ set gccpath [get_multilibs]
+
+ set dir [lookfor_file ${gccpath} libstdc++-v3]
+ if { ${dir} != "" } {
+ append flags " -I${dir}/include -I${dir}/include/${target_alias}"
+ }
+
set dir [lookfor_file ${srcdir} libstdc++]
if { ${dir} != "" } {
- append flags "-I${dir} -I${dir}/stl"
+ append flags " -I${dir} -I${dir}/stl"
}
+
return "$flags"
}
@@ -418,25 +453,49 @@ proc get_multilibs { args } {
set comp_base_dir [file dirname [file dirname [file dirname [file dirname [file dirname [exec $compiler --print-prog-name=cc1]]]]]];
}
+ # search for the top level multilib directory
+ set multitop [lookfor_file "${comp_base_dir}" "${target_alias}"]
+ if { $multitop == "" } {
+ set multitop [lookfor_file "${comp_base_dir}" "libraries"]
+ if { $multitop == "" } {
+ set multitop "[lookfor_file ${comp_base_dir} gcc/xgcc]"
+ if { $multitop != "" } {
+ set multitop [file dirname [file dirname $multitop]];
+ } else {
+ return ""
+ }
+ }
+ }
+
+ set gccpath [eval exec "$compiler" --print-multi-directory $mopts];
+ set gccpath [lindex $gccpath 0];
+ if { $gccpath != "" } {
+ verbose "GCC path is $gccpath";
+ if { [llength $args] == 0 } {
+ set board_info($target_board,multitop) "$multitop/$gccpath"
+ }
+ return "$multitop/$gccpath";
+ }
+
# set output [exec $objdump_name --file-headers objfmtst.o ]
set default_multilib [exec $compiler --print-multi-lib]
set default_multilib [lindex $default_multilib 0];
- set extra [string trimleft $default_multilib ".;@"]
+ set extra [string trimleft $default_multilib ".;@@"]
# extract the options and their directory names as know by gcc
foreach i "[exec $compiler --print-multi-lib]" {
if {$extra != ""} {
- # string trimright would do the wrong thing if we included
- # the leading @ in $extra
- set i [string trimright $i $extra]
- set i [string trimright $i "@"]
+ # string trimright would do the wrong thing if we included
+ # the leading @@ in $extra
+ set i [string trimright $i $extra"]
+ set i [string trimright $i "@@"]
}
set opts ""
set dir ""
regexp -- "\[a-z0-9=/\.-\]*;" $i dir
set dir [string trimright $dir "\;@"]
regexp -- "\;@*\[\@a-zA-Z0-9=/\.-\]*" $i opts
- set opts [split [string trimleft $opts "\;@"] "@"]
+ set opts [split [string trimleft $opts "\;@@"] "@@"]
lappend multilibs "$dir {$opts }"
}
@@ -476,20 +535,6 @@ proc get_multilibs { args } {
verbose "options after multimatches: $moptions" 3
}
- # search for the top level multilib directory
- set multitop [lookfor_file "${comp_base_dir}" "${target_alias}"]
- if { $multitop == "" } {
- set multitop [lookfor_file "${comp_base_dir}" "libraries"]
- if { $multitop == "" } {
- set multitop "[lookfor_file ${comp_base_dir} gcc/xgcc]"
- if { $multitop != "" } {
- set multitop [file dirname [file dirname $multitop]];
- } else {
- return ""
- }
- }
- }
-
# make a list of -m<foo> options from the various compiler config variables
set gccpath ""
@@ -778,8 +823,10 @@ proc build_wrapper { gluefile } {
set flags "";
if [target_info exists is_vxworks] {
set flags "additional_flags=-DVXWORKS";
+ set result "-Wl,-wrap,exit -Wl,-wrap,main -Wl,-wrap,abort";
+ } else {
+ set result "-Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort";
}
- set result "-Wl,-wrap,exit -Wl,-wrap,main -Wl,-wrap,abort";
}
if [target_info exists wrap_compile_flags] {
lappend flags "additional_flags=[target_info wrap_compile_flags]";