This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: X Libraries/linking


On Tue, Jun 25, 2002 at 10:55:38AM -0500, Peter Bergner wrote:
> On Tue, Jun 25, 2002 at 08:36:34AM -0700, H. J. Lu wrote:
> : On Tue, Jun 25, 2002 at 11:50:13AM +0930, Alan Modra wrote:
> : > On Mon, Jun 24, 2002 at 03:59:46PM -0500, Peter Bergner wrote:
> : > > Is it possible to "act" like a native toolchain?
> : > 
> : > Sure.  This enables the /etc/ld.so.conf, LD_RUN_PATH and
> : > LD_LIBRARY_PATH search for powerpc-linux to powerpc64-linux
> : > (and vice-versa) cross linkers.
> : > 
> : > 	* emulparams/elf64ppc.sh (NATIVE_CROSS): Define.
> : > 	* emulparams/elf32ppc.sh (NATIVE_CROSS): Define.
> : > 	* emultempl/elf32.em (gld${EMULATION_NAME}_search_needed): Behave
> : > 	as for a native linker if NATIVE_CROSS.
> : > 	(gld${EMULATION_NAME}_after_open): Likewise.
> : > 
> : 
> : May I ask why you want to do that? I didn't see the original email. It
> : sounds like you may want to enable the powerpc64-linux target when
> : configuring for powerpc-linux.
> 
> On the PPC64 Linux kernel, our binutils & gcc are compiled with
> --host=powerpc-linux --target=powerpc64-linux, so our so called
> "native" toolchain is really a cross toolchain.
> 
> The problem that Stuart hit was he was trying to link against libXt.so
> and libX11.so.  His link command specifed the directory where those
> libs live (-L/...), but it wasn't able to find the other X11 libs those
> particular libs need (eg, libXmu.so,...).  This seems to be due to ld
> not reading /etc/ld.so.conf because it's a cross linker.
> 
> Since our cross toolchain is acting as our native toolchain, I asked Alan
> whether we can make ours "act" as if it really was a native toolcahin.
> 

One way to support 32bit/64bit is to enable both 32bit/64bit targets
in binutils. Here is the linker patch to support --enable-64-bit-bfd.
I don't think it is complete. You should take a look at how x86-64,
mips and maybe others do it. Basically, you have a native binutils
which can do both 32bit and 64bit. You can select the other one at
the run time.


H.J.
---
2002-06-25  H.J. Lu <hjl@gnu.org>

	* configure.tgt (powerpc*-*-linux*): Enable elf64ppc for
	--enable-64-bit-bfd.

--- binutils/ld/configure.tgt.64bit	Tue Jun 18 20:44:30 2002
+++ binutils/ld/configure.tgt	Tue Jun 25 10:10:48 2002
@@ -438,7 +438,11 @@ powerpc*-*-linux*)
 		tdir_elf32ppcsim=$tdir_elf32ppc ;;
 	*)	targ_emul=elf32ppclinux
 		targ_extra_emuls="elf32ppc elf32ppcsim"
-		targ_extra_libpath=elf32ppc ;;
+		targ_extra_libpath=elf32ppc
+		if test "${want64}" = "true"; then
+		  targ_extra_emuls="$targ_extra_emuls elf64ppc"
+		fi
+		;;
 	esac ;;
 powerpc*le-*-elf* | powerpc*le-*-eabi* | powerpc*le-*-solaris* \
   | powerpc*le-*-sysv* | powerpc*le-*-vxworks*)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]