This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
A patch for dejagnu (fwd)
- To: egcs at cygnus dot com
- Subject: A patch for dejagnu (fwd)
- From: hjl at lucon dot org (H.J. Lu)
- Date: Sat, 21 Mar 1998 13:50:07 -0800 (PST)
> Hi,
>
> Some people have reported problems with the latest dejagnu and
> egcs that dejagnu cannot find the correct libstdc++ and libio.
> Here is a patch which seems to work for me.
>
>
> --
> H.J. Lu (hjl@gnu.org)
> ---
> --- libgloss.exp.orig Wed Mar 11 08:26:07 1998
> +++ libgloss.exp Wed Mar 11 09:33:34 1998
> @@ -425,14 +425,17 @@
>
>
> # search for the top level multilib directory
> - set multitop [lookfor_file "${comp_base_dir}" "${target_alias}"]
> + set multitop [lookfor_file "${comp_base_dir}" "libraries"]
> 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 {
> + set multitop "[lookfor_file ${comp_base_dir} gcc/xgcc]"
> + if { $multitop != "" } {
> + set multitop [file dirname [file dirname $multitop]];
> + } else {
> + # We search ${target_alias} last since it is only valid
> + # when we are running dejagnu on an installed gcc. We
> + # don't want to get it by accident.
> + set multitop [lookfor_file "${comp_base_dir}" "${target_alias}"]
> + if { $multitop == "" } {
> return ""
> }
> }
>
Hi,
It turned out it is not correct for cross-compiling. Here is a new
patch.
--
H.J. Lu (hjl@gnu.org)
---
--- libgloss.exp.orig Wed Mar 11 08:26:07 1998
+++ libgloss.exp Sat Mar 21 13:27:41 1998
@@ -425,7 +425,7 @@
# search for the top level multilib directory
- set multitop [lookfor_file "${comp_base_dir}" "${target_alias}"]
+ set multitop [lookfor_dir_with_trigger "${comp_base_dir}" "${target_alias}" "libiberty/libiberty.a"]
if { $multitop == "" } {
set multitop [lookfor_file "${comp_base_dir}" "libraries"]
if { $multitop == "" } {
--- runtest.exp.orig Sat Mar 21 13:16:30 1998
+++ runtest.exp Sat Mar 21 13:24:44 1998
@@ -546,6 +546,21 @@
}
#
+# lookfor_dir_with_trigger -- try to find a dir by searching up
+# multiple directory levels
+#
+proc lookfor_dir_with_trigger { dir name trigger } {
+ foreach x ".. ../.. ../../.. ../../../.." {
+ verbose "$dir/$name with $trigger "
+ if [file exists $dir/$name/$trigger] {
+ return $dir/$name;
+ }
+ set dir [remote_file build dirname $dir];
+ }
+ return ""
+}
+
+#
# load_lib -- load a library by sourcing it
#
# If there a multiple files with the same name, stop after the first one found.