+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
}
}
+# 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
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
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
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
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