public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: ld/1485: --enable-targets=all doesn't work for 64bit target
@ 2006-05-25  3:19 H. J. Lu
  2006-05-25  3:48 ` Alan Modra
  0 siblings, 1 reply; 8+ messages in thread
From: H. J. Lu @ 2006-05-25  3:19 UTC (permalink / raw)
  To: binutils

This patch checks 64bit bfd properly so that --enable-targets=all will
work for 64bit target and host.


H.J.
----
2006-05-24  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/1485
	* configure.in: Use ${srcdir}/../bfd/config.bfd to check 64bit
	bfd.  Support 64bit host for --enable-targets=all.
	* configure: Regenerated.

--- ld/configure.in.64	2006-04-14 14:44:46.000000000 -0700
+++ ld/configure.in	2006-05-24 10:16:18.000000000 -0700
@@ -169,6 +169,11 @@ do
       EMUL=$targ_emul
     fi
 
+    . ${srcdir}/../bfd/config.bfd
+    case "${targ_defvec}-${targ_selvecs}" in
+    *elf64*) want64=true;;
+    esac
+
     for i in $targ_emul $targ_extra_emuls $targ_extra_libpath; do
 	case " $all_emuls " in
 	*" e${i}.o "*) ;;
@@ -210,10 +215,13 @@ AC_SUBST(EMUL)
 TDIRS=tdirs
 AC_SUBST_FILE(TDIRS)
 
-dnl FIXME: We will build a 64 bit BFD for a 64 bit host or a 64 bit
-dnl target, and in those cases we should also build the 64 bit
-dnl emulations.
 if test x${all_targets} = xtrue; then
+  if test x${want64} = xfalse; then
+    AC_CHECK_SIZEOF(long)
+    if test "x${ac_cv_sizeof_long}" = "x8"; then
+      want64=true
+    fi
+  fi
   if test x${want64} = xtrue; then
     EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)'
   else

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: ld/1485: --enable-targets=all doesn't work for 64bit target
  2006-05-25  3:19 PATCH: ld/1485: --enable-targets=all doesn't work for 64bit target H. J. Lu
@ 2006-05-25  3:48 ` Alan Modra
  2006-05-25  4:20   ` H. J. Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Modra @ 2006-05-25  3:48 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Wed, May 24, 2006 at 10:23:25AM -0700, H. J. Lu wrote:
> --- ld/configure.in.64	2006-04-14 14:44:46.000000000 -0700
> +++ ld/configure.in	2006-05-24 10:16:18.000000000 -0700
> @@ -169,6 +169,11 @@ do
>        EMUL=$targ_emul
>      fi
>  
> +    . ${srcdir}/../bfd/config.bfd
> +    case "${targ_defvec}-${targ_selvecs}" in
> +    *elf64*) want64=true;;
> +    esac
> +
>      for i in $targ_emul $targ_extra_emuls $targ_extra_libpath; do
>  	case " $all_emuls " in
>  	*" e${i}.o "*) ;;

Please don't add the case statement here.  Instead, set want64 in
config.bfd on each target that has a 64-bit BFD, ie. everything inside
#ifdef BFD64.  Patch preapproved with that change.  I know there are
some targets that are 64-bit but don't have "elf64" support.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: ld/1485: --enable-targets=all doesn't work for 64bit target
  2006-05-25  3:48 ` Alan Modra
@ 2006-05-25  4:20   ` H. J. Lu
  2006-05-25  5:01     ` Alan Modra
  0 siblings, 1 reply; 8+ messages in thread
From: H. J. Lu @ 2006-05-25  4:20 UTC (permalink / raw)
  To: binutils

On Thu, May 25, 2006 at 09:23:09AM +0930, Alan Modra wrote:
> On Wed, May 24, 2006 at 10:23:25AM -0700, H. J. Lu wrote:
> > --- ld/configure.in.64	2006-04-14 14:44:46.000000000 -0700
> > +++ ld/configure.in	2006-05-24 10:16:18.000000000 -0700
> > @@ -169,6 +169,11 @@ do
> >        EMUL=$targ_emul
> >      fi
> >  
> > +    . ${srcdir}/../bfd/config.bfd
> > +    case "${targ_defvec}-${targ_selvecs}" in
> > +    *elf64*) want64=true;;
> > +    esac
> > +
> >      for i in $targ_emul $targ_extra_emuls $targ_extra_libpath; do
> >  	case " $all_emuls " in
> >  	*" e${i}.o "*) ;;
> 
> Please don't add the case statement here.  Instead, set want64 in
> config.bfd on each target that has a 64-bit BFD, ie. everything inside
> #ifdef BFD64.  Patch preapproved with that change.  I know there are
> some targets that are 64-bit but don't have "elf64" support.
> 

I am checking in this patch. I changed lines

  sh-*-linux*)
    targ_defvec=bfd_elf32_shblin_vec
    targ_selvecs=bfd_elf32_shlin_vec
#ifdef BFD64
    targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
#endif
    ;;

to

  sh-*-linux*)
    targ_defvec=bfd_elf32_shblin_vec
    targ_selvecs=bfd_elf32_shlin_vec
    targ64_selvecs="bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
    ;;


H.J.
----
bfd/

2006-05-24  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/1485
	* config.bfd: Set want64 to true if 64bit bfd is used.
	(sh-*-linux*): Use targ64_selvecs for 64bit targets.
	(sh*l*-*-netbsdelf*): Likewise.
	(sh-*-netbsdelf*): Likewise.
	(shl*-*-elf*): Likewise.
	(sh[1234]l*-*-elf*): Likewise.
	(sh3el*-*-elf*): Likewise.
	(shl*-*-kaos*): Likewise.
	(sh-*-elf*): Likewise.
	(sh[1234]*-elf*): Likewise.
	(sh-*-rtems*): Likewise.
	(sh-*-kaos*): Likewise.

ld/

2006-05-24  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/1485
	* configure.in: Use ${srcdir}/../bfd/config.bfd to check 64bit
	bfd.  Support 64bit host for --enable-targets=all.
	* configure: Regenerated.

--- binutils/bfd/config.bfd.64	2006-04-05 11:10:51.000000000 -0700
+++ binutils/bfd/config.bfd	2006-05-24 17:49:18.000000000 -0700
@@ -137,6 +137,7 @@ case "${targ}" in
   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
     targ_defvec=bfd_elf64_alpha_freebsd_vec
     targ_selvecs=ecoffalpha_little_vec
+    want64=true
     # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling.
     case "${targ}" in
       alpha*-*-freebsd3* | alpha*-*-freebsd4 | alpha*-*-freebsd4.0*)
@@ -146,36 +147,45 @@ case "${targ}" in
   alpha*-*-netbsd* | alpha*-*-openbsd*)
     targ_defvec=bfd_elf64_alpha_vec
     targ_selvecs=ecoffalpha_little_vec
+    want64=true
     ;;
   alpha*-*-netware*)
     targ_defvec=ecoffalpha_little_vec
     targ_selvecs=nlm32_alpha_vec
+    want64=true
     ;;
   alpha*-*-linuxecoff*)
     targ_defvec=ecoffalpha_little_vec
     targ_selvecs=bfd_elf64_alpha_vec
+    want64=true
     ;;
   alpha*-*-linux-* | alpha*-*-elf*)
     targ_defvec=bfd_elf64_alpha_vec
     targ_selvecs=ecoffalpha_little_vec
+    want64=true
     ;;
   alpha*-*-*vms*)
     targ_defvec=vms_alpha_vec
+    want64=true
     ;;
   alpha*-*-*)
     targ_defvec=ecoffalpha_little_vec
+    want64=true
     ;;
   ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
     targ_defvec=bfd_elf64_ia64_little_vec
     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+    want64=true
     ;;
   ia64*-*-hpux*)
     targ_defvec=bfd_elf32_ia64_hpux_big_vec
     targ_selvecs="bfd_elf64_ia64_hpux_big_vec"
+    want64=true
     ;;
   sparc64-*-freebsd* | sparc64-*-netbsd* | sparc64-*-openbsd* | sparc64-*-kfreebsd*-gnu)
     targ_defvec=bfd_elf64_sparc_vec
     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+    want64=true
     ;;
 #endif /* BFD64 */
 
@@ -403,11 +413,13 @@ case "${targ}" in
   hppa*64*-*-linux-*)
     targ_defvec=bfd_elf64_hppa_linux_vec
     targ_selvecs=bfd_elf64_hppa_vec
+    want64=true
     ;;
   hppa*64*-*-hpux11*)
     targ_defvec=bfd_elf64_hppa_vec
     targ_selvecs=bfd_elf64_hppa_linux_vec
     targ_cflags=-DHPUX_LARGE_AR_IDS
