This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: --enable-targets=all breaks ranlib
- From: "H.J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Thu, 13 Sep 2007 12:18:36 -0700
- Subject: PATCH: --enable-targets=all breaks ranlib
Many targets have the default default target. This patch implements
it for bfd_elf32_i386_vec and bfd_elf64_x86_64_vec.
H.J.
----
2007-09-13 H.J. Lu <hongjiu.lu@intel.com>
* config.bfd: Also set the appropriate targ_defaltvec for
bfd_elf32_i386_vec and bfd_elf64_x86_64_vec.
* configure.in (tdefaults): Add -DDEFAULT_ALT_VECTOR when
needed.
* configure: Regenerated.
* format.c (bfd_check_format_matches): Also check the default
alternative target.
--- bfd/config.bfd.default 2007-09-08 18:23:19.000000000 -0700
+++ bfd/config.bfd 2007-09-13 11:50:56.000000000 -0700
@@ -4,6 +4,7 @@
# using ``. config.bfd''.
# Sets the following shell variables:
# targ_defvec Default vector for this target
+# targ_defaltvec Default alternative vector for this target
# targ_selvecs Vectors to build for this target
# targ64_selvecs Vectors to build if --enable-64-bit-bfd is given
# or if host is 64 bit.
@@ -24,6 +25,7 @@
# get this right; it is just convenient.
targ_defvec=
+targ_altdefvec=
targ_selvecs=
targ64_selvecs=
targ_cflags=
@@ -1512,6 +1514,20 @@ esac
case "${host64}${want64}" in
*true*)
targ_selvecs="${targ_selvecs} ${targ64_selvecs}"
+ # Set the appropriate targ_defaltvec.
+ if test "${targ_defvec}" = bfd_elf32_i386_vec; then
+ case "${targ64_selvecs}" in
+ *bfd_elf64_x86_64_vec*)
+ targ_defaltvec=bfd_elf64_x86_64_vec
+ ;;
+ esac
+ elif test "${targ_defvec}" = bfd_elf64_x86_64_vec; then
+ case "${targ_selvecs}" in
+ *bfd_elf32_i386_vec*)
+ targ_defaltvec=bfd_elf32_i386_vec
+ ;;
+ esac
+ fi
;;
esac
--- bfd/configure.default 2007-09-13 10:48:05.000000000 -0700
+++ bfd/configure 2007-09-13 11:56:50.000000000 -0700
@@ -18881,6 +18881,7 @@ fi
all_targets=false
defvec=
+defaltvec=
selvecs=
assocvecs=
selarchs=
@@ -18894,6 +18895,7 @@ do
. $srcdir/config.bfd
if test "x$targ" = "x$target"; then
defvec=$targ_defvec
+ defaltvec=$targ_defaltvec
fi
selvecs="$selvecs $targ_defvec $targ_selvecs"
selarchs="$selarchs $targ_archs"
@@ -19901,6 +19903,7 @@ echo "${ECHO_T}$bfd_file_ptr" >&6
tdefaults=""
test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
+test -n "${defaltvec}" && tdefaults="${tdefaults} -DDEFAULT_ALT_VECTOR=${defaltvec}"
test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
test -n "${assocvecs}" && tdefaults="${tdefaults} -DASSOCIATED_VECS='${assocvecs}'"
test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
--- bfd/configure.in.default 2007-09-13 10:48:05.000000000 -0700
+++ bfd/configure.in 2007-09-13 11:56:44.000000000 -0700
@@ -509,6 +509,7 @@ fi
all_targets=false
defvec=
+defaltvec=
selvecs=
assocvecs=
selarchs=
@@ -522,6 +523,7 @@ do
. $srcdir/config.bfd
if test "x$targ" = "x$target"; then
defvec=$targ_defvec
+ defaltvec=$targ_defaltvec
fi
selvecs="$selvecs $targ_defvec $targ_selvecs"
selarchs="$selarchs $targ_archs"
@@ -987,6 +989,7 @@ AC_SUBST(bfd_ufile_ptr)
tdefaults=""
test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
+test -n "${defaltvec}" && tdefaults="${tdefaults} -DDEFAULT_ALT_VECTOR=${defaltvec}"
test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
test -n "${assocvecs}" && tdefaults="${tdefaults} -DASSOCIATED_VECS='${assocvecs}'"
test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
--- bfd/format.c.default 2007-07-24 15:03:50.000000000 -0700
+++ bfd/format.c 2007-09-13 12:00:11.000000000 -0700
@@ -246,10 +246,13 @@ bfd_check_format_matches (bfd *abfd, bfd
/* This format checks out as ok! */
right_targ = temp;
- /* If this is the default target, accept it, even if other
- targets might match. People who want those other targets
- have to set the GNUTARGET variable. */
- if (temp == bfd_default_vector[0])
+ /* If this is the default target or the default alternative
+ target, accept it, even if other targets might match.
+ People who want those other targets have to set the
+ GNUTARGET variable. */
+ if (temp == bfd_default_vector[0]
+ || (bfd_default_vector[0] != NULL
+ && temp == bfd_default_vector[1]))
{
match_count = 1;
break;
--- bfd/targets.c.default 2007-07-24 15:03:50.000000000 -0700
+++ bfd/targets.c 2007-09-13 11:31:49.000000000 -0700
@@ -1244,6 +1244,9 @@ const bfd_target *bfd_default_vector[] =
#ifdef DEFAULT_VECTOR
&DEFAULT_VECTOR,
#endif
+#ifdef DEFAULT_ALT_VECTOR
+ &DEFAULT_ALT_VECTOR,
+#endif
NULL
};