Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output: Change Dir: /home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/make cmTC_c5a55/fast && make[1]: Entering directory `/home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp' /usr/bin/make -f CMakeFiles/cmTC_c5a55.dir/build.make CMakeFiles/cmTC_c5a55.dir/build make[2]: Entering directory `/home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_c5a55.dir/src.c.o /home/buildroot/autobuild/run/instance-2/output-1/host/bin/mips64el-linux-gcc --sysroot=/home/buildroot/autobuild/run/instance-2/output-1/host/mips64el-buildroot-linux-gnu/sysroot -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g2 -D_FORTIFY_SOURCE=1 -DCMAKE_HAVE_LIBC_PTHREAD -DNDEBUG -o CMakeFiles/cmTC_c5a55.dir/src.c.o -c /home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp/src.c Linking C executable cmTC_c5a55 /home/buildroot/autobuild/run/instance-2/output-1/host/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c5a55.dir/link.txt --verbose=1 /home/buildroot/autobuild/run/instance-2/output-1/host/bin/mips64el-linux-gcc --sysroot=/home/buildroot/autobuild/run/instance-2/output-1/host/mips64el-buildroot-linux-gnu/sysroot -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g2 -D_FORTIFY_SOURCE=1 -DCMAKE_HAVE_LIBC_PTHREAD -DNDEBUG CMakeFiles/cmTC_c5a55.dir/src.c.o -o cmTC_c5a55 /home/buildroot/autobuild/run/instance-2/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-gnu/9.3.0/../../../../mips64el-buildroot-linux-gnu/bin/ld: CMakeFiles/cmTC_c5a55.dir/src.c.o: in function `main': /home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp/src.c:11: undefined reference to `pthread_create' /home/buildroot/autobuild/run/instance-2/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-gnu/9.3.0/../../../../mips64el-buildroot-linux-gnu/bin/ld: /home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp/src.c:11: undefined reference to `pthread_create' /home/buildroot/autobuild/run/instance-2/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-gnu/9.3.0/../../../../mips64el-buildroot-linux-gnu/bin/ld: /home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp/src.c:12: undefined reference to `pthread_detach' /home/buildroot/autobuild/run/instance-2/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-gnu/9.3.0/../../../../mips64el-buildroot-linux-gnu/bin/ld: /home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp/src.c:12: undefined reference to `pthread_detach' /home/buildroot/autobuild/run/instance-2/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-gnu/9.3.0/../../../../mips64el-buildroot-linux-gnu/bin/ld: /home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp/src.c:13: undefined reference to `pthread_cancel' /home/buildroot/autobuild/run/instance-2/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-gnu/9.3.0/../../../../mips64el-buildroot-linux-gnu/bin/ld: /home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp/src.c:13: undefined reference to `pthread_cancel' /home/buildroot/autobuild/run/instance-2/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-gnu/9.3.0/../../../../mips64el-buildroot-linux-gnu/bin/ld: /home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp/src.c:14: undefined reference to `pthread_join' /home/buildroot/autobuild/run/instance-2/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-gnu/9.3.0/../../../../mips64el-buildroot-linux-gnu/bin/ld: /home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp/src.c:14: undefined reference to `pthread_join' collect2: error: ld returned 1 exit status make[2]: *** [cmTC_c5a55] Error 1 make[2]: Leaving directory `/home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp' make[1]: *** [cmTC_c5a55/fast] Error 2 make[1]: Leaving directory `/home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp' Source file was: #include void* test_func(void* data) { return data; } int main(void) { pthread_t thread; pthread_create(&thread, NULL, test_func, NULL); pthread_detach(thread); pthread_cancel(thread); pthread_join(thread, NULL); pthread_atfork(NULL, NULL, NULL); pthread_exit(NULL); return 0; } Determining if the function pthread_create exists in the pthreads failed with the following output: Change Dir: /home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/make cmTC_4ed02/fast && make[1]: Entering directory `/home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp' /usr/bin/make -f CMakeFiles/cmTC_4ed02.dir/build.make CMakeFiles/cmTC_4ed02.dir/build make[2]: Entering directory `/home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_4ed02.dir/CheckFunctionExists.c.o /home/buildroot/autobuild/run/instance-2/output-1/host/bin/mips64el-linux-gcc --sysroot=/home/buildroot/autobuild/run/instance-2/output-1/host/mips64el-buildroot-linux-gnu/sysroot -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g2 -D_FORTIFY_SOURCE=1 -DCHECK_FUNCTION_EXISTS=pthread_create -DNDEBUG -o CMakeFiles/cmTC_4ed02.dir/CheckFunctionExists.c.o -c /home/buildroot/autobuild/run/instance-2/output-1/host/share/cmake-3.18/Modules/CheckFunctionExists.c Linking C executable cmTC_4ed02 /home/buildroot/autobuild/run/instance-2/output-1/host/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4ed02.dir/link.txt --verbose=1 /home/buildroot/autobuild/run/instance-2/output-1/host/bin/mips64el-linux-gcc --sysroot=/home/buildroot/autobuild/run/instance-2/output-1/host/mips64el-buildroot-linux-gnu/sysroot -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g2 -D_FORTIFY_SOURCE=1 -DCHECK_FUNCTION_EXISTS=pthread_create -DNDEBUG CMakeFiles/cmTC_4ed02.dir/CheckFunctionExists.c.o -o cmTC_4ed02 -lpthreads /home/buildroot/autobuild/run/instance-2/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-gnu/9.3.0/../../../../mips64el-buildroot-linux-gnu/bin/ld: cannot find -lpthreads collect2: error: ld returned 1 exit status make[2]: *** [cmTC_4ed02] Error 1 make[2]: Leaving directory `/home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp' make[1]: *** [cmTC_4ed02/fast] Error 2 make[1]: Leaving directory `/home/buildroot/autobuild/run/instance-2/output-1/build/optee-client-3.17.0/CMakeFiles/CMakeTmp'