Help building custom package with CMake

Hello,

i wanna build some benchmarks for my openwrt device and it always fails at the same place...

Here is the package which i created and want to build:

Here the source code of my collection of malloc benchmarks:

Here is the "Configure" part with CMake (noting special):

...
-- The CXX compiler identification is GNU 8.3.0
-- The C compiler identification is GNU 8.3.0
-- Check for working CXX compiler: /home/johann/dev/openwrt/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.3.0_musl/bin/aarch64-openwrt-linux-musl-g++
-- Check for working CXX compiler: /home/johann/dev/openwrt/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.3.0_musl/bin/aarch64-openwrt-linux-musl-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /home/johann/dev/openwrt/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.3.0_musl/bin/aarch64-openwrt-linux-musl-gcc
-- Check for working C compiler: /home/johann/dev/openwrt/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.3.0_musl/bin/aarch64-openwrt-linux-musl-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_ASM_COMPILER
    CMAKE_ASM_COMPILER_ARG1
    CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
    CMAKE_MODULE_LINKER_FLAGS
    CMAKE_SHARED_LINKER_FLAGS
    DL_LIBRARY


-- Build files have been written to: /home/johann/dev/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/malloc-benchmarks-1.0
...

And here the part which fails:

...
make[5]: Entering directory '/home/johann/dev/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/malloc-benchmarks-1.0'
[  1%] Building C object CMakeFiles/xmalloc-test.dir/xmalloc-test/xmalloc-test.c.o
/home/johann/dev/openwrt/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.3.0_musl/bin/aarch64-openwrt-linux-musl-gcc   -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/home/johann/dev/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/malloc-benchmarks-1.0=malloc-benchmarks-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro; -w  -DNDEBUG   -o CMakeFiles/xmalloc-test.dir/xmalloc-test/xmalloc-test.c.o   -c /home/johann/dev/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/malloc-benchmarks-1.0/xmalloc-test/xmalloc-test.c
/home/johann/dev/openwrt/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.3.0_musl/lib/gcc/aarch64-openwrt-linux-musl/8.3.0/../../../../aarch64-openwrt-linux-musl/bin/ld: /home/johann/dev/openwrt/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.3.0_musl/lib/gcc/aarch64-openwrt-linux-musl/8.3.0/../../../../aarch64-openwrt-linux-musl/lib/crt1.o: in function `_start_c':
/home/johann/dev/openwrt/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-8.3.0_musl/musl-1.1.24/crt/crt1.c:18: undefined reference to `main'
/home/johann/dev/openwrt/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.3.0_musl/lib/gcc/aarch64-openwrt-linux-musl/8.3.0/../../../../aarch64-openwrt-linux-musl/bin/ld: /home/johann/dev/openwrt/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-8.3.0_musl/musl-1.1.24/crt/crt1.c:18: undefined reference to `main'
collect2: error: ld returned 1 exit status
...

I do not understand why there is no main function found.
If i disable the build for this benchmark, then the next benchmark fails also on missing reference to main.

Has anyone a clue why this happens?

Were you able to get to the bottom of this? @juppin

I am getting the same error on a custom built package.

No, as i used many other benchmarks too i left this one out for benchmarking malloc on OpenWrt.

Sorry.