From e2604aa7a92b3bb7c1293afd12705c7ce9c952a4 Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Tue, 17 Dec 2024 10:28:19 -0800 Subject: [PATCH] Make `poll()` test work with `gcc` 14 Fixes erlang/otp#9211 * Add headers (`stdlib.h`, `fcntl.h`) for `poll` * Add `unistd.h` for `sbrk` --- erts/configure | 5 ++++- erts/configure.ac | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/erts/configure b/erts/configure index 75c93bd7ea5f..a4d5df1cb867 100755 --- a/erts/configure +++ b/erts/configure @@ -21733,6 +21733,7 @@ else case e in #( /* end confdefs.h. */ #include +#include #ifdef HAVE_MALLOC_H # include #endif @@ -25922,8 +25923,10 @@ else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include #include -main() +#include +int main() { #ifdef _POLL_EMUL_H_ exit(1); /* Implemented using select() -- fail */ diff --git a/erts/configure.ac b/erts/configure.ac index f551d5ad35ee..4a05fadaa1da 100644 --- a/erts/configure.ac +++ b/erts/configure.ac @@ -2443,6 +2443,7 @@ AC_CACHE_CHECK([if __after_morecore_hook can track malloc()s core memory use], erts_cv___after_morecore_hook_can_track_malloc, [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include +#include #ifdef HAVE_MALLOC_H # include #endif @@ -3137,8 +3138,10 @@ poll_works=no [ AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include #include -main() +#include +int main() { #ifdef _POLL_EMUL_H_ exit(1); /* Implemented using select() -- fail */