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

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



+++ Stephen Kelly [2013-06-19 15:48 +0200]:
> 
> Hi there,
> 
> In attempting to use clang as a cross compiler, clang needed to be
> able to find some c runtime files etc which are part of gcc it
> seems.
> 
> However, clang only looks in /usr/lib/gcc/$$TRIPLE for such files.
> It does not look in /usr/lib/gcc-cross/$$TRIPLE , which is where the
> files are on my ubuntu system at least. I assume it is the same on
> debian.

Maybe. This was a relatively recent change make by the gcc maintainer
(I.e they used to be in /usr/lib/gcc/$$TRIPLE but were moved to
/usr/lib/gcc-cross/$$TRIPLE. I don't actually know why. Presumably to
avoid some sort of potential files clash/version-skew issue between
native and cross compilers. But as you say, given theat there are
already triplet and version qualifiers in the path for the files in
there, one might think that was sufficient.

The 4.7.0-3 and 4.6.3-1 debian armel and armhf cross-toochains (from
emdebian.org) that I have installed on this machine still us the old
locations, but I expect that rebuilding latest 4.7 or 4.8 would indeed
get the new ones. I'd have to check which patches are applied.

> I wrote a patch cause clang to also look in gcc-cross, but I'm not
> sure it should be applied:
> 
>  thread.gmane.org/gmane.comp.compilers.clang.scm/73551/focus=73568
> 
> Why are the files for cross compiling installed to gcc-cross instead
> of just gcc/ ? The triples should be the 'safeguard' against mixing
> already, right?

I am inclined to agree. It certainly worked like this for many years.
But the layouts for all these things is a complicated matter, so there
may be a good reason.

Doko - why did this path get changed?

> I'm investigating this to make it easier to cross compile with clang
> using cmake:
> 
>  http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/7142

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


Reply to: