[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#333952: Cross-compilers should not use biarch



Daniel Jacobowitz wrote:
> On Fri, Oct 14, 2005 at 09:06:19AM -0700, Josh Triplett wrote:
>>Currently, for platforms which natively build a biarch GCC, such as
>>powerpc, the GCC package also attempts to build a biarch cross-compiler
>>when targetting that platform.  This would require the installation of
>>cross-compilation libraries for two different cross-architectures,
>>rather than just one, in order to build and use GCC; otherwise, the
>>build fails when attempting to find a libc for the alternate target.  In
>>addition, dpkg-cross doesn't appear to support converting and installing
>>library packages for the alternate architectures.  It also seems far
>>more likely that when setting up a cross-compilation environment, one
>>would simply construct two cross-compilers, one for each of the two
>>architectures, rather than one two-target compiler.
> 
> My experience suggests that having a biarch cross compiler is, in fact,
> often desirable.
> 
> dpkg-cross shouldn't need to "convert" library packages.  The same
> packages that would be used on a native build are used; they'll be
> Architecture: i386, even if they contain amd64 binaries, et cetera for
> other platforms.

dpkg-cross "converts" library packages by moving the contents of /lib,
/usr/lib, and /usr/X11R6/lib to /usr/$ARCH/lib , and moving the contents
of /usr/include/ and /usr/X11R6/include to /usr/$ARCH/include , where
$ARCH is the architecture string, such as powerpc-linux-gnu.  dpkg-cross
cannot currently convert the packages for an alternate architecture
(such as powerpc64), because the contents are in lib64 directories and
the include files are in alternate locations as well.

Furthermore, it is not clear how it should convert these packages.  If
the architecture string were to be believed, it should stick the files
in the same arch directory under /usr as the standard libraries for that
architecture; however, the architecture string is in fact misleading,
and the files should be put in the directory under /usr corresponding to
the alternate architecture.

In the ideal case, with long-term work on dpkg and dpkg-cross to support
multiple architectures, it might be possible to just make use of the
binary packages for the alternate architecture, rather than needing
hacks like "libc6-dev-powerpc64" and "libc6-dev-amd64".  It might also
be possible to hack dpkg-cross to deal with such hacks in the meantime.

However, at the moment, this patch makes it possible to build at least a
plain cross-compiler for such architectures.

- Josh Triplett

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: