Quantcast
Viewing all articles
Browse latest Browse all 5970

Cross compiling for AArch64 with Clang built from source

I'm trying to cross compile to AArch64 using clang on Ubuntu. I've installed the right packages and am able to compile successfully using a pre-packaged clang, but doing the same with a self built version causes errors over missing header files or libraries. For example:

simulator/fileoutscalarmgr.cc:22:10: fatal error: 'fstream' file not found   22 | #include <fstream>

I'm able to fix these by manually specifying include paths (I don't have to do this with pre-packaged clang), but compilation still fails at linking which I can't fix.

The outputs of clang -v when setting --sysroot=/usr/aarch64-linux-gnu and --target=aarch64-linux-gnu do not match for the pre-packaged and self built clang versions. Pre-packaged is able to find everything automatically:

Target: aarch64-unknown-linux-gnuThread model: posixInstalledDir: /usr/binFound candidate GCC installation: /usr/bin/../lib/gcc-cross/aarch64-linux-gnu/12Selected GCC installation: /usr/bin/../lib/gcc-cross/aarch64-linux-gnu/12Candidate multilib: .;@m64Selected multilib: .;@m64

While the one built from source cannot find the cross compiler libraries (has no matching output when using -v).

How can I get the clang built from source to find these libraries?


Viewing all articles
Browse latest Browse all 5970

Trending Articles