+    want64=true
     ;;
 #endif
 
@@ -549,18 +561,22 @@ case "${targ}" in
   x86_64-*-elf*)
     targ_defvec=bfd_elf64_x86_64_vec
     targ_selvecs="bfd_elf32_i386_vec i386coff_vec"
+    want64=true
     ;;
   x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
     targ_defvec=bfd_elf64_x86_64_vec
     targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec"
+    want64=true
     ;;
   x86_64-*-netbsd* | x86_64-*-openbsd*)
     targ_defvec=bfd_elf64_x86_64_vec
     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
+    want64=true
     ;;
   x86_64-*-linux-*)
     targ_defvec=bfd_elf64_x86_64_vec
     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
+    want64=true
     ;;
 #endif
   i[3-7]86-*-lynxos*)
@@ -847,6 +863,7 @@ case "${targ}" in
   mips*-*-irix6*)
     targ_defvec=bfd_elf32_nbigmips_vec
     targ_selvecs="bfd_elf32_nlittlemips_vec bfd_elf32_bigmips_vec bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+    want64=true
     ;;
 #endif
   mips*-*-irix5*)
@@ -873,10 +890,12 @@ case "${targ}" in
   mips*el-*-vxworks*)
     targ_defvec=bfd_elf32_littlemips_vxworks_vec
     targ_selvecs="bfd_elf32_littlemips_vec bfd_elf32_bigmips_vxworks_vec bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+    want64=true
     ;;
   mips*-*-vxworks*)
     targ_defvec=bfd_elf32_bigmips_vxworks_vec
     targ_selvecs="bfd_elf32_bigmips_vec bfd_elf32_littlemips_vxworks_vec bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+    want64=true
     ;;
 #endif
   mips*el-*-elf* | mips*el-*-vxworks* | mips*-*-chorus*)
@@ -895,6 +914,7 @@ case "${targ}" in
   mips64*-*-openbsd*)
     targ_defvec=bfd_elf64_tradbigmips_vec
     targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
+    want64=true
     ;;
 #endif
   mips*el-*-openbsd*)
@@ -909,10 +929,12 @@ case "${targ}" in
   mips64*el-*-linux*)
     targ_defvec=bfd_elf32_ntradlittlemips_vec
     targ_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec"
+    want64=true
     ;;
   mips64*-*-linux*)
     targ_defvec=bfd_elf32_ntradbigmips_vec
     targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
+    want64=true
     ;;
 #endif
   mips*el-*-linux*)
@@ -929,6 +951,7 @@ case "${targ}" in
   mmix-*-*)
     targ_defvec=bfd_elf64_mmix_vec
     targ_selvecs=bfd_mmo_vec
+    want64=true
     ;;
 #endif
   mn10200-*-*)
@@ -1026,15 +1049,18 @@ case "${targ}" in
   powerpc64-*-aix*)
     targ_defvec=rs6000coff64_vec
     targ_selvecs=rs6000coff_vec
+    want64=true
     ;;
   powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux* | \
   powerpc64-*-*bsd*)
     targ_defvec=bfd_elf64_powerpc_vec
     targ_selvecs="bfd_elf64_powerpcle_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec"
+    want64=true
     ;;
   powerpc64le-*-elf* | powerpcle-*-elf64*)
     targ_defvec=bfd_elf64_powerpcle_vec
     targ_selvecs="bfd_elf64_powerpc_vec bfd_elf32_powerpcle_vec bfd_elf32_powerpc_vec rs6000coff_vec rs6000coff64_vec"
+    want64=true
     ;;
 #endif
   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
@@ -1099,9 +1125,11 @@ case "${targ}" in
   s390x-*-linux*)
     targ_defvec=bfd_elf64_s390_vec
     targ_selvecs=bfd_elf32_s390_vec
+    want64=true
     ;;
   s390x-*-tpf*)
     targ_defvec=bfd_elf64_s390_vec
+    want64=true
     ;;
 #endif
 
@@ -1110,28 +1138,30 @@ case "${targ}" in
     targ_defvec=bfd_elf32_sh64l_vec
     targ_selvecs="bfd_elf32_sh64_vec bfd_elf64_sh64l_vec bfd_elf64_sh64_vec bfd_elf32_shl_vec bfd_elf32_sh_vec"
     targ_underscore=yes
