Notice multlib switches.
authorNick Clifton <nickc@redhat.com>
Wed, 28 Jul 1999 08:18:22 +0000 (08:18 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 28 Jul 1999 08:18:22 +0000 (08:18 +0000)
ld/testsuite/ChangeLog
ld/testsuite/lib/ld-lib.exp

index 65e3ecc7671ed02d1245dc9bdcf336956b10a124..8bdef6023ecf6aef0c96e7bd9939289e8c3189c2 100644 (file)
@@ -1,3 +1,18 @@
+1999-07-28  Nick Clifton  <nickc@cygnus.com>
+
+       * lib/ld-lib.exp (proc big_or_little_endian): New proc.
+       Determine if a big endian or little endian output format hass
+       been selected by any of the multilib options, and if so return
+       a suitable command line option for the linker/assembler.
+       (proc default_ld_link): Include the result of proc
+       big_or_little_endian on the command line to the linker.
+       (proc ld_simple_link): Include the result of proc
+       big_or_little_endian on the command line to the linker.
+       (proc default_ld_compile): Append multilib flags to compiler
+       switches.
+       (proc default_ld_assemble): Include the result of proc
+       big_or_little_endian on the command line to the linker.
+
 1999-07-21  H.J. Lu  <hjl@gnu.org>
 
        * ld-elfvers/vers1.c: Add missing prototypes and include
index 19a180b201466af305800610a5f44dd9586c78f3..4b2a446d486a9c482e5840857ee33f422cf7289e 100644 (file)
@@ -43,6 +43,37 @@ proc default_ld_relocate { ld target objects } {
     }
 }
 
+# Look for big-endian or little-endian switches in the multlib
+# options and translate these into a -EB or -EL switch.  Note
+# we cannot rely upon proc process_multilib_options to do this
+# for us because for some targets the compiler does not support
+# -EB/-EL but it does support -mbig-endian/-mlittle-endian, and
+# the site.exp file will include the switch "-mbig-endian"
+# (rather than "big-endian") which is not detected by proc
+# process_multilib_options.
+
+proc big_or_little_endian {} {
+    
+    if [board_info [target_info name] exists multilib_flags] {
+       set tmp_flags " [board_info [target_info name] multilib_flags]";
+
+       foreach x $tmp_flags {
+           case $x in {
+               {*big*endian eb EB} {
+                   set flags " -EB"
+                   return $flags
+               }
+               {*little*endian el EL} {
+                   set flags " -EL"
+                   return $flags
+               }
+           }
+       }
+    }
+
+    set flags ""
+    return $flags
+}
 
 #
 # default_ld_link 
@@ -62,9 +93,11 @@ proc default_ld_link { ld target objects } {
        return 0
     }
     
-    verbose -log "$ld $HOSTING_EMU -o $target $objs $libs"
+    set flags [big_or_little_endian]
     
-    catch "exec $ld $HOSTING_EMU -o $target $objs $libs" exec_output
+    verbose -log "$ld $HOSTING_EMU $flags -o $target $objs $libs"
+    
+    catch "exec $ld $HOSTING_EMU $flags -o $target $objs $libs" exec_output
     set exec_output [prune_warnings $exec_output]
     if [string match "" $exec_output] then {
        return 1
@@ -86,9 +119,11 @@ proc default_ld_simple_link { ld target objects } {
        return 0
     }
     
-    verbose -log "$ld -o $target $objects"
+    set flags [big_or_little_endian]
+    
+    verbose -log "$ld $flags -o $target $objects"
     
-    catch "exec $ld -o $target $objects" exec_output
+    catch "exec $ld $flags -o $target $objects" exec_output
     set exec_output [prune_warnings $exec_output]
 
     # We don't care if we get a warning about a non-existent start
@@ -134,6 +169,10 @@ proc default_ld_compile { cc source object } {
        set flags "$gcc_gas_flag $flags"
     }
 
+    if [board_info [target_info name] exists multilib_flags] {
+       append flags " [board_info [target_info name] multilib_flags]";
+    }
+
     verbose -log "$cc $flags -c $source -o $object"
 
     catch "exec $cc $flags -c $source -o $object" exec_output
@@ -180,9 +219,11 @@ proc default_ld_assemble { as source object } {
 
     if ![info exists ASFLAGS] { set ASFLAGS "" }
 
-    verbose -log "$as $ASFLAGS -o $object $source"
+    set flags [big_or_little_endian]
+
+    verbose -log "$as $flags $ASFLAGS -o $object $source"
 
-    catch "exec $as $ASFLAGS -o $object $source" exec_output
+    catch "exec $as $flags $ASFLAGS -o $object $source" exec_output
     set exec_output [prune_warnings $exec_output]
     if [string match "" $exec_output] then {
        return 1
This page took 0.025918 seconds and 4 git commands to generate.