Official docs:
Some headers from C library were deprecated in C++ and are no longer
welcome in C++ codebases. Some have no effect in C++. For more details
refer to the C++ 14 Standard [depr.c.headers] section. This check
replaces C standard library headers with their C++ alternatives and
removes redundant ones.
Right now it fails with:
ld.lld: error: undefined symbol: __pthread_mutex_lock
>>> referenced by ThreadFuzzer.cpp:300 (./src/Common/ThreadFuzzer.cpp:300)
>>> src/CMakeFiles/clickhouse_common_io.dir/Common/ThreadFuzzer.cpp.o:(pthread_mutex_lock)
>>> did you mean: __pthread_mutex_lock@GLIBC_2.2.5
>>> defined in: /usr/lib/libc.so.6
Here is the list of matched symbols for 2.35:
$ nm -D /lib/libc.so.6 | fgrep pthread_mutex_lock
00000000000908a0 T __pthread_mutex_lock@GLIBC_2.2.5
00000000000908a0 T pthread_mutex_lock@@GLIBC_2.2.5
$ nm -D /lib/libpthread.so.0 | fgrep -c pthread_mutex_lock
0
And this is for 2.33:
$ nm -D /lib/x86_64-linux-gnu/libc.so.6 | fgrep pthread_mutex_lock
0000000000083eb0 T pthread_mutex_lock@@GLIBC_2.2.5
$ nm -D /lib/x86_64-linux-gnu/libpthread.so.0 | fgrep pthread_mutex_lock
000000000000af00 T __pthread_mutex_lock@@GLIBC_2.2.5
000000000000af00 W pthread_mutex_lock@@GLIBC_2.2.5
Because "likely" starting from 27a448223cb2d3bab191c61303db48cee66f871c
("nptl: Move core mutex functions into libc") [1], __pthread_mutex_lock
is not exported anymore.
[1]: https://sourceware.org/git/?p=glibc.git;a=commit;h=27a448223cb2d3bab191c61303db48cee66f871c
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>