Hi Chandler, The case is similar on Ubuntu 13.04. In the patch, I reused the 
idea of finding the gcc installation directories in the ToolChains.cpp file, as 
a part of identifying lib paths under ScanLibDirForGCCTriple(). It seemed to be 
the simplest way to identify the directories of the form Major.Minor.Patch 
(4.8.1 or 4.7.3) in order to look up the header files. 
I agree that we will look at all the directories in the path, i.e. 4.8.1, 4.8, 
4.7.3, 4.7, but will stop as soon as one of the directories exist.

-----Original Message-----
From: Rafael Espíndola [mailto:[email protected]] 
Sent: Wednesday, October 30, 2013 1:44 PM
To: [email protected]
Cc: Rafael Ávila de Espíndola; Chandler Carruth; Murali, Sriram; llvm cfe; 
Amara Emerson; Renato Golin
Subject: Re: [PATCH] Support cross-compiling for Arm on x86

> What problem are you actually trying to solve? Is it that the GCC 
> installation is under a Major.Minor directory, and the headers are under a 
> Major.Minor.Patch directory? Why on earth would that happen? It doesn't make 
> any sense to me and so doesn't seem like something we should really support. 
> I expect the GCC installation to have the same version number spelling as the 
> libstdc++ installation, which seems like a sane place to be. Anything else 
> and we're running the risk of version skew.

Commenting only on the problem, not the patch:

Something like that yes. On a vanilla 13.10 installation + arm cross compiler 
we have /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8 being a symbolic link to 
4.8.1, but in /usr/arm-linux-gnueabihf/include/c++/
there is only a 4.8.1.

The net result is that arm-linux-gnueabihf-g++-4.8 searches headers in

 /usr/arm-linux-gnueabihf/include/c++/4.8.1
 /usr/arm-linux-gnueabihf/include/c++/4.8.1/arm-linux-gnueabihf
 /usr/arm-linux-gnueabihf/include/c++/4.8.1/backward
 /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/include
 /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/include-fixed
 
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/include
 /usr/include

but libraries in

-L/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8
-L/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib
-L/lib/../lib
-L/usr/lib/../lib
-L/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib

Cheers,
Rafael

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to