Skip to content
/ otp Public
forked from erlang/otp

Commit

Permalink
Make poll() test work with gcc 14
Browse files Browse the repository at this point in the history
Fixes erlang#9211

* Add headers (`stdlib.h`, `fcntl.h`) for `poll`
* Add `unistd.h` for `sbrk`
  • Loading branch information
lukebakken committed Dec 18, 2024
1 parent 1042ae2 commit c0a4870
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
3 changes: 3 additions & 0 deletions erts/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,9 @@
/* Define if x86/x86_64 out of order instructions should be synchronized */
#undef ETHR_X86_OUT_OF_ORDER

/* Define to 1 if _Float16 can be converted from/to double. */
#undef FLOAT16_IS_CONVERTIBLE

/* Define to 1 if you have the <arpa/nameser.h> header file. */
#undef HAVE_ARPA_NAMESER_H

Expand Down
36 changes: 35 additions & 1 deletion erts/configure
Original file line number Diff line number Diff line change
Expand Up @@ -19754,6 +19754,37 @@ printf "%s\n" "#define SIZEOF__FLOAT16 $ac_cv_sizeof__Float16" >>confdefs.h



cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
_Float16 x = 0.0;
int
main (void)
{

;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _Float16 convertible" >&5
printf %s "checking for _Float16 convertible... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }

printf "%s\n" "#define FLOAT16_IS_CONVERTIBLE 1" >>confdefs.h


else case e in #(
e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _Float16 convertible" >&5
printf %s "checking for _Float16 convertible... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
;;
esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext

BITS64=

if test $ac_cv_sizeof_void_p = 8; then
Expand Down Expand Up @@ -21702,6 +21733,7 @@ else case e in #(
/* end confdefs.h. */

#include <stdlib.h>
#include <unistd.h>
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
Expand Down Expand Up @@ -25891,8 +25923,10 @@ else case e in #(
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <fcntl.h>
#include <poll.h>
main()
#include <stdlib.h>
int main()
{
#ifdef _POLL_EMUL_H_
exit(1); /* Implemented using select() -- fail */
Expand Down
5 changes: 4 additions & 1 deletion erts/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdlib.h>
#include <unistd.h>
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
Expand Down Expand Up @@ -3137,8 +3138,10 @@ poll_works=no
[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <fcntl.h>
#include <poll.h>
main()
#include <stdlib.h>
int main()
{
#ifdef _POLL_EMUL_H_
exit(1); /* Implemented using select() -- fail */
Expand Down

0 comments on commit c0a4870

Please sign in to comment.