I’m been starting to get into some lower level programming, and found these great reference points:
The only difference is, I’m wanting to hit the latest ARM chip on the rpi 3, which is ARMv8 with cortex-a53 and neon-fp-armv8.
I’m trying to setup a toolchain for
aarch64-unknown-none-elf, as the title suggests, but am running into trouble once cmake starts trying to compile it’s little test C and C++ programs. What I’ve done so far…
Painstakingly scoured the internet for info to figure out how to correctly build the latest GNU toolchain for
I’ve successfully built and loaded a hello world into qemu with a
cortex-a57 CPU emulation piping some stuff into uart0 with this toolchain to test it was setup correctly. However,
ld were all invoked by hand, and
-c was passed to
gcc when compiling.
Now, onto setting it up through Rust…
I’ve forked and cloned the repo, added a makefile for my target in
mk/cfg and configured with:
configure --prefix=/home/nathan/development/tools/aarch64 --target=aarch64-unknown-none-elf --disable-jemalloc
(The prefix is the same location the GNU chain is installed, and it is all in my
It starts to fail when cmake starts trying to compile it’s “simple C program” located here
I get the following error
cmake: compiler-rt -- The C compiler identification is GNU 6.1.0 -- The CXX compiler identification is GNU 6.1.0 -- The ASM compiler identification is GNU -- Found assembler: /home/nathan/development/tools/aarch64/bin/aarch64-none-elf-gcc -- Check for working C compiler: /home/nathan/development/tools/aarch64/bin/aarch64-none-elf-gcc -- Check for working C compiler: /home/nathan/development/tools/aarch64/bin/aarch64-none-elf-gcc -- broken CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCCompiler.cmake:61 (message): The C compiler "/home/nathan/development/tools/aarch64/bin/aarch64-none-elf-gcc" is not able to compile a simple test program. It fails with the following output: Change Dir: /home/nathan/development/tools/aarch64/build/rust/aarch64-unknown-none-elf/rt/compiler-rt/CMakeFiles/CMakeTmp
Trying to re-create the steps myself, when invoking
gcc without the
-c flag, I also get a string of errors when it starts looking for various libs.
When building the GNU toochain, I supplied the
--disable-multilib flag, because I did not expect gcc to handle the post steps for me.
What do I need to do in order to get
rustc compiled in the same way? Do I need to edit the cmake to add the
-c flag when testing its programs during the build stage? If so, how do I go about that?
Thanks in advance for any help!