Looking for help to compile rustc that runs on a raspi

I have successfully managed to compile rustc that can target ARM and the Raspberry Pi. I have successfully compiled and run a "hello world" on raspi.

However I'd like to write more complex programs which link to libraries like xlib, and to do so the easiest solution is probably to compile directly on the raspberry pi instead of using a cross-compiler.

I have tried running ../configure --target=arm-unknown-linux-gnueabihf --host=arm-unknown-linux-gnueabihf but this fails:

configure: looking at LLVM
configure: configuring LLVM for arm-unknown-linux-gnueabihf
configure: configuring LLVM with:
configure: --enable-targets=x86,x86_64,arm,aarch64,mips,powerpc --enable-optimized --disable-assertions --disable-docs --enable-bindings=none --disable-terminfo --disable-zlib --disable-libffi --build=arm-unknown-linux-gnueabihf                         --host=arm-unknown-linux-gnueabihf --target=arm-unknown-linux-gnueabihf --with-python=/usr/bin/python2.7
checking for arm-unknown-linux-gnueabihf-clang... gcc -m32 -m32
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
configure: error: LLVM configure failed

(note that I can't find any config.log)

I do have a arm-linux-gnueabihf-gcc on my system, but I don't know if there's a way to point to it. ./configure --help doesn't give a lot of infos.


This is not a direct answer and I don't know if you have seen this already, but I wrote this guide with some helper scripts some time ago for cross compiling more complex projects using Cargo. It includes a step for pointing the linker towards a sysroot where you can put native libraries (like xlib if it's not there already). It may help :smile: