dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DejaGnu] dejagnu: multilib detection improvement


From: Alexandre Oliva
Subject: [DejaGnu] dejagnu: multilib detection improvement
Date: 09 Feb 2002 00:08:27 -0200
User-agent: Gnus/5.0805 (Gnus v5.8.5) Emacs/20.7

It appears that dejagnu's multilib detection was implemented a very
long time ago, way before GCC supported -print-multi-directory, so it
had to duplicate the techniques used by GCC to decide which multilib
directory to use.  Unfortunately, a number of new features have gone
into GCC's multilibbing features, that made dejagnu's multilib
inference code incorrect.  I had one case in which some default
options, that was mapped by MULTILIB_REDUNDANT_DIRS to a certain
multilib, but that dejagnu insisted on using a different multilib
directory for.

Instead of trying to improve dejagnu's multilib inference engine, I
just arranged for it to use GCC.

I'm checking this into sources.redhat.com, but I hope it can make it
to the GNU CVS tree of dejagnu too.

Index: dejagnu/ChangeLog
from  Alexandre Oliva  <address@hidden>

        * lib/libgloss.exp [get_multilibs]: Compute multitop earlier, and
        use --print-multi-directory if available.

Index: dejagnu/lib/libgloss.exp
===================================================================
RCS file: /cvs/src/src/dejagnu/lib/libgloss.exp,v
retrieving revision 1.5
diff -u -p -r1.5 libgloss.exp
--- dejagnu/lib/libgloss.exp 2002/02/05 17:01:59 1.5
+++ dejagnu/lib/libgloss.exp 2002/02/09 02:03:27
@@ -453,6 +453,30 @@ 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];
@@ -506,20 +530,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
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  address@hidden, redhat.com}
CS PhD student at IC-Unicamp        address@hidden, gnu.org}
Free Software Evangelist                Professional serial bug killer

reply via email to

[Prev in Thread] Current Thread [Next in Thread]