-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Conversation
note that it has the "side effect" to enable it also for platforms which implement those as macro (e.g. linux/glibc). |
If this is a required function/macro, wouldn't then this be sufficient? AC_CHECK_FUNC([sigsetjmp],,
[AC_CHECK_DECL([sigsetjmp],,
[AC_MSG_ERROR([sigsetjmp check failed. Please, check config.log])],
[#include <setjmp.h>])]) |
Unfortunately not really it seems, because it detects only when sigsetjmp is a real function but on linux/glibc it s a macro. |
The AC_CHECK_DECL checks if there is macro defined in setjmp.h. It doesn't detect it? |
I did make distclean and ./buildconf -f after applying your patch. configure:78927: result: no
configure:78935: checking for sigsetjmp
configure:78935: cc -o conftest -g -O2 -ffp-contract=off -fvisibility=hidden -D_GNU_SOURCE conftest.c >&5
/usr/bin/ld: /tmp/ccb7B2ZG.o: in function `main':
/home/dcarlier/Contribs/php-src/conftest.c:319:(.text.startup+0xb): undefined reference to `sigsetjmp'
collect2: error: ld returned 1 exit status |
Yes, this one checks if linker sees a function sigsetjmp. And the next check is for declaraction or macro check "checking whether sigsetjmp is declared". |
what do you make of it ?
even tough it should work since it does not rely anymore on HAVE_SIGSETJMP |
This first it checks if linker sees a function. Some systems probably had it as a function. And if function is not found, it checks for declaration or macro. If macro is still not found, then error is thrown above. Otherwise it just passes the checks without defining the HAVE_SIGSETJMP. |
Ok I ll apply your simpler solution then, thx |
f665b25
to
9d2b35d
Compare
Zend/Zend.m4
Outdated
dnl | ||
dnl ZEND_CHECK_SIGSETJMP | ||
dnl | ||
dnl Check for sigsetjmp. | ||
dnl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dnl | |
dnl ZEND_CHECK_SIGSETJMP | |
dnl | |
dnl Check for sigsetjmp. | |
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. |
Zend/Zend.m4
Outdated
dnl | ||
AC_CHECK_FUNC([sigsetjmp],, | ||
[AC_CHECK_DECL([sigsetjmp],, | ||
[AC_MSG_ERROR([sigsetjmp check failed. Please, check config.log])], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[AC_MSG_ERROR([sigsetjmp check failed. Please, check config.log])], | |
[AC_MSG_ERROR([Required sigsetjmp not found. Please, check config.log.])], |
I've only quickly glanced over platforms a bit and it really seems that POSIX sigsetjmp is present on all current *nix platforms out there. Otherwise from the entirety point of view (Windows included) checking for this function/macro might still make sense. For example, if Autotools build system is one day still used and adjusted also for Windows or if Msys2/Mingw is used for the build sigsetjmp might not be there. |
9d2b35d
to
c4a60c6
Compare
Zend/Zend.m4
Outdated
[AC_DEFINE([HAVE_SIGSETJMP], [1])],, | ||
[#include <setjmp.h>])]) | ||
dnl | ||
dnl ZEND_CHECK_SIGSETJMP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that you are not actually defining a ZEND_CHECK_SIGSETJMP
macro here
#ifdef HAVE_SIGSETJMP | ||
#ifndef ZEND_WIN32 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
all unixes support it since long time, the few which don't do not meet the requirements to build php anyway (minix, dietlibc, ...).
c4a60c6
to
2f64954
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This adds notice in the UPGRADING.INTERNALS file and removes redundant undefinition from Windows config header. Follow-up of GH-14942.
all unixes support it since long time, the few which don't do not meet the requirements to build php anyway (minix, dietlibc, ...).