LLVM Discussion Forums

Running llvm test-suite on thumbv8m.main-none-eabi target

Hi! I’m trying to run llvm test-suite on thumbv8m.main-none-eabi target using qemu.

I’m really struggling even though there are some progress.
I’m wondering if I’m doing something wrong.

Current status:

  1. Configure using cmake:
cmake 
-DCMAKE_C_COMPILER="/home/shin/proj/llvm/llvm-project/build/bin/clang" \
-DTEST_SUITE_ARCH_FLAGS="-target thumbv8m.main-none-eabi --sysroot=/home/shin/proj/sp/gcc-arm-none-eabi-9-2020-q2-update/arm-none-eabi -L/home/shin/proj/sp/gcc-arm-none-eabi-9-2020-q2-update/arm-none-eabi/lib/thumb/v8-m.main/nofp -nostdlib" \
-DCMAKE_C_FLAGS="-target thumbv8m.main-none-eabi --sysroot=/home/shin/proj/sp/gcc-arm-none-eabi-9-2020-q2-update/arm-none-eabi -L/home/shin/proj/sp/gcc-arm-none-eabi-9-2020-q2-update/arm-none-eabi/lib/thumb/v8-m.main/nofp -nostdlib" \
-DTEST_SUITE_EXTRA_EXE_LINKER_FLAGS="-lc -lm /home/shin/proj/sp/gcc-arm-none-eabi-9-2020-q2-update/lib/gcc/arm-none-eabi/9.3.1/libgcc.a" \
-DTEST_SUITE_SUBDIRS="Bitcode;External;MultiSource;SingleSource" \
-DTEST_SUITE_COLLECT_COMPILE_TIME=OFF \
-DTEST_SUITE_RUN_UNDER="qemu-arm -cpu cortex-m33"  ..

MicroBenchmark folder is omitted because it requires pthreads and I couldn’t find libpthread in gcc-arm-none-eabi toolchain.

  1. make

When I type make after above, I get an error while compiling fpcmp.c because it contains operating system calls. But that doesn’t seem to be part of test-suite since its located under tools directory. I just copied the x86_64 build of the tools directory.

Now linking simd_ops_test_op_vsubw_u8_983 fails because there is no libdl


It seems like I’m getting error after error so I’m wondering there is another proper way to do this.

  • a file in BitCode fails because of libdl
  • a file in MultiSource fails because there’s no inet headers
  • a file in SingleSource fails because it has OS syscalls

Is llvm test-suite not meant for bare-metal targets?

How does llvm test code generation for those targets?