Hi, All,
We chose to use BullseyeCoverage tool to collect test coverage data for our embedded system. It works well with our traditional Makefile build system.
But with CMake, we haven’t been able to make it work. Basically I’m following the guidance here: BullseyeCoverage Help].
But when running cmake, I got this error:
[ohuang@nvm-sh-builder01 cmk_build]$ cmake ../ -DCMAKE_TOOLCHAIN_FILE=../toolchain_ccov.armclang
-- The C compiler identification is ARMClang 6.14.2
-- The ASM compiler identification is ARMClang
-- Found assembler: /tools/bullseye/BullseyeCoverage-8.21.19/bin/armclang
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /tools/bullseye/BullseyeCoverage-8.21.19/bin/armclang
-- Check for working C compiler: /tools/bullseye/BullseyeCoverage-8.21.19/bin/armclang - broken
CMake Error at /opt/cmake-3.20.0-linux-x86_64/share/cmake-3.20/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
"/tools/bullseye/BullseyeCoverage-8.21.19/bin/armclang"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/ohuang/data/git/temp/yorktown_sdk/Firmware/cmk_build/CMakeFiles/CMakeTmp
Run Build Command(s):/bin/gmake -f Makefile cmTC_07bac/fast && /bin/gmake -f CMakeFiles/cmTC_07bac.dir/build.make CMakeFiles/cmTC_07bac.dir/build
gmake[1]: Entering directory `/mnt/lv_data/ohuang/git/temp/yorktown_sdk/Firmware/cmk_build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_07bac.dir/testCCompiler.o
/tools/bullseye/BullseyeCoverage-8.21.19/bin/armclang --target=aarch64-arm-none-eabi -mcpu=cortex-a53 -march=armv8-a+nofp+nosimd -mno-unaligned-access -Wno-int-to-pointer-cast -o CMakeFiles/cmTC_07bac.dir/testCCompiler.o -c /home/ohuang/data/git/temp/yorktown_sdk/Firmware/cmk_build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_07bac.elf
/opt/cmake-3.20.0-linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/cmTC_07bac.dir/link.txt --verbose=1
/tools/bullseye/BullseyeCoverage-8.21.19/bin/armlink CMakeFiles/cmTC_07bac.dir/testCCompiler.o -o cmTC_07bac.elf --list=cmTC_07bac.map
BullseyeCoverage Compile 8.21.19 Linux-x64 License 30210
Copyright (c) Bullseye Testing Technology
BullseyeCoverage error: Instrument a source file before linking
gmake[1]: *** [cmTC_07bac.elf] Error 1
gmake[1]: Leaving directory `/mnt/lv_data/ohuang/git/temp/yorktown_sdk/Firmware/cmk_build/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_07bac/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:39 (project)
-- Configuring incomplete, errors occurred!
See also "/home/ohuang/data/git/temp/yorktown_sdk/Firmware/cmk_build/CMakeFiles/CMakeOutput.log".
See also "/home/ohuang/data/git/temp/yorktown_sdk/Firmware/cmk_build/CMakeFiles/CMakeError.log".
And my toolchain file is like this:
LIST(PREPEND CMAKE_PROGRAM_PATH /tools/bullseye/BullseyeCoverage-8.21.3/bin;/tools/arm/developmentstudio-2020.0/sw/ARMCompiler6.14/bin/armclang)
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_C_COMPILER armclang)
set(CMAKE_CXX_COMPILER armclang)
set(CMAKE_ASM_COMPILER armclang)
set(CMAKE_C_COMPILER_TARGET aarch64-arm-none-eabi)
set(CMAKE_ASM_COMPILER_TARGET aarch64-arm-none-eabi)
set(CMAKE_CXX_COMPILER_TARGET aarch64-arm-none-eabi)
set(CMAKE_SYSTEM_PROCESSOR cortex-a53)
set(CMAKE_CROSSCOMPILING true)
add_compile_options(-march=armv8-a+nofp+nosimd -mno-unaligned-access -Wno-int-to-pointer-cast)
set(CMAKE_C_FLAGS_DEBUG_INIT "") #For standard config DEBUG, cmake adds -g automatically
set(CMAKE_C_FLAGS_RELEASE_INIT "-g") # for standard config REELEASE, cmake adds -O3 -DNDEBUG automatically
set(CMAKE_CXX_FLAGS_DEBUG_INIT "${CMAKE_C_FLAGS_DEBUG_INIT}")
set(CMAKE_CXX_FLAGS_RELEASE_INIT "${CMAKE_C_FLAGS_RELEASE_INIT}")
Could anybody offer help? Thanks.
-Oscar