+    want64=true
     ;;
   sh64-*-elf*)
     targ_defvec=bfd_elf32_sh64_vec
     targ_selvecs="bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec bfd_elf32_sh_vec bfd_elf32_shl_vec"
     targ_underscore=yes
+    want64=true
     ;;
   sh64eb-*-linux*)
     targ_defvec=bfd_elf32_sh64blin_vec
     targ_selvecs="bfd_elf32_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf32_shblin_vec bfd_elf32_shlin_vec"
+    want64=true
     ;;
   sh64-*-linux*)
     targ_defvec=bfd_elf32_sh64lin_vec
     targ_selvecs="bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf32_shlin_vec bfd_elf32_shblin_vec"
+    want64=true
     ;;
 #endif /* BFD64 */
 
   sh-*-linux*)
     targ_defvec=bfd_elf32_shblin_vec
     targ_selvecs=bfd_elf32_shlin_vec
-#ifdef BFD64
-    targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
-#endif
+    targ64_selvecs="bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
     ;;
   sh*eb-*-linux*)
     targ_defvec=bfd_elf32_shblin_vec
@@ -1146,35 +1176,35 @@ case "${targ}" in
   sh5le-*-netbsd*)
     targ_defvec=bfd_elf32_sh64lnbsd_vec
     targ_selvecs="bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec"
+    want64=true
     ;;
   sh5-*-netbsd*)
     targ_defvec=bfd_elf32_sh64nbsd_vec
     targ_selvecs="bfd_elf32_sh64lnbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec"
+    want64=true
     ;;
 
   sh64le-*-netbsd*)
     targ_defvec=bfd_elf64_sh64lnbsd_vec
     targ_selvecs="bfd_elf64_sh64nbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec"
+    want64=true
     ;;
   sh64-*-netbsd*)
     targ_defvec=bfd_elf64_sh64nbsd_vec
     targ_selvecs="bfd_elf64_sh64lnbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec"
+    want64=true
     ;;
 #endif
 
   sh*l*-*-netbsdelf*)
     targ_defvec=bfd_elf32_shlnbsd_vec
     targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec"
-#ifdef BFD64
-    targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
-#endif
+    targ64_selvecs="bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
     ;;
   sh-*-netbsdelf*)
     targ_defvec=bfd_elf32_shnbsd_vec
     targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec"
-#ifdef BFD64
-    targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
-#endif
+    targ64_selvecs="bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
     ;;
   sh*-*-netbsdelf*)
     targ_defvec=bfd_elf32_shnbsd_vec
@@ -1188,9 +1218,7 @@ case "${targ}" in
   shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf* | shl*-*-kaos*)
     targ_defvec=bfd_elf32_shl_vec
     targ_selvecs="bfd_elf32_sh_vec shlcoff_vec shcoff_vec shlcoff_small_vec shcoff_small_vec"
-#ifdef BFD64
-    targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec"
-#endif
+    targ64_selvecs="bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec"
     targ_underscore=yes
     ;;
   sh-*-rtemscoff*)
@@ -1200,10 +1228,7 @@ case "${targ}" in
     ;;
   sh-*-elf* | sh[1234]*-elf* | sh-*-rtems* | sh-*-kaos*)
     targ_defvec=bfd_elf32_sh_vec
-    targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
-#ifdef BFD64
-    targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec"
-#endif
+    targ64_selvecs="bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec"
     targ_underscore=yes
     ;;
   sh-*-nto*)
@@ -1279,6 +1304,7 @@ case "${targ}" in
   sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*)
     targ_defvec=bfd_elf32_sparc_vec
     targ_selvecs="bfd_elf64_sparc_vec sunos_big_vec"
+    want64=true
     ;;
 #endif
   sparc-*-sysv4*)
@@ -1296,14 +1322,17 @@ case "${targ}" in
   sparc64-*-aout*)
     targ_defvec=sunos_big_vec
     targ_underscore=yes
+    want64=true
     ;;
   sparc64-*-linux-*)
     targ_defvec=bfd_elf64_sparc_vec
     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+    want64=true
     ;;
   sparc64-*-elf*)
     targ_defvec=bfd_elf64_sparc_vec
     targ_selvecs=bfd_elf32_sparc_vec
+    want64=true
     ;;
 #endif /* BFD64 */
   sparc*-*-coff*)
--- binutils/ld/configure.in.64	2006-04-14 14:44:46.000000000 -0700
+++ binutils/ld/configure.in	2006-05-24 17:20:16.000000000 -0700
@@ -169,6 +169,10 @@ do
       EMUL=$targ_emul
     fi
 
+    if test x${want64} = xfalse; then
+      . ${srcdir}/../bfd/config.bfd
+    fi
+
     for i in $targ_emul $targ_extra_emuls $targ_extra_libpath; do
 	case " $all_emuls " in
 	*" e${i}.o "*) ;;
@@ -210,10 +214,13 @@ AC_SUBST(EMUL)
 TDIRS=tdirs
 AC_SUBST_FILE(TDIRS)
 
-dnl FIXME: We will build a 64 bit BFD for a 64 bit host or a 64 bit
-dnl target, and in those cases we should also build the 64 bit
-dnl emulations.
 if test x${all_targets} = xtrue; then
+  if test x${want64} = xfalse; then
+    AC_CHECK_SIZEOF(long)
+    if test "x${ac_cv_sizeof_long}" = "x8"; then
+      want64=true
+    fi
+  fi
   if test x${want64} = xtrue; then
     EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)'
   else

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: ld/1485: --enable-targets=all doesn't work for 64bit target
  2006-05-25  4:20   ` H. J. Lu
@ 2006-05-25  5:01     ` Alan Modra
  2006-05-25  5:51       ` Should sh-*-* enable 64bit targets? H. J. Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Modra @ 2006-05-25  5:01 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Wed, May 24, 2006 at 05:58:22PM -0700, H. J. Lu wrote:
>    sh-*-linux*)
>      targ_defvec=bfd_elf32_shblin_vec
>      targ_selvecs=bfd_elf32_shlin_vec
> -#ifdef BFD64
> -    targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
> -#endif
> +    targ64_selvecs="bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
>      ;;

You should have set want64=true here and in the other sh cases you
changed to use targ64_selvecs.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Should sh-*-* enable 64bit targets?
  2006-05-25  5:01     ` Alan Modra
@ 2006-05-25  5:51       ` H. J. Lu
  2006-05-25  5:55         ` Alan Modra
  0 siblings, 1 reply; 8+ messages in thread
From: H. J. Lu @ 2006-05-25  5:51 UTC (permalink / raw)
  To: binutils; +Cc: joern.rennecke, aoliva, kkojima

On Thu, May 25, 2006 at 10:48:25AM +0930, Alan Modra wrote:
> On Wed, May 24, 2006 at 05:58:22PM -0700, H. J. Lu wrote:
> >    sh-*-linux*)
> >      targ_defvec=bfd_elf32_shblin_vec
> >      targ_selvecs=bfd_elf32_shlin_vec
> > -#ifdef BFD64
> > -    targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
> > -#endif
> > +    targ64_selvecs="bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
> >      ;;
> 
> You should have set want64=true here and in the other sh cases you
> changed to use targ64_selvecs.

I am not sure what the original intention was. I assume they wanted
to enable 64bit targets if BFD was 64bit. That is what my change does
by setting targ64_selvecs.



H.J.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Should sh-*-* enable 64bit targets?
  2006-05-25  5:51       ` Should sh-*-* enable 64bit targets? H. J. Lu
@ 2006-05-25  5:55         ` Alan Modra
  2006-05-25 14:45           ` H. J. Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Modra @ 2006-05-25  5:55 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils, joern.rennecke, aoliva, kkojima

On Wed, May 24, 2006 at 07:33:03PM -0700, H. J. Lu wrote:
> On Thu, May 25, 2006 at 10:48:25AM +0930, Alan Modra wrote:
> > On Wed, May 24, 2006 at 05:58:22PM -0700, H. J. Lu wrote:
> > >    sh-*-linux*)
> > >      targ_defvec=bfd_elf32_shblin_vec
> > >      targ_selvecs=bfd_elf32_shlin_vec
> > > -#ifdef BFD64
> > > -    targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
> > > -#endif
> > > +    targ64_selvecs="bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
> > >      ;;
> > 
> > You should have set want64=true here and in the other sh cases you
> > changed to use targ64_selvecs.
> 
> I am not sure what the original intention was. I assume they wanted
> to enable 64bit targets if BFD was 64bit. That is what my change does
> by setting targ64_selvecs.

#ifdef in a shell script is just a comment.  So the original config.bfd
always included the 64-bit sh targets in target_selvecs.  Your patch
to use targ64_selvecs changes that behaviour.  Please add want64=true.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Should sh-*-* enable 64bit targets?
  2006-05-25  5:55         ` Alan Modra
@ 2006-05-25 14:45           ` H. J. Lu
  2006-05-25 14:56             ` Alan Modra
  0 siblings, 1 reply; 8+ messages in thread
From: H. J. Lu @ 2006-05-25 14:45 UTC (permalink / raw)
  To: binutils, joern.rennecke, aoliva, kkojima

On Thu, May 25, 2006 at 12:47:57PM +0930, Alan Modra wrote:
> On Wed, May 24, 2006 at 07:33:03PM -0700, H. J. Lu wrote:
> > On Thu, May 25, 2006 at 10:48:25AM +0930, Alan Modra wrote:
> > > On Wed, May 24, 2006 at 05:58:22PM -0700, H. J. Lu wrote:
> > > >    sh-*-linux*)
> > > >      targ_defvec=bfd_elf32_shblin_vec
> > > >      targ_selvecs=bfd_elf32_shlin_vec
> > > > -#ifdef BFD64
> > > > -    targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
> > > > -#endif
> > > > +    targ64_selvecs="bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
> > > >      ;;
> > > 
> > > You should have set want64=true here and in the other sh cases you
> > > changed to use targ64_selvecs.
> > 
> > I am not sure what the original intention was. I assume they wanted
> > to enable 64bit targets if BFD was 64bit. That is what my change does
> > by setting targ64_selvecs.
> 
> #ifdef in a shell script is just a comment.  So the original config.bfd
> always included the 64-bit sh targets in target_selvecs.  Your patch
> to use targ64_selvecs changes that behaviour.  Please add want64=true.

I built the sh-linux cross binutils without my patch:

[hjl@gnu-13 binutils-import-cross]$ ./build-sh-linux/ld/ld-new -V
GNU ld version 2.17.50 20060524
  Supported emulations:
   shlelf_linux
   shelf_linux
 
My patch doesn't change it. The question is what the original
intention was.

I don't think "#ifdef BFD64" is just a comment. targmatch.sed will put
them into targmatch.h:

#ifdef BFD64
...
#endif


H.J.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Should sh-*-* enable 64bit targets?
  2006-05-25 14:45           ` H. J. Lu
@ 2006-05-25 14:56             ` Alan Modra
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Modra @ 2006-05-25 14:56 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils, joern.rennecke, aoliva, kkojima

On Wed, May 24, 2006 at 10:58:55PM -0700, H. J. Lu wrote:
> I built the sh-linux cross binutils without my patch:
> 
> [hjl@gnu-13 binutils-import-cross]$ ./build-sh-linux/ld/ld-new -V
> GNU ld version 2.17.50 20060524
>   Supported emulations:
>    shlelf_linux
>    shelf_linux
> 
> My patch doesn't change it.

Ridiculous.  You didn't even build a sh-linux cross on a host that tests
your change!

src/binutils-current/configure --prefix=/usr/local --disable-nls --build=i586-linux --host=i586-linux --target=sh-linux

.
.

../opcodes/.libs/libopcodes.a(sh64-dis.o): In function `sh64_get_contents_type_disasm':
/src/binutils-current/opcodes/sh64-dis.c:463: undefined reference to `sh64_get_contents_type'
/src/binutils-current/opcodes/sh64-dis.c:477: undefined reference to `sh64_get_contents_type'
collect2: ld returned 1 exit status
make[4]: *** [objdump] Error 1
make[4]: Leaving directory `/home/alan/build/gas/sh/binutils'

> The question is what the original intention was.

I don't care what the original intent of those SH #ifdef BFD64 tests
were.  They are quite useless.

> I don't think "#ifdef BFD64" is just a comment. targmatch.sed will put
> them into targmatch.h:

For the purpose of running config.bfd as a shell script, it is most
definitely just a comment.  targmatch.sed only picks out targ_defvec, so
in the case of the SH #ifdef BFD64, it is useless for targmatch.h too.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-05-25  8:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-25  3:19 PATCH: ld/1485: --enable-targets=all doesn't work for 64bit target H. J. Lu
2006-05-25  3:48 ` Alan Modra
2006-05-25  4:20   ` H. J. Lu
2006-05-25  5:01     ` Alan Modra
2006-05-25  5:51       ` Should sh-*-* enable 64bit targets? H. J. Lu
2006-05-25  5:55         ` Alan Modra
2006-05-25 14:45           ` H. J. Lu
2006-05-25 14:56             ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).