Thanks for reporting. In theory this is covered. If you look at pl-thread.c you’ll see there are three variants for pthread_setname_np(). The CMake code in cmake/Config.cmake first checks the function exists and then tries to compile fragments using the -Werror flag to find out which of the three versions applies.
Apparently something goes wrong. Could you figure out what? E.g., check the settings using grep HAVE_PTHREAD_SETNAME CMakeCache.txt and if these are incorrect try to figure out what happens in cmake/Config.h?
Sincere apologies for the noise, entirely my fault. I had inadvertently included -fno-math-errno in the CFLAGS, a left over from earlier work. (Using multiple dev machines and a holiday are not conducive to sound engineering )
It is interesting that gcc12 did not fail with this flag but clang13 did.
FYI, as requested:
Thanks for the feedback. I wonder whether using CheckPrototypeDefinition would have had this right anyway. Seems a bit involved in getting all the includes and defines right though Bit of a pity they managed to get three difference signatures for this nice but not vital feature. Setting the thread name makes debugging under GDB a bit nicer.
If someone likes making a PR using CheckPrototypeDefinition() …