Skip to content

zend build making sigjmp_buf and api check as mandatory. #14942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Zend/Zend.m4
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,14 @@ AC_CHECK_FUNCS(m4_normalize([
pthread_stackseg_np
]))

dnl Check for sigsetjmp. If it's defined as a macro, AC_CHECK_FUNCS won't work.
AC_CHECK_FUNCS([sigsetjmp],,
[AC_CHECK_DECL([sigsetjmp],
[AC_DEFINE([HAVE_SIGSETJMP], [1])],,
[#include <setjmp.h>])])
dnl
dnl Check for sigsetjmp. If sigsetjmp is defined as a macro, use AC_CHECK_DECL
dnl as a fallback since AC_CHECK_FUNC cannot detect macros.
dnl
AC_CHECK_FUNC([sigsetjmp],,
[AC_CHECK_DECL([sigsetjmp],,
[AC_MSG_ERROR([Required sigsetjmp not found. Please, check config.log])],
[#include <setjmp.h>])])

ZEND_CHECK_STACK_DIRECTION
ZEND_CHECK_FLOAT_PRECISION
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_portability.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ char *alloca();
# define XtOffsetOf(s_type, field) offsetof(s_type, field)
#endif

#ifdef HAVE_SIGSETJMP
#ifndef ZEND_WIN32
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we keep the autoconf check, we may keep the #ifdef HAVE_SIGSETJMP here too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that s the thing, with this PR this constant is no longer defined as it is implicitly required on unix.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the autoconf check still useful?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say yes, so it s detected at configure time rather than build's e.g. if a linux/dietlibc user.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, I missed that you replaced AC_DEFINE with AC_MSG_ERROR. Makes sense now

# define SETJMP(a) sigsetjmp(a, 0)
# define LONGJMP(a,b) siglongjmp(a, b)
# define JMP_BUF sigjmp_buf
Expand Down
Loading