From 189d3122c7b3b1fe6899f5b906885cf2ccc3b9c2 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 2044690dc6a1..05fca7b4b245 100755 --- a/erts/configure +++ b/erts/configure @@ -20934,6 +20934,7 @@ else $as_nop /* end confdefs.h. */ #include +#include #ifdef HAVE_MALLOC_H # include #endif @@ -24889,8 +24890,10 @@ else $as_nop 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 f247c1e71f17..7b14880d4922 100644 --- a/erts/configure.ac +++ b/erts/configure.ac @@ -2456,6 +2456,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 @@ -3098,8 +3099,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 */