Skip to content

Commit b7d7c94

Browse files
committed
Make poll() test work with gcc 14
Fixes #9211 * Add headers (`stdlib.h`, `fcntl.h`) for `poll` * Add `unistd.h` for `sbrk`
1 parent e7f8ffd commit b7d7c94

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

erts/config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,9 @@
438438
/* Define if x86/x86_64 out of order instructions should be synchronized */
439439
#undef ETHR_X86_OUT_OF_ORDER
440440

441+
/* Define to 1 if _Float16 can be converted from/to double. */
442+
#undef FLOAT16_IS_CONVERTIBLE
443+
441444
/* Define to 1 if you have the <arpa/nameser.h> header file. */
442445
#undef HAVE_ARPA_NAMESER_H
443446

erts/configure

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19754,6 +19754,37 @@ printf "%s\n" "#define SIZEOF__FLOAT16 $ac_cv_sizeof__Float16" >>confdefs.h
1975419754

1975519755

1975619756

19757+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19758+
/* end confdefs.h. */
19759+
_Float16 x = 0.0;
19760+
int
19761+
main (void)
19762+
{
19763+
19764+
;
19765+
return 0;
19766+
}
19767+
_ACEOF
19768+
if ac_fn_c_try_compile "$LINENO"
19769+
then :
19770+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _Float16 convertible" >&5
19771+
printf %s "checking for _Float16 convertible... " >&6; }
19772+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
19773+
printf "%s\n" "yes" >&6; }
19774+
19775+
printf "%s\n" "#define FLOAT16_IS_CONVERTIBLE 1" >>confdefs.h
19776+
19777+
19778+
else case e in #(
19779+
e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _Float16 convertible" >&5
19780+
printf %s "checking for _Float16 convertible... " >&6; }
19781+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
19782+
printf "%s\n" "no" >&6; }
19783+
;;
19784+
esac
19785+
fi
19786+
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
19787+
1975719788
BITS64=
1975819789

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

2170421735
#include <stdlib.h>
21736+
#include <unistd.h>
2170521737
#ifdef HAVE_MALLOC_H
2170621738
# include <malloc.h>
2170721739
#endif
@@ -25891,8 +25923,10 @@ else case e in #(
2589125923
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2589225924
/* end confdefs.h. */
2589325925

25926+
#include <fcntl.h>
2589425927
#include <poll.h>
25895-
main()
25928+
#include <stdlib.h>
25929+
int main()
2589625930
{
2589725931
#ifdef _POLL_EMUL_H_
2589825932
exit(1); /* Implemented using select() -- fail */

erts/configure.ac

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2443,6 +2443,7 @@ AC_CACHE_CHECK([if __after_morecore_hook can track malloc()s core memory use],
24432443
erts_cv___after_morecore_hook_can_track_malloc,
24442444
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
24452445
#include <stdlib.h>
2446+
#include <unistd.h>
24462447
#ifdef HAVE_MALLOC_H
24472448
# include <malloc.h>
24482449
#endif
@@ -3137,8 +3138,10 @@ poll_works=no
31373138
[
31383139
31393140
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3141+
#include <fcntl.h>
31403142
#include <poll.h>
3141-
main()
3143+
#include <stdlib.h>
3144+
int main()
31423145
{
31433146
#ifdef _POLL_EMUL_H_
31443147
exit(1); /* Implemented using select() -- fail */

0 commit comments

Comments
 (0)