[LLVMdev] configure with clang vs gcc

David Chisnall David.Chisnall at cl.cam.ac.uk
Tue Feb 25 00:28:23 PST 2014


On 25 Feb 2014, at 00:14, reed kotler <rkotler at mips.com> wrote:

> I'm trying to build a native hosted mips compiler on ubuntu x86.
> 
> When I run configure with clang/llvm as the compiler, configure thinks that zlib is present and that valgrind is.
> 
> But later on the make it cannot find zlib.h. If I tell it to not do compression, then it does not look for
> zlib.h but dies looking for valgrind, even if I tell it to disable-valgrind.
> 
> If I configure using gcc-mips, it decides on it's own that zlib.h is not available.
> It also decides that valgrind is not available.

Most likely, your gcc-mips hard codes a non-/ default sysroot, but your clang does not (it is, after all, intrinsically a cross compiler).  I've successfully cross-compiled clang+llvm for MIPS before by providing a CMake toolchain file that tells it the target triple and systroot to use (along with the other flags required for my target) and it Just Works™.  

Or, at least, it builds.  It crashes at run time, and I've still not managed to figure out exactly why.  It looks like a register value that should be preserved is not somewhere, but I have a 2GB trace that I need to look through to find out exactly where... 

David





More information about the llvm-dev mailing list