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

Re: Using /usr/lib/gcc-cross/ for triples



+++ Stephen Kelly [2013-06-27 12:40 +0200]:
> On 06/27/2013 10:28 AM, Stephen Kelly wrote:
> >However, I still don't understand what scenario could lead to a
> >problem. I'll guess, and you tell me if I'm right.
> >
> >1) We have a arm-linux-gnueabihf installation of debian and we
> >install the gcc package natively. This installs the C runtime
> >files to /usr/lib/gcc/arm-linux-gnueabihf as it is a native
> >installation.
> >2) We then install the gcc-arm-linux-gnueabihf cross-compiler
> >package (why would we do that?). This installs the C runtime files
> >to /usr/lib/gcc-cross/arm-linux-gnueabihf as it is a cross
> >installation.
> >2.1) If the package instead installed the files to /usr/lib/gcc/,
> >the packages would be in conflict. This is the problem. (Why would
> >this be a problem? Is it not reasonable to expect a conflict when
> >installing a cross-compiler for the current native platform?)
> >2.2) The C runtime files for gcc-arm-linux-gnueabihf actually
> >differ between the cross-compiler and the native compiler. This is
> >the problem, so they must be kept separate.
> >
> >I guess only one of 2.1 and 2.2 is correct.
> 
> I got confirmation from xnox on IRC that 2.2 is correct.
> 
> He also refined the scenario a bit to having an amd64 host with a
> native amd64 compiler and a native i386 compiler and a i386 cross
> compiler. As the C runtime files for the native i386 compiler and
> the i386 cross compiler are different, they need to be in separate
> directories.
> 
> Similarly, one might have an arm64 host with armhf native and armhf
> cross compilers. The /usr/lib/gcc-cross/arm-linux-gnueabihf/ content
> is for the cross compiler, and the incompatible
> /usr/lib/gcc/arm-linux-gnueabihf/ for the native one.

I don't think this is true. libgcc1 in the native compiler and the
cross-compiler need to do exactly the same job and should be the same,
at least functionally. I've just checked with various other people who
ought to know, primarily Richard Earnshaw the chief gcc compiler guy
at ARM, but also Steve McIntyre, and Andrew Wafaa who are reasonably
clueful on this subject and and we all agree.

So I still don't see the need for this split, indeed I think it's wrong.

I guess some binary tests on native and cross builds would be a useful
check to see if there really _are_ differences in practice, but in
that case we should probably track down the reason and fix it.

I've been building cross-toolchains for years explicitly using the
native-built libgcc1:<target-arch> for the cross toolchain and those
work fine, so if there are differences in practice then they are
subtle ones. 

Doko, can you explain why these files would ever correctly be
different, and why we need to support that case. Given the version and
arch split under /usr/lib/gcc I can't see any sensible need for this.

Wookey
-- 
Principal hats:  Linaro, Emdebian, Wookware, Balloonboard, ARM
http://wookware.org/


Reply to: