AX_PTHREAD requiring _REETRANT that clang's scan-build doesn't define
Antonin Décimo <[email protected]> Wed, 31 May 2023 16:16:07 +0200
| Newsgroups | gmane.comp.sysutils.autoconf.archive-maintainers |
|---|---|
| Message-ID | <CACCWBSDP9tAkHRPo=CiLEVZ_qfMi=6Fs0eWMp2Yf8u3WhbgEgA@mail.gmail.com> |
Dear autoconf-archive-maintainers, dear Mr. Stevens,
I hope this is the best way of reporting problems with AX_PTHREAD. If
not, please let me know.
AX_PTHREAD is erroring if the macro _REENTRANT isn't defined. That
macro is now deprecated, although I can't find information on when it
was deprecated exactly, and on which platforms apart from glibc.
My problem is that clang's scan-build [1] doesn't define this macro,
even when all sorts of -pthreads flags are given to it. Apparently,
stock clang does define this macro. The issue has also been raised to
LLVM's bug tracker, but has not been picked up.
https://github.com/llvm/llvm-project/issues/53552
It seems that this macro isn't required anymore to get reentrant
functions from the system. I suggest AX_PTHREAD be changed not to
require this macro. Maybe checking if a program using pthreads works
is enough?
This problem has been reported on stackoverflow already:
https://stackoverflow.com/questions/70973862/clang-analyzer-scan-build-configure-fails-looking-for-pthread-support-reen
If you want to reproduce this error, from a Debian (derivative),
here's an example using the ocaml compiler:
# apt-get install build-essential clang-tools git
$ git clone --depth=1 https://github.com/ocaml/ocaml.git && cd ocaml
$ scan-build ./configure
[1]: https://clang-analyzer.llvm.org/
Thank you,
-- Antonin