This is the mail archive of the mailing list for the GCC 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]

Cross compiling and multiple sysroot question

(Reposting from gcc-help since I didn't get any replies there.)

multilib cross compilers.  I was experimenting with a multilib cross compiler
and was using SYSROOT_SUFFIX_SPEC to specify different sysroots for different
multilibs, including big-endian and little-endian with 32 and 64 bits.

Now lets say I create two sysroots:
		sysroot/be with a bin, lib, lib64, etc. directories
		sysroot/le with the same set of directories

These would represent the sysroot of either a 64 bit big-endian or a 64 bit
little-endian linux system that could also run 32 bit executables.
I want my cross compiler to be able to generate code for either system.

So I set these macros and SPECs:
	# m32 and be are defaults
	MULTILIB_OPTIONS = m64 mel		   # In makefile fragment
	MULTILIB_DIRNAMES = 64 el		   # In makefile fragment
	MULTILIB_OSDIRNAMES = m64=../lib64	   # In makefile fragment
	SYSROOT_SUFFIX_SPEC = %{mel:/el;:/eb}	   # in header file

What seems to be happening is that the search for system libraries
like work fine.  It looks in sysroot/be/lib or sysroot/be/lib64
or in the equivalent little-endian directories.  I.e. it searches:

	<sysroot><sysroot-suffix>/lib		   # 32 bits
	<sysroot><sysroot-suffix>/lib/../lib64     # 64 bits

But when it looks for or it is searching:

	<install-dir>/<target-name>/lib		   # 32 bits
	<install_dir>/<target-name>/lib/../lib64   # 64 bits

It does not take into account SYSROOT_SUFFIX_SPEC.  In fact when I
do my build with this setup the little-endian files wind
up overwriting the big-endian files so two of my files are completely missing from the install area.

Shouldn't SYSROOT_SUFFIX_SPEC be used for the gcc shared libraries 
as well as the sysroot areas?  I.e. install and search for in:

	<install-dir><target-name><sysroot-suffix>/lib		# 32 bits
	<install-dir><target-name><sysroot-suffix>/lib/../lib64 # 64 bits

Steve Ellcey

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