[cfe-dev] clang++ as drop-in g++ replacement

Joerg Sonnenberger via cfe-dev cfe-dev at lists.llvm.org
Fri Nov 6 06:49:18 PST 2015


On Fri, Nov 06, 2015 at 02:40:01PM +0000, Jeenu Viswambharan via cfe-dev wrote:
> On Fri, Nov 6, 2015 at 10:03 AM, James Molloy <james at jamesmolloy.co.uk> wrote:
> > Hi Jeenu,
> >
> > Your command line looks fairly correct. Clang falls back to the system
> > linker when it fails to find a cross linker. A couple of things:
> >
> > 1. In the sysroot that Linaro package, "libc" is a subdirectory of
> > "aarch64-linux-gnu". It looks like this is not the case for you - can I
> > confirm that "/path/to/aarch64/gcc" contains the directory
> > "aarch64-linux-gnu"?
> 
> Yes, it does.
> 
> > 2. clang-3.4 is very old to be working on AArch64. It was the first release
> > that contained AArch64 as a target and while we did our best to make it
> > conformant, it was still fairly beta. clang-3.5 was the best release for
> > AArch64 - it contained the backend merge and a bunch of work on its
> > conformance. I'd recommend upgrading to clang-3.7, but at least to
> > clang-3.5.
> 
> I moved to 3.6 (installed from package manager), but that too wouldn't
> pick the right linker. After searching around, I gathered the -B
> option to GCC, which I found working with clang too. So with
> -B/path/to/aarch64/gcc/aarch64-linux-gnu/bin clang picks the AArch64
> linker.

Do you have aarch64-linux-gnu-ld in your path? It should be picked up
automatically by clang if it can be found.

Joerg



More information about the cfe-dev mailing list