Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output: Change Dir: /tmp/instance-0/output-1/build/pistache-73f248acd6db4c53e6604577b7e13fd5e756f96f/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/make cmTC_afd18/fast && make[1]: Entering directory '/tmp/instance-0/output-1/build/pistache-73f248acd6db4c53e6604577b7e13fd5e756f96f/CMakeFiles/CMakeTmp' /usr/bin/make -f CMakeFiles/cmTC_afd18.dir/build.make CMakeFiles/cmTC_afd18.dir/build make[2]: Entering directory '/tmp/instance-0/output-1/build/pistache-73f248acd6db4c53e6604577b7e13fd5e756f96f/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_afd18.dir/src.c.o /tmp/instance-0/output-1/host/bin/nios2-linux-gcc --sysroot=/tmp/instance-0/output-1/host/nios2-buildroot-linux-gnu/sysroot -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g2 -D_FORTIFY_SOURCE=2 -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_afd18.dir/src.c.o -c /tmp/instance-0/output-1/build/pistache-73f248acd6db4c53e6604577b7e13fd5e756f96f/CMakeFiles/CMakeTmp/src.c Linking C executable cmTC_afd18 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_afd18.dir/link.txt --verbose=1 /tmp/instance-0/output-1/host/bin/nios2-linux-gcc --sysroot=/tmp/instance-0/output-1/host/nios2-buildroot-linux-gnu/sysroot -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g2 -D_FORTIFY_SOURCE=2 -DCMAKE_HAVE_LIBC_PTHREAD CMakeFiles/cmTC_afd18.dir/src.c.o -o cmTC_afd18 /tmp/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/nios2-buildroot-linux-gnu/8.3.0/../../../../nios2-buildroot-linux-gnu/bin/ld: CMakeFiles/cmTC_afd18.dir/src.c.o: in function `main': /tmp/instance-0/output-1/build/pistache-73f248acd6db4c53e6604577b7e13fd5e756f96f/CMakeFiles/CMakeTmp/src.c:11: undefined reference to `pthread_create' /tmp/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/nios2-buildroot-linux-gnu/8.3.0/../../../../nios2-buildroot-linux-gnu/bin/ld: /tmp/instance-0/output-1/build/pistache-73f248acd6db4c53e6604577b7e13fd5e756f96f/CMakeFiles/CMakeTmp/src.c:12: undefined reference to `pthread_detach' /tmp/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/nios2-buildroot-linux-gnu/8.3.0/../../../../nios2-buildroot-linux-gnu/bin/ld: /tmp/instance-0/output-1/build/pistache-73f248acd6db4c53e6604577b7e13fd5e756f96f/CMakeFiles/CMakeTmp/src.c:13: undefined reference to `pthread_join' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/cmTC_afd18.dir/build.make:87: cmTC_afd18] Error 1 make[2]: Leaving directory '/tmp/instance-0/output-1/build/pistache-73f248acd6db4c53e6604577b7e13fd5e756f96f/CMakeFiles/CMakeTmp' make[1]: *** [Makefile:121: cmTC_afd18/fast] Error 2 make[1]: Leaving directory '/tmp/instance-0/output-1/build/pistache-73f248acd6db4c53e6604577b7e13fd5e756f96f/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_join(thread, NULL); pthread_atfork(NULL, NULL, NULL); pthread_exit(NULL); return 0; }