From 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf Mon Sep 17 00:00:00 2001 From: takeshi_hoshina Date: Mon, 2 Nov 2020 11:07:33 +0900 Subject: basesystem-jj recipes --- .../php/php/0001-Add-lpthread-to-link.patch | 38 - .../0001-PHP-5.6-LibSSL-1.1-compatibility.patch | 1285 -------------------- ...cinclude-use-pkgconfig-for-libxml2-config.patch | 90 -- ...-acinclude.m4-don-t-unset-cache-variables.patch | 39 - ...nclude.m4-skip-binconfig-check-for-libxml.patch | 56 - ...nfigure.ac-don-t-include-build-libtool.m4.patch | 30 + ...aused-by-a-new-variable-is-declared-after.patch | 45 - ...i.c-build-empty-php_load_zend_extension_c.patch | 63 - .../0001-opcache-config.m4-enable-opcache.patch | 246 +--- ...01-php-don-t-use-broken-wrapper-for-mkdir.patch | 11 +- .../0001-php.m4-don-t-unset-cache-variables.patch | 39 + .../recipes-devtools/php/php/70_mod_php5.conf | 12 - .../recipes-devtools/php/php/CVE-2017-9120.patch | 21 - .../php/php/acinclude-xml2-config.patch | 25 - .../php/php/change-AC_TRY_RUN-to-AC_TRY_LINK.patch | 61 - .../php/php/debian-php-fixheader.patch | 31 + .../meta-oe/recipes-devtools/php/php/iconv.patch | 36 +- .../php/php/imap-fix-autofoo.patch | 36 +- .../recipes-devtools/php/php/phar-makefile.patch | 18 +- .../recipes-devtools/php/php/php-fpm-apache.conf | 4 +- ...hp5-0001-opcache-config.m4-enable-opcache.patch | 387 ------ .../php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch | 63 - .../php/php/php5-pear-makefile.patch | 26 - .../php/php/php5-phar-makefile.patch | 46 - .../recipes-devtools/php/php/php_exec_native.patch | 20 +- .../php/php/pthread-check-threads-m4.patch | 30 - .../php/php/xfail_two_bug_tests.patch | 34 + 27 files changed, 248 insertions(+), 2544 deletions(-) delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-Add-lpthread-to-link.patch delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-PHP-5.6-LibSSL-1.1-compatibility.patch delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude-use-pkgconfig-for-libxml2-config.patch delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude.m4-don-t-unset-cache-variables.patch delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude.m4-skip-binconfig-check-for-libxml.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-configure.ac-don-t-include-build-libtool.m4.patch delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-fix-error-caused-by-a-new-variable-is-declared-after.patch delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-main-php_ini.c-build-empty-php_load_zend_extension_c.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-php.m4-don-t-unset-cache-variables.patch delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/70_mod_php5.conf delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/CVE-2017-9120.patch delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/acinclude-xml2-config.patch delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/change-AC_TRY_RUN-to-AC_TRY_LINK.patch create mode 100755 external/meta-openembedded/meta-oe/recipes-devtools/php/php/debian-php-fixheader.patch delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-0001-opcache-config.m4-enable-opcache.patch delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-pear-makefile.patch delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-phar-makefile.patch delete mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/pthread-check-threads-m4.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/php/php/xfail_two_bug_tests.patch (limited to 'external/meta-openembedded/meta-oe/recipes-devtools/php/php') diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-Add-lpthread-to-link.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-Add-lpthread-to-link.patch deleted file mode 100644 index f70e550f..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-Add-lpthread-to-link.patch +++ /dev/null @@ -1,38 +0,0 @@ -From ed0a954983d50267c2fc0bc13aba929ea0cad971 Mon Sep 17 00:00:00 2001 -From: Dengke Du -Date: Tue, 2 May 2017 06:34:40 +0000 -Subject: [PATCH] Add -lpthread to link - -When building the php-5.6.26, the following errors occured: - - ld: TSRM/.libs/TSRM.o: undefined reference to symbol - 'pthread_sigmask@@GLIBC_2.2.5' - - error adding symbols: DSO missing from command line - -This is because no pthread to link, so we should add it. - -Upstream-Status: Pending - -Signed-off-by: Dengke Du ---- - configure.in | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/configure.in b/configure.in -index a467dff1..9afef652 100644 ---- a/configure.in -+++ b/configure.in -@@ -1058,7 +1058,8 @@ case $php_sapi_module in - ;; - esac - --EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS" -+PTHREAD_LIBS="-lpthread" -+EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS $PTHREAD_LIBS" - - dnl this has to be here to prevent the openssl crypt() from - dnl overriding the system provided crypt(). --- -2.11.0 - diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-PHP-5.6-LibSSL-1.1-compatibility.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-PHP-5.6-LibSSL-1.1-compatibility.patch deleted file mode 100644 index ac8365b8..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-PHP-5.6-LibSSL-1.1-compatibility.patch +++ /dev/null @@ -1,1285 +0,0 @@ -Subject: [PATCH] PHP 5.6 - LibSSL 1.1 compatibility - -This patch does not try to backport the 7.1 openssl module, it is the -improved version of the 5.6 original openssl module. - -https://github.com/oerdnj/deb.sury.org/issues/566 -http://zettasystem.com/PHP-5.6.31-OpenSSL-1.1.0-compatibility-20170801.patch - -Upstream-Status: Deny [https://github.com/php/php-src/pull/2667] -Reason: As PHP 5.6 is no longer actively supported only security fixes -may land on this branch. As this change does not fall in this category, -I'm closing this PR. (All higher versions of PHP already have OpenSSL -1.1 support.) - -Author: zsalab@github https://github.com/zsalab - -Only port source modification, do not include the test case -Signed-off-by: Hongxu Jia ---- - ext/openssl/openssl.c | 683 +++++++++++++++++++++++++++++++++++++------------- - ext/openssl/xp_ssl.c | 18 +- - ext/phar/util.c | 13 +- - 3 files changed, 527 insertions(+), 187 deletions(-) - -diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c -index a78a8fb..b53114c 100644 ---- a/ext/openssl/openssl.c -+++ b/ext/openssl/openssl.c -@@ -42,6 +42,12 @@ - - /* OpenSSL includes */ - #include -+#if OPENSSL_VERSION_NUMBER >= 0x10002000L -+#include -+#include -+#include -+#include -+#endif - #include - #include - #include -@@ -531,6 +537,133 @@ zend_module_entry openssl_module_entry = { - ZEND_GET_MODULE(openssl) - #endif - -+/* {{{ OpenSSL compatibility functions and macros */ -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER) -+#define EVP_PKEY_get0_RSA(_pkey) _pkey->pkey.rsa -+#define EVP_PKEY_get0_DH(_pkey) _pkey->pkey.dh -+#define EVP_PKEY_get0_DSA(_pkey) _pkey->pkey.dsa -+#define EVP_PKEY_get0_EC_KEY(_pkey) _pkey->pkey.ec -+ -+static int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) -+{ -+ r->n = n; -+ r->e = e; -+ r->d = d; -+ -+ return 1; -+} -+ -+static int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q) -+{ -+ r->p = p; -+ r->q = q; -+ -+ return 1; -+} -+ -+static int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp) -+{ -+ r->dmp1 = dmp1; -+ r->dmq1 = dmq1; -+ r->iqmp = iqmp; -+ -+ return 1; -+} -+ -+static void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) -+{ -+ *n = r->n; -+ *e = r->e; -+ *d = r->d; -+} -+ -+static void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q) -+{ -+ *p = r->p; -+ *q = r->q; -+} -+ -+static void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, const BIGNUM **iqmp) -+{ -+ *dmp1 = r->dmp1; -+ *dmq1 = r->dmq1; -+ *iqmp = r->iqmp; -+} -+ -+static void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) -+{ -+ *p = dh->p; -+ *q = dh->q; -+ *g = dh->g; -+} -+ -+static int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) -+{ -+ dh->p = p; -+ dh->q = q; -+ dh->g = g; -+ -+ return 1; -+} -+ -+static void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) -+{ -+ *pub_key = dh->pub_key; -+ *priv_key = dh->priv_key; -+} -+ -+static int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) -+{ -+ dh->pub_key = pub_key; -+ dh->priv_key = priv_key; -+ -+ return 1; -+} -+ -+static void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) -+{ -+ *p = d->p; -+ *q = d->q; -+ *g = d->g; -+} -+ -+int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g) -+{ -+ d->p = p; -+ d->q = q; -+ d->g = g; -+ -+ return 1; -+} -+ -+static void DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) -+{ -+ *pub_key = d->pub_key; -+ *priv_key = d->priv_key; -+} -+ -+int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) -+{ -+ d->pub_key = pub_key; -+ d->priv_key = priv_key; -+ -+ return 1; -+} -+ -+#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined (LIBRESSL_VERSION_NUMBER) -+#define EVP_PKEY_id(_pkey) _pkey->type -+#define EVP_PKEY_base_id(_key) EVP_PKEY_type(_key->type) -+ -+static int X509_get_signature_nid(const X509 *x) -+{ -+ return OBJ_obj2nid(x->sig_alg->algorithm); -+} -+ -+#endif -+ -+#endif -+/* }}} */ -+ - static int le_key; - static int le_x509; - static int le_csr; -@@ -825,7 +958,7 @@ static int add_oid_section(struct php_x509_request * req TSRMLS_DC) /* {{{ */ - } - for (i = 0; i < sk_CONF_VALUE_num(sktmp); i++) { - cnf = sk_CONF_VALUE_value(sktmp, i); -- if (OBJ_create(cnf->value, cnf->name, cnf->name) == NID_undef) { -+ if (OBJ_sn2nid(cnf->name) == NID_undef && OBJ_ln2nid(cnf->name) == NID_undef && OBJ_create(cnf->value, cnf->name, cnf->name) == NID_undef) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "problem creating object %s=%s", cnf->name, cnf->value); - return FAILURE; - } -@@ -967,7 +1100,7 @@ static void php_openssl_dispose_config(struct php_x509_request * req TSRMLS_DC) - } - /* }}} */ - --#ifdef PHP_WIN32 -+#if defined(PHP_WIN32) || (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)) - #define PHP_OPENSSL_RAND_ADD_TIME() ((void) 0) - #else - #define PHP_OPENSSL_RAND_ADD_TIME() php_openssl_rand_add_timeval() -@@ -1053,9 +1186,11 @@ static EVP_MD * php_openssl_get_evp_md_from_algo(long algo) { /* {{{ */ - mdtype = (EVP_MD *) EVP_md2(); - break; - #endif -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER) - case OPENSSL_ALGO_DSS1: - mdtype = (EVP_MD *) EVP_dss1(); - break; -+#endif - #if OPENSSL_VERSION_NUMBER >= 0x0090708fL - case OPENSSL_ALGO_SHA224: - mdtype = (EVP_MD *) EVP_sha224(); -@@ -1146,6 +1281,12 @@ PHP_MINIT_FUNCTION(openssl) - OpenSSL_add_all_digests(); - OpenSSL_add_all_algorithms(); - -+#if !defined(OPENSSL_NO_AES) && defined(EVP_CIPH_CCM_MODE) && OPENSSL_VERSION_NUMBER < 0x100020000 -+ EVP_add_cipher(EVP_aes_128_ccm()); -+ EVP_add_cipher(EVP_aes_192_ccm()); -+ EVP_add_cipher(EVP_aes_256_ccm()); -+#endif -+ - SSL_load_error_strings(); - - /* register a resource id number with OpenSSL so that we can map SSL -> stream structures in -@@ -1173,7 +1314,9 @@ PHP_MINIT_FUNCTION(openssl) - #ifdef HAVE_OPENSSL_MD2_H - REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT); - #endif -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER) - REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT); -+#endif - #if OPENSSL_VERSION_NUMBER >= 0x0090708fL - REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA224", OPENSSL_ALGO_SHA224, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA256", OPENSSL_ALGO_SHA256, CONST_CS|CONST_PERSISTENT); -@@ -1251,7 +1394,9 @@ PHP_MINIT_FUNCTION(openssl) - } - - php_stream_xport_register("ssl", php_openssl_ssl_socket_factory TSRMLS_CC); -+#ifndef OPENSSL_NO_SSL3 - php_stream_xport_register("sslv3", php_openssl_ssl_socket_factory TSRMLS_CC); -+#endif - #ifndef OPENSSL_NO_SSL2 - php_stream_xport_register("sslv2", php_openssl_ssl_socket_factory TSRMLS_CC); - #endif -@@ -1308,7 +1453,9 @@ PHP_MSHUTDOWN_FUNCTION(openssl) - #ifndef OPENSSL_NO_SSL2 - php_stream_xport_unregister("sslv2" TSRMLS_CC); - #endif -+#ifndef OPENSSL_NO_SSL3 - php_stream_xport_unregister("sslv3" TSRMLS_CC); -+#endif - php_stream_xport_unregister("tls" TSRMLS_CC); - php_stream_xport_unregister("tlsv1.0" TSRMLS_CC); - #if OPENSSL_VERSION_NUMBER >= 0x10001001L -@@ -1893,6 +2040,7 @@ static int openssl_x509v3_subjectAltName(BIO *bio, X509_EXTENSION *extension) - { - GENERAL_NAMES *names; - const X509V3_EXT_METHOD *method = NULL; -+ ASN1_OCTET_STRING *extension_data; - long i, length, num; - const unsigned char *p; - -@@ -1901,8 +2049,9 @@ static int openssl_x509v3_subjectAltName(BIO *bio, X509_EXTENSION *extension) - return -1; - } - -- p = extension->value->data; -- length = extension->value->length; -+ extension_data = X509_EXTENSION_get_data(extension); -+ p = extension_data->data; -+ length = extension_data->length; - if (method->it) { - names = (GENERAL_NAMES*)(ASN1_item_d2i(NULL, &p, length, - ASN1_ITEM_ptr(method->it))); -@@ -1965,6 +2114,8 @@ PHP_FUNCTION(openssl_x509_parse) - char * tmpstr; - zval * subitem; - X509_EXTENSION *extension; -+ X509_NAME *subject_name; -+ char *cert_name; - char *extname; - BIO *bio_out; - BUF_MEM *bio_buf; -@@ -1979,10 +2130,10 @@ PHP_FUNCTION(openssl_x509_parse) - } - array_init(return_value); - -- if (cert->name) { -- add_assoc_string(return_value, "name", cert->name, 1); -- } --/* add_assoc_bool(return_value, "valid", cert->valid); */ -+ subject_name = X509_get_subject_name(cert); -+ cert_name = X509_NAME_oneline(subject_name, NULL, 0); -+ add_assoc_string(return_value, "name", cert_name, 1); -+ OPENSSL_free(cert_name); - - add_assoc_name_entry(return_value, "subject", X509_get_subject_name(cert), useshortnames TSRMLS_CC); - /* hash as used in CA directories to lookup cert by subject name */ -@@ -2008,7 +2159,7 @@ PHP_FUNCTION(openssl_x509_parse) - add_assoc_string(return_value, "alias", tmpstr, 1); - } - -- sig_nid = OBJ_obj2nid((cert)->sig_alg->algorithm); -+ sig_nid = X509_get_signature_nid(cert); - add_assoc_string(return_value, "signatureTypeSN", (char*)OBJ_nid2sn(sig_nid), 1); - add_assoc_string(return_value, "signatureTypeLN", (char*)OBJ_nid2ln(sig_nid), 1); - add_assoc_long(return_value, "signatureTypeNID", sig_nid); -@@ -3217,7 +3368,21 @@ PHP_FUNCTION(openssl_csr_get_public_key) - RETURN_FALSE; - } - -- tpubkey=X509_REQ_get_pubkey(csr); -+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) -+ /* Due to changes in OpenSSL 1.1 related to locking when decoding CSR, -+ * the pub key is not changed after assigning. It means if we pass -+ * a private key, it will be returned including the private part. -+ * If we duplicate it, then we get just the public part which is -+ * the same behavior as for OpenSSL 1.0 */ -+ csr = X509_REQ_dup(csr); -+#endif -+ /* Retrieve the public key from the CSR */ -+ tpubkey = X509_REQ_get_pubkey(csr); -+ -+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) -+ /* We need to free the CSR as it was duplicated */ -+ X509_REQ_free(csr); -+#endif - RETVAL_RESOURCE(zend_list_insert(tpubkey, le_key TSRMLS_CC)); - return; - } -@@ -3482,13 +3647,20 @@ static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC) - { - assert(pkey != NULL); - -- switch (pkey->type) { -+ switch (EVP_PKEY_id(pkey)) { - #ifndef NO_RSA - case EVP_PKEY_RSA: - case EVP_PKEY_RSA2: -- assert(pkey->pkey.rsa != NULL); -- if (pkey->pkey.rsa != NULL && (NULL == pkey->pkey.rsa->p || NULL == pkey->pkey.rsa->q)) { -- return 0; -+ { -+ RSA *rsa = EVP_PKEY_get0_RSA(pkey); -+ if (rsa != NULL) { -+ const BIGNUM *p, *q; -+ -+ RSA_get0_factors(rsa, &p, &q); -+ if (p == NULL || q == NULL) { -+ return 0; -+ } -+ } - } - break; - #endif -@@ -3498,28 +3670,51 @@ static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC) - case EVP_PKEY_DSA2: - case EVP_PKEY_DSA3: - case EVP_PKEY_DSA4: -- assert(pkey->pkey.dsa != NULL); -- -- if (NULL == pkey->pkey.dsa->p || NULL == pkey->pkey.dsa->q || NULL == pkey->pkey.dsa->priv_key){ -- return 0; -+ { -+ DSA *dsa = EVP_PKEY_get0_DSA(pkey); -+ if (dsa != NULL) { -+ const BIGNUM *p, *q, *g, *pub_key, *priv_key; -+ -+ DSA_get0_pqg(dsa, &p, &q, &g); -+ if (p == NULL || q == NULL) { -+ return 0; -+ } -+ -+ DSA_get0_key(dsa, &pub_key, &priv_key); -+ if (priv_key == NULL) { -+ return 0; -+ } -+ } - } - break; - #endif - #ifndef NO_DH - case EVP_PKEY_DH: -- assert(pkey->pkey.dh != NULL); -- -- if (NULL == pkey->pkey.dh->p || NULL == pkey->pkey.dh->priv_key) { -- return 0; -+ { -+ DH *dh = EVP_PKEY_get0_DH(pkey); -+ if (dh != NULL) { -+ const BIGNUM *p, *q, *g, *pub_key, *priv_key; -+ -+ DH_get0_pqg(dh, &p, &q, &g); -+ if (p == NULL) { -+ return 0; -+ } -+ -+ DH_get0_key(dh, &pub_key, &priv_key); -+ if (priv_key == NULL) { -+ return 0; -+ } -+ } - } - break; - #endif - #ifdef HAVE_EVP_PKEY_EC - case EVP_PKEY_EC: -- assert(pkey->pkey.ec != NULL); -- -- if ( NULL == EC_KEY_get0_private_key(pkey->pkey.ec)) { -- return 0; -+ { -+ EC_KEY *ec = EVP_PKEY_get0_EC_KEY(pkey); -+ if (ec != NULL && NULL == EC_KEY_get0_private_key(ec)) { -+ return 0; -+ } - } - break; - #endif -@@ -3531,34 +3726,80 @@ static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC) - } - /* }}} */ - --#define OPENSSL_PKEY_GET_BN(_type, _name) do { \ -- if (pkey->pkey._type->_name != NULL) { \ -- int len = BN_num_bytes(pkey->pkey._type->_name); \ -- char *str = emalloc(len + 1); \ -- BN_bn2bin(pkey->pkey._type->_name, (unsigned char*)str); \ -- str[len] = 0; \ -- add_assoc_stringl(_type, #_name, str, len, 0); \ -- } \ -- } while (0) -- --#define OPENSSL_PKEY_SET_BN(_ht, _type, _name) do { \ -- zval **bn; \ -- if (zend_hash_find(_ht, #_name, sizeof(#_name), (void**)&bn) == SUCCESS && \ -- Z_TYPE_PP(bn) == IS_STRING) { \ -- _type->_name = BN_bin2bn( \ -- (unsigned char*)Z_STRVAL_PP(bn), \ -- Z_STRLEN_PP(bn), NULL); \ -- } \ -+#define OPENSSL_GET_BN(_array, _bn, _name) do { \ -+ if (_bn != NULL) { \ -+ int len = BN_num_bytes(_bn); \ -+ char *str = emalloc(len + 1); \ -+ BN_bn2bin(_bn, (unsigned char*)str); \ -+ str[len] = 0; \ -+ add_assoc_stringl(_array, #_name, str, len, 0); \ -+ } \ - } while (0); - -+#define OPENSSL_PKEY_GET_BN(_type, _name) OPENSSL_GET_BN(_type, _name, _name) -+ -+#define OPENSSL_PKEY_SET_BN(_data, _name) do { \ -+ zval **bn; \ -+ if (zend_hash_find(Z_ARRVAL_P(_data), #_name, sizeof(#_name),(void**)&bn) == SUCCESS && \ -+ Z_TYPE_PP(bn) == IS_STRING) { \ -+ _name = BN_bin2bn( \ -+ (unsigned char*)Z_STRVAL_PP(bn), \ -+ Z_STRLEN_PP(bn), NULL); \ -+ } else { \ -+ _name = NULL; \ -+ } \ -+ } while (0); -+ -+/* {{{ php_openssl_pkey_init_rsa */ -+zend_bool php_openssl_pkey_init_and_assign_rsa(EVP_PKEY *pkey, RSA *rsa, zval *data) -+{ -+ BIGNUM *n, *e, *d, *p, *q, *dmp1, *dmq1, *iqmp; -+ -+ OPENSSL_PKEY_SET_BN(data, n); -+ OPENSSL_PKEY_SET_BN(data, e); -+ OPENSSL_PKEY_SET_BN(data, d); -+ if (!n || !d || !RSA_set0_key(rsa, n, e, d)) { -+ return 0; -+ } -+ -+ OPENSSL_PKEY_SET_BN(data, p); -+ OPENSSL_PKEY_SET_BN(data, q); -+ if ((p || q) && !RSA_set0_factors(rsa, p, q)) { -+ return 0; -+ } -+ -+ OPENSSL_PKEY_SET_BN(data, dmp1); -+ OPENSSL_PKEY_SET_BN(data, dmq1); -+ OPENSSL_PKEY_SET_BN(data, iqmp); -+ if ((dmp1 || dmq1 || iqmp) && !RSA_set0_crt_params(rsa, dmp1, dmq1, iqmp)) { -+ return 0; -+ } -+ -+ if (!EVP_PKEY_assign_RSA(pkey, rsa)) { -+ return 0; -+ } -+ -+ return 1; -+} -+/* }}} */ -+ - /* {{{ php_openssl_pkey_init_dsa */ --zend_bool php_openssl_pkey_init_dsa(DSA *dsa) -+zend_bool php_openssl_pkey_init_dsa(DSA *dsa, zval *data) - { -- if (!dsa->p || !dsa->q || !dsa->g) { -+ BIGNUM *p, *q, *g, *priv_key, *pub_key; -+ const BIGNUM *priv_key_const, *pub_key_const; -+ -+ OPENSSL_PKEY_SET_BN(data, p); -+ OPENSSL_PKEY_SET_BN(data, q); -+ OPENSSL_PKEY_SET_BN(data, g); -+ if (!p || !q || !g || !DSA_set0_pqg(dsa, p, q, g)) { - return 0; - } -- if (dsa->priv_key || dsa->pub_key) { -- return 1; -+ -+ OPENSSL_PKEY_SET_BN(data, pub_key); -+ OPENSSL_PKEY_SET_BN(data, priv_key); -+ if (pub_key) { -+ return DSA_set0_key(dsa, pub_key, priv_key); - } - PHP_OPENSSL_RAND_ADD_TIME(); - if (!DSA_generate_key(dsa)) { -@@ -3566,7 +3807,8 @@ zend_bool php_openssl_pkey_init_dsa(DSA *dsa) - } - /* if BN_mod_exp return -1, then DSA_generate_key succeed for failed key - * so we need to double check that public key is created */ -- if (!dsa->pub_key || BN_is_zero(dsa->pub_key)) { -+ DSA_get0_key(dsa, &pub_key_const, &priv_key_const); -+ if (!pub_key_const || BN_is_zero(pub_key_const)) { - return 0; - } - /* all good */ -@@ -3574,14 +3816,66 @@ zend_bool php_openssl_pkey_init_dsa(DSA *dsa) - } - /* }}} */ - -+/* {{{ php_openssl_dh_pub_from_priv */ -+static BIGNUM *php_openssl_dh_pub_from_priv(BIGNUM *priv_key, BIGNUM *g, BIGNUM *p) -+{ -+ BIGNUM *pub_key, *priv_key_const_time; -+ BN_CTX *ctx; -+ -+ pub_key = BN_new(); -+ if (pub_key == NULL) { -+ return NULL; -+ } -+ -+ priv_key_const_time = BN_new(); -+ if (priv_key_const_time == NULL) { -+ BN_free(pub_key); -+ return NULL; -+ } -+ ctx = BN_CTX_new(); -+ if (ctx == NULL) { -+ BN_free(pub_key); -+ BN_free(priv_key_const_time); -+ return NULL; -+ } -+ -+ BN_with_flags(priv_key_const_time, priv_key, BN_FLG_CONSTTIME); -+ -+ if (!BN_mod_exp_mont(pub_key, g, priv_key_const_time, p, ctx, NULL)) { -+ BN_free(pub_key); -+ pub_key = NULL; -+ } -+ -+ BN_free(priv_key_const_time); -+ BN_CTX_free(ctx); -+ -+ return pub_key; -+} -+/* }}} */ -+ - /* {{{ php_openssl_pkey_init_dh */ --zend_bool php_openssl_pkey_init_dh(DH *dh) -+zend_bool php_openssl_pkey_init_dh(DH *dh, zval *data) - { -- if (!dh->p || !dh->g) { -+ BIGNUM *p, *q, *g, *priv_key, *pub_key; -+ -+ OPENSSL_PKEY_SET_BN(data, p); -+ OPENSSL_PKEY_SET_BN(data, q); -+ OPENSSL_PKEY_SET_BN(data, g); -+ if (!p || !g || !DH_set0_pqg(dh, p, q, g)) { - return 0; - } -- if (dh->pub_key) { -- return 1; -+ -+ OPENSSL_PKEY_SET_BN(data, priv_key); -+ OPENSSL_PKEY_SET_BN(data, pub_key); -+ if (pub_key) { -+ return DH_set0_key(dh, pub_key, priv_key); -+ } -+ if (priv_key) { -+ pub_key = php_openssl_dh_pub_from_priv(priv_key, g, p); -+ if (pub_key == NULL) { -+ return 0; -+ } -+ return DH_set0_key(dh, pub_key, priv_key); - } - PHP_OPENSSL_RAND_ADD_TIME(); - if (!DH_generate_key(dh)) { -@@ -3614,18 +3908,8 @@ PHP_FUNCTION(openssl_pkey_new) - if (pkey) { - RSA *rsa = RSA_new(); - if (rsa) { -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, n); -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, e); -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, d); -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, p); -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, q); -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, dmp1); -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, dmq1); -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, iqmp); -- if (rsa->n && rsa->d) { -- if (EVP_PKEY_assign_RSA(pkey, rsa)) { -- RETURN_RESOURCE(zend_list_insert(pkey, le_key TSRMLS_CC)); -- } -+ if (php_openssl_pkey_init_and_assign_rsa(pkey, rsa, *data)) { -+ RETURN_RESOURCE(zend_list_insert(pkey, le_key TSRMLS_CC)); - } - RSA_free(rsa); - } -@@ -3638,12 +3922,7 @@ PHP_FUNCTION(openssl_pkey_new) - if (pkey) { - DSA *dsa = DSA_new(); - if (dsa) { -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dsa, p); -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dsa, q); -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dsa, g); -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dsa, priv_key); -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dsa, pub_key); -- if (php_openssl_pkey_init_dsa(dsa)) { -+ if (php_openssl_pkey_init_dsa(dsa, *data)) { - if (EVP_PKEY_assign_DSA(pkey, dsa)) { - RETURN_RESOURCE(zend_list_insert(pkey, le_key TSRMLS_CC)); - } -@@ -3659,11 +3938,7 @@ PHP_FUNCTION(openssl_pkey_new) - if (pkey) { - DH *dh = DH_new(); - if (dh) { -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dh, p); -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dh, g); -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dh, priv_key); -- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dh, pub_key); -- if (php_openssl_pkey_init_dh(dh)) { -+ if (php_openssl_pkey_init_dh(dh, *data)) { - if (EVP_PKEY_assign_DH(pkey, dh)) { - RETURN_RESOURCE(zend_list_insert(pkey, le_key TSRMLS_CC)); - } -@@ -3738,10 +4013,10 @@ PHP_FUNCTION(openssl_pkey_export_to_file) - cipher = NULL; - } - -- switch (EVP_PKEY_type(key->type)) { -+ switch (EVP_PKEY_base_id(key)) { - #ifdef HAVE_EVP_PKEY_EC - case EVP_PKEY_EC: -- pem_write = PEM_write_bio_ECPrivateKey(bio_out, EVP_PKEY_get1_EC_KEY(key), cipher, (unsigned char *)passphrase, passphrase_len, NULL, NULL); -+ pem_write = PEM_write_bio_ECPrivateKey(bio_out, EVP_PKEY_get0_EC_KEY(key), cipher, (unsigned char *)passphrase, passphrase_len, NULL, NULL); - break; - #endif - default: -@@ -3807,7 +4082,7 @@ PHP_FUNCTION(openssl_pkey_export) - cipher = NULL; - } - -- switch (EVP_PKEY_type(key->type)) { -+ switch (EVP_PKEY_base_id(key)) { - #ifdef HAVE_EVP_PKEY_EC - case EVP_PKEY_EC: - pem_write = PEM_write_bio_ECPrivateKey(bio_out, EVP_PKEY_get1_EC_KEY(key), cipher, (unsigned char *)passphrase, passphrase_len, NULL, NULL); -@@ -3928,25 +4203,33 @@ PHP_FUNCTION(openssl_pkey_get_details) - /*TODO: Use the real values once the openssl constants are used - * See the enum at the top of this file - */ -- switch (EVP_PKEY_type(pkey->type)) { -+ switch (EVP_PKEY_base_id(pkey)) { - case EVP_PKEY_RSA: - case EVP_PKEY_RSA2: -- ktype = OPENSSL_KEYTYPE_RSA; -- -- if (pkey->pkey.rsa != NULL) { -- zval *rsa; -- -- ALLOC_INIT_ZVAL(rsa); -- array_init(rsa); -- OPENSSL_PKEY_GET_BN(rsa, n); -- OPENSSL_PKEY_GET_BN(rsa, e); -- OPENSSL_PKEY_GET_BN(rsa, d); -- OPENSSL_PKEY_GET_BN(rsa, p); -- OPENSSL_PKEY_GET_BN(rsa, q); -- OPENSSL_PKEY_GET_BN(rsa, dmp1); -- OPENSSL_PKEY_GET_BN(rsa, dmq1); -- OPENSSL_PKEY_GET_BN(rsa, iqmp); -- add_assoc_zval(return_value, "rsa", rsa); -+ { -+ RSA *rsa = EVP_PKEY_get0_RSA(pkey); -+ ktype = OPENSSL_KEYTYPE_RSA; -+ -+ if (rsa != NULL) { -+ zval *z_rsa; -+ const BIGNUM *n, *e, *d, *p, *q, *dmp1, *dmq1, *iqmp; -+ -+ RSA_get0_key(rsa, &n, &e, &d); -+ RSA_get0_factors(rsa, &p, &q); -+ RSA_get0_crt_params(rsa, &dmp1, &dmq1, &iqmp); -+ -+ ALLOC_INIT_ZVAL(z_rsa); -+ array_init(z_rsa); -+ OPENSSL_PKEY_GET_BN(z_rsa, n); -+ OPENSSL_PKEY_GET_BN(z_rsa, e); -+ OPENSSL_PKEY_GET_BN(z_rsa, d); -+ OPENSSL_PKEY_GET_BN(z_rsa, p); -+ OPENSSL_PKEY_GET_BN(z_rsa, q); -+ OPENSSL_PKEY_GET_BN(z_rsa, dmp1); -+ OPENSSL_PKEY_GET_BN(z_rsa, dmq1); -+ OPENSSL_PKEY_GET_BN(z_rsa, iqmp); -+ add_assoc_zval(return_value, "rsa", z_rsa); -+ } - } - - break; -@@ -3954,42 +4237,55 @@ PHP_FUNCTION(openssl_pkey_get_details) - case EVP_PKEY_DSA2: - case EVP_PKEY_DSA3: - case EVP_PKEY_DSA4: -- ktype = OPENSSL_KEYTYPE_DSA; -- -- if (pkey->pkey.dsa != NULL) { -- zval *dsa; -- -- ALLOC_INIT_ZVAL(dsa); -- array_init(dsa); -- OPENSSL_PKEY_GET_BN(dsa, p); -- OPENSSL_PKEY_GET_BN(dsa, q); -- OPENSSL_PKEY_GET_BN(dsa, g); -- OPENSSL_PKEY_GET_BN(dsa, priv_key); -- OPENSSL_PKEY_GET_BN(dsa, pub_key); -- add_assoc_zval(return_value, "dsa", dsa); -+ { -+ DSA *dsa = EVP_PKEY_get0_DSA(pkey); -+ ktype = OPENSSL_KEYTYPE_DSA; -+ -+ if (dsa != NULL) { -+ zval *z_dsa; -+ const BIGNUM *p, *q, *g, *priv_key, *pub_key; -+ -+ DSA_get0_pqg(dsa, &p, &q, &g); -+ DSA_get0_key(dsa, &pub_key, &priv_key); -+ -+ ALLOC_INIT_ZVAL(z_dsa); -+ array_init(z_dsa); -+ OPENSSL_PKEY_GET_BN(z_dsa, p); -+ OPENSSL_PKEY_GET_BN(z_dsa, q); -+ OPENSSL_PKEY_GET_BN(z_dsa, g); -+ OPENSSL_PKEY_GET_BN(z_dsa, priv_key); -+ OPENSSL_PKEY_GET_BN(z_dsa, pub_key); -+ add_assoc_zval(return_value, "dsa", z_dsa); -+ } - } - break; - case EVP_PKEY_DH: -- -- ktype = OPENSSL_KEYTYPE_DH; -- -- if (pkey->pkey.dh != NULL) { -- zval *dh; -- -- ALLOC_INIT_ZVAL(dh); -- array_init(dh); -- OPENSSL_PKEY_GET_BN(dh, p); -- OPENSSL_PKEY_GET_BN(dh, g); -- OPENSSL_PKEY_GET_BN(dh, priv_key); -- OPENSSL_PKEY_GET_BN(dh, pub_key); -- add_assoc_zval(return_value, "dh", dh); -+ { -+ DH *dh = EVP_PKEY_get0_DH(pkey); -+ ktype = OPENSSL_KEYTYPE_DH; -+ -+ if (dh != NULL) { -+ zval *z_dh; -+ const BIGNUM *p, *q, *g, *priv_key, *pub_key; -+ -+ DH_get0_pqg(dh, &p, &q, &g); -+ DH_get0_key(dh, &pub_key, &priv_key); -+ -+ ALLOC_INIT_ZVAL(z_dh); -+ array_init(z_dh); -+ OPENSSL_PKEY_GET_BN(z_dh, p); -+ OPENSSL_PKEY_GET_BN(z_dh, g); -+ OPENSSL_PKEY_GET_BN(z_dh, priv_key); -+ OPENSSL_PKEY_GET_BN(z_dh, pub_key); -+ add_assoc_zval(return_value, "dh", z_dh); -+ } - } - - break; - #ifdef HAVE_EVP_PKEY_EC - case EVP_PKEY_EC: - ktype = OPENSSL_KEYTYPE_EC; -- if (pkey->pkey.ec != NULL) { -+ if (EVP_PKEY_get0_EC_KEY(pkey) != NULL) { - zval *ec; - const EC_GROUP *ec_group; - int nid; -@@ -4546,13 +4842,13 @@ PHP_FUNCTION(openssl_private_encrypt) - cryptedlen = EVP_PKEY_size(pkey); - cryptedbuf = emalloc(cryptedlen + 1); - -- switch (pkey->type) { -+ switch (EVP_PKEY_id(pkey)) { - case EVP_PKEY_RSA: - case EVP_PKEY_RSA2: - successful = (RSA_private_encrypt(data_len, - (unsigned char *)data, - cryptedbuf, -- pkey->pkey.rsa, -+ EVP_PKEY_get0_RSA(pkey), - padding) == cryptedlen); - break; - default: -@@ -4604,13 +4900,13 @@ PHP_FUNCTION(openssl_private_decrypt) - cryptedlen = EVP_PKEY_size(pkey); - crypttemp = emalloc(cryptedlen + 1); - -- switch (pkey->type) { -+ switch (EVP_PKEY_id(pkey)) { - case EVP_PKEY_RSA: - case EVP_PKEY_RSA2: - cryptedlen = RSA_private_decrypt(data_len, - (unsigned char *)data, - crypttemp, -- pkey->pkey.rsa, -+ EVP_PKEY_get0_RSA(pkey), - padding); - if (cryptedlen != -1) { - cryptedbuf = emalloc(cryptedlen + 1); -@@ -4669,13 +4965,13 @@ PHP_FUNCTION(openssl_public_encrypt) - cryptedlen = EVP_PKEY_size(pkey); - cryptedbuf = emalloc(cryptedlen + 1); - -- switch (pkey->type) { -+ switch (EVP_PKEY_id(pkey)) { - case EVP_PKEY_RSA: - case EVP_PKEY_RSA2: - successful = (RSA_public_encrypt(data_len, - (unsigned char *)data, - cryptedbuf, -- pkey->pkey.rsa, -+ EVP_PKEY_get0_RSA(pkey), - padding) == cryptedlen); - break; - default: -@@ -4728,13 +5024,13 @@ PHP_FUNCTION(openssl_public_decrypt) - cryptedlen = EVP_PKEY_size(pkey); - crypttemp = emalloc(cryptedlen + 1); - -- switch (pkey->type) { -+ switch (EVP_PKEY_id(pkey)) { - case EVP_PKEY_RSA: - case EVP_PKEY_RSA2: - cryptedlen = RSA_public_decrypt(data_len, - (unsigned char *)data, - crypttemp, -- pkey->pkey.rsa, -+ EVP_PKEY_get0_RSA(pkey), - padding); - if (cryptedlen != -1) { - cryptedbuf = emalloc(cryptedlen + 1); -@@ -4798,7 +5094,7 @@ PHP_FUNCTION(openssl_sign) - long keyresource = -1; - char * data; - int data_len; -- EVP_MD_CTX md_ctx; -+ EVP_MD_CTX *md_ctx; - zval *method = NULL; - long signature_algo = OPENSSL_ALGO_SHA1; - const EVP_MD *mdtype; -@@ -4831,9 +5127,10 @@ PHP_FUNCTION(openssl_sign) - siglen = EVP_PKEY_size(pkey); - sigbuf = emalloc(siglen + 1); - -- EVP_SignInit(&md_ctx, mdtype); -- EVP_SignUpdate(&md_ctx, data, data_len); -- if (EVP_SignFinal (&md_ctx, sigbuf,(unsigned int *)&siglen, pkey)) { -+ md_ctx = EVP_MD_CTX_create(); -+ EVP_SignInit(md_ctx, mdtype); -+ EVP_SignUpdate(md_ctx, data, data_len); -+ if (EVP_SignFinal (md_ctx, sigbuf,(unsigned int *)&siglen, pkey)) { - zval_dtor(signature); - sigbuf[siglen] = '\0'; - ZVAL_STRINGL(signature, (char *)sigbuf, siglen, 0); -@@ -4842,7 +5139,7 @@ PHP_FUNCTION(openssl_sign) - efree(sigbuf); - RETVAL_FALSE; - } -- EVP_MD_CTX_cleanup(&md_ctx); -+ EVP_MD_CTX_destroy(md_ctx); - if (keyresource == -1) { - EVP_PKEY_free(pkey); - } -@@ -4856,7 +5153,7 @@ PHP_FUNCTION(openssl_verify) - zval **key; - EVP_PKEY *pkey; - int err; -- EVP_MD_CTX md_ctx; -+ EVP_MD_CTX *md_ctx; - const EVP_MD *mdtype; - long keyresource = -1; - char * data; int data_len; -@@ -4890,10 +5187,11 @@ PHP_FUNCTION(openssl_verify) - RETURN_FALSE; - } - -- EVP_VerifyInit (&md_ctx, mdtype); -- EVP_VerifyUpdate (&md_ctx, data, data_len); -- err = EVP_VerifyFinal (&md_ctx, (unsigned char *)signature, signature_len, pkey); -- EVP_MD_CTX_cleanup(&md_ctx); -+ md_ctx = EVP_MD_CTX_create(); -+ EVP_VerifyInit (md_ctx, mdtype); -+ EVP_VerifyUpdate (md_ctx, data, data_len); -+ err = EVP_VerifyFinal (md_ctx, (unsigned char *)signature, signature_len, pkey); -+ EVP_MD_CTX_destroy(md_ctx); - - if (keyresource == -1) { - EVP_PKEY_free(pkey); -@@ -4917,7 +5215,7 @@ PHP_FUNCTION(openssl_seal) - char *method =NULL; - int method_len = 0; - const EVP_CIPHER *cipher; -- EVP_CIPHER_CTX ctx; -+ EVP_CIPHER_CTX *ctx; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szza/|s", &data, &data_len, &sealdata, &ekeys, &pubkeys, &method, &method_len) == FAILURE) { - return; -@@ -4950,6 +5248,7 @@ PHP_FUNCTION(openssl_seal) - memset(eks, 0, sizeof(*eks) * nkeys); - key_resources = safe_emalloc(nkeys, sizeof(long), 0); - memset(key_resources, 0, sizeof(*key_resources) * nkeys); -+ memset(pkeys, 0, sizeof(*pkeys) * nkeys); - - /* get the public keys we are using to seal this data */ - zend_hash_internal_pointer_reset_ex(pubkeysht, &pos); -@@ -4967,27 +5266,28 @@ PHP_FUNCTION(openssl_seal) - i++; - } - -- if (!EVP_EncryptInit(&ctx,cipher,NULL,NULL)) { -+ ctx = EVP_CIPHER_CTX_new(); -+ if (ctx == NULL || !EVP_EncryptInit(ctx,cipher,NULL,NULL)) { - RETVAL_FALSE; -- EVP_CIPHER_CTX_cleanup(&ctx); -+ EVP_CIPHER_CTX_free(ctx); - goto clean_exit; - } - - #if 0 - /* Need this if allow ciphers that require initialization vector */ -- ivlen = EVP_CIPHER_CTX_iv_length(&ctx); -+ ivlen = EVP_CIPHER_CTX_iv_length(ctx); - iv = ivlen ? emalloc(ivlen + 1) : NULL; - #endif - /* allocate one byte extra to make room for \0 */ -- buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx)); -- EVP_CIPHER_CTX_cleanup(&ctx); -+ buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(ctx)); -+ EVP_CIPHER_CTX_cleanup(ctx); - -- if (EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) <= 0 || -- !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len) || -- !EVP_SealFinal(&ctx, buf + len1, &len2)) { -+ if (EVP_SealInit(ctx, cipher, eks, eksl, NULL, pkeys, nkeys) <= 0 || -+ !EVP_SealUpdate(ctx, buf, &len1, (unsigned char *)data, data_len) || -+ !EVP_SealFinal(ctx, buf + len1, &len2)) { - RETVAL_FALSE; - efree(buf); -- EVP_CIPHER_CTX_cleanup(&ctx); -+ EVP_CIPHER_CTX_free(ctx); - goto clean_exit; - } - -@@ -5018,7 +5318,7 @@ PHP_FUNCTION(openssl_seal) - efree(buf); - } - RETVAL_LONG(len1 + len2); -- EVP_CIPHER_CTX_cleanup(&ctx); -+ EVP_CIPHER_CTX_free(ctx); - - clean_exit: - for (i=0; i keylen) { -- EVP_CIPHER_CTX_set_key_length(&cipher_ctx, password_len); -+ EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_len); - } -- EVP_EncryptInit_ex(&cipher_ctx, NULL, NULL, key, (unsigned char *)iv); -+ EVP_EncryptInit_ex(cipher_ctx, NULL, NULL, key, (unsigned char *)iv); - if (options & OPENSSL_ZERO_PADDING) { -- EVP_CIPHER_CTX_set_padding(&cipher_ctx, 0); -+ EVP_CIPHER_CTX_set_padding(cipher_ctx, 0); - } - if (data_len > 0) { -- EVP_EncryptUpdate(&cipher_ctx, outbuf, &i, (unsigned char *)data, data_len); -+ EVP_EncryptUpdate(cipher_ctx, outbuf, &i, (unsigned char *)data, data_len); - } - outlen = i; -- if (EVP_EncryptFinal(&cipher_ctx, (unsigned char *)outbuf + i, &i)) { -+ if (EVP_EncryptFinal(cipher_ctx, (unsigned char *)outbuf + i, &i)) { - outlen += i; - if (options & OPENSSL_RAW_DATA) { - outbuf[outlen] = '\0'; -@@ -5301,7 +5610,8 @@ PHP_FUNCTION(openssl_encrypt) - if (free_iv) { - efree(iv); - } -- EVP_CIPHER_CTX_cleanup(&cipher_ctx); -+ EVP_CIPHER_CTX_cleanup(cipher_ctx); -+ EVP_CIPHER_CTX_free(cipher_ctx); - } - /* }}} */ - -@@ -5313,7 +5623,7 @@ PHP_FUNCTION(openssl_decrypt) - char *data, *method, *password, *iv = ""; - int data_len, method_len, password_len, iv_len = 0; - const EVP_CIPHER *cipher_type; -- EVP_CIPHER_CTX cipher_ctx; -+ EVP_CIPHER_CTX *cipher_ctx; - int i, outlen, keylen; - unsigned char *outbuf, *key; - int base64_str_len; -@@ -5359,17 +5669,23 @@ PHP_FUNCTION(openssl_decrypt) - outlen = data_len + EVP_CIPHER_block_size(cipher_type); - outbuf = emalloc(outlen + 1); - -- EVP_DecryptInit(&cipher_ctx, cipher_type, NULL, NULL); -+ cipher_ctx = EVP_CIPHER_CTX_new(); -+ if (!cipher_ctx) { -+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to create cipher context"); -+ RETURN_FALSE; -+ } -+ -+ EVP_DecryptInit(cipher_ctx, cipher_type, NULL, NULL); - if (password_len > keylen) { -- EVP_CIPHER_CTX_set_key_length(&cipher_ctx, password_len); -+ EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_len); - } -- EVP_DecryptInit_ex(&cipher_ctx, NULL, NULL, key, (unsigned char *)iv); -+ EVP_DecryptInit_ex(cipher_ctx, NULL, NULL, key, (unsigned char *)iv); - if (options & OPENSSL_ZERO_PADDING) { -- EVP_CIPHER_CTX_set_padding(&cipher_ctx, 0); -+ EVP_CIPHER_CTX_set_padding(cipher_ctx, 0); - } -- EVP_DecryptUpdate(&cipher_ctx, outbuf, &i, (unsigned char *)data, data_len); -+ EVP_DecryptUpdate(cipher_ctx, outbuf, &i, (unsigned char *)data, data_len); - outlen = i; -- if (EVP_DecryptFinal(&cipher_ctx, (unsigned char *)outbuf + i, &i)) { -+ if (EVP_DecryptFinal(cipher_ctx, (unsigned char *)outbuf + i, &i)) { - outlen += i; - outbuf[outlen] = '\0'; - RETVAL_STRINGL((char *)outbuf, outlen, 0); -@@ -5386,7 +5702,8 @@ PHP_FUNCTION(openssl_decrypt) - if (base64_str) { - efree(base64_str); - } -- EVP_CIPHER_CTX_cleanup(&cipher_ctx); -+ EVP_CIPHER_CTX_cleanup(cipher_ctx); -+ EVP_CIPHER_CTX_free(cipher_ctx); - } - /* }}} */ - -@@ -5424,6 +5741,7 @@ PHP_FUNCTION(openssl_dh_compute_key) - zval *key; - char *pub_str; - int pub_len; -+ DH *dh; - EVP_PKEY *pkey; - BIGNUM *pub; - char *data; -@@ -5433,14 +5751,21 @@ PHP_FUNCTION(openssl_dh_compute_key) - return; - } - ZEND_FETCH_RESOURCE(pkey, EVP_PKEY *, &key, -1, "OpenSSL key", le_key); -- if (!pkey || EVP_PKEY_type(pkey->type) != EVP_PKEY_DH || !pkey->pkey.dh) { -+ if (pkey == NULL) { -+ RETURN_FALSE; -+ } -+ if (EVP_PKEY_base_id(pkey) != EVP_PKEY_DH) { -+ RETURN_FALSE; -+ } -+ dh = EVP_PKEY_get0_DH(pkey); -+ if (dh == NULL) { - RETURN_FALSE; - } - - pub = BN_bin2bn((unsigned char*)pub_str, pub_len, NULL); - -- data = emalloc(DH_size(pkey->pkey.dh) + 1); -- len = DH_compute_key((unsigned char*)data, pub, pkey->pkey.dh); -+ data = emalloc(DH_size(dh) + 1); -+ len = DH_compute_key((unsigned char*)data, pub, dh); - - if (len >= 0) { - data[len] = 0; -diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c -index d549033..c2d477c 100644 ---- a/ext/openssl/xp_ssl.c -+++ b/ext/openssl/xp_ssl.c -@@ -935,7 +935,7 @@ static int set_local_cert(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */ - static const SSL_METHOD *php_select_crypto_method(long method_value, int is_client TSRMLS_DC) /* {{{ */ - { - if (method_value == STREAM_CRYPTO_METHOD_SSLv2) { --#ifndef OPENSSL_NO_SSL2 -+#if !defined(OPENSSL_NO_SSL2) && OPENSSL_VERSION_NUMBER < 0x10100000L - return is_client ? SSLv2_client_method() : SSLv2_server_method(); - #else - php_error_docref(NULL TSRMLS_CC, E_WARNING, -@@ -1588,12 +1588,26 @@ int php_openssl_setup_crypto(php_stream *stream, - } - /* }}} */ - -+#define PHP_SSL_MAX_VERSION_LEN 32 -+ -+static char *php_ssl_cipher_get_version(const SSL_CIPHER *c, char *buffer, size_t max_len) /* {{{ */ -+{ -+ const char *version = SSL_CIPHER_get_version(c); -+ strncpy(buffer, version, max_len); -+ if (max_len <= strlen(version)) { -+ buffer[max_len - 1] = 0; -+ } -+ return buffer; -+} -+/* }}} */ -+ - static zval *capture_session_meta(SSL *ssl_handle) /* {{{ */ - { - zval *meta_arr; - char *proto_str; - long proto = SSL_version(ssl_handle); - const SSL_CIPHER *cipher = SSL_get_current_cipher(ssl_handle); -+ char version_str[PHP_SSL_MAX_VERSION_LEN]; - - switch (proto) { - #if OPENSSL_VERSION_NUMBER >= 0x10001001L -@@ -1611,7 +1625,7 @@ static zval *capture_session_meta(SSL *ssl_handle) /* {{{ */ - add_assoc_string(meta_arr, "protocol", proto_str, 1); - add_assoc_string(meta_arr, "cipher_name", (char *) SSL_CIPHER_get_name(cipher), 1); - add_assoc_long(meta_arr, "cipher_bits", SSL_CIPHER_get_bits(cipher, NULL)); -- add_assoc_string(meta_arr, "cipher_version", SSL_CIPHER_get_version(cipher), 1); -+ add_assoc_string(meta_arr, "cipher_version", php_ssl_cipher_get_version(cipher, version_str, PHP_SSL_MAX_VERSION_LEN), 1); - - return meta_arr; - } -diff --git a/ext/phar/util.c b/ext/phar/util.c -index 828be8f..06e4e55 100644 ---- a/ext/phar/util.c -+++ b/ext/phar/util.c -@@ -1531,7 +1531,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ - BIO *in; - EVP_PKEY *key; - EVP_MD *mdtype = (EVP_MD *) EVP_sha1(); -- EVP_MD_CTX md_ctx; -+ EVP_MD_CTX *md_ctx; - #else - int tempsig; - #endif -@@ -1608,7 +1608,8 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ - return FAILURE; - } - -- EVP_VerifyInit(&md_ctx, mdtype); -+ md_ctx = EVP_MD_CTX_create(); -+ EVP_VerifyInit(md_ctx, mdtype); - read_len = end_of_phar; - - if (read_len > sizeof(buf)) { -@@ -1620,7 +1621,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ - php_stream_seek(fp, 0, SEEK_SET); - - while (read_size && (len = php_stream_read(fp, (char*)buf, read_size)) > 0) { -- EVP_VerifyUpdate (&md_ctx, buf, len); -+ EVP_VerifyUpdate (md_ctx, buf, len); - read_len -= (off_t)len; - - if (read_len < read_size) { -@@ -1628,9 +1629,9 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ - } - } - -- if (EVP_VerifyFinal(&md_ctx, (unsigned char *)sig, sig_len, key) != 1) { -+ if (EVP_VerifyFinal(md_ctx, (unsigned char *)sig, sig_len, key) != 1) { - /* 1: signature verified, 0: signature does not match, -1: failed signature operation */ -- EVP_MD_CTX_cleanup(&md_ctx); -+ EVP_MD_CTX_destroy(md_ctx); - - if (error) { - spprintf(error, 0, "broken openssl signature"); -@@ -1639,7 +1640,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ - return FAILURE; - } - -- EVP_MD_CTX_cleanup(&md_ctx); -+ EVP_MD_CTX_destroy(md_ctx); - #endif - - *signature_len = phar_hex_str((const char*)sig, sig_len, signature TSRMLS_CC); --- -2.7.4 - diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude-use-pkgconfig-for-libxml2-config.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude-use-pkgconfig-for-libxml2-config.patch deleted file mode 100644 index e7d326d7..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude-use-pkgconfig-for-libxml2-config.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 003c9feaae6ed5c173edcea51193e49bc94ac39a Mon Sep 17 00:00:00 2001 -From: Koen Kooi -Date: Tue, 17 Jun 2014 09:53:00 +0200 -Subject: [PATCH 3/8] acinclude: use pkgconfig for libxml2 config - -Signed-off-by: Koen Kooi -Upstream-Status: Pending ---- - acinclude.m4 | 63 ++++++++++++++++++++++-------------------------------------- - 1 file changed, 23 insertions(+), 40 deletions(-) - -diff --git a/acinclude.m4 b/acinclude.m4 -index 206fcbf..a6c0d84 100644 ---- a/acinclude.m4 -+++ b/acinclude.m4 -@@ -2530,48 +2530,31 @@ dnl - dnl Common setup macro for libxml - dnl - AC_DEFUN([PHP_SETUP_LIBXML], [ --AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path, --[ -- -- ac_cv_php_xml2_config_path="$PHP_LIBXML_DIR/xml2-config" -- -+PKG_CHECK_MODULES([LIBXML], [libxml-2.0 > 2.6.11], [ -+ PHP_EVAL_LIBLINE($LIBXML_LIBS, $1) -+ PHP_EVAL_INCLINE($LIBXML_CFLAGS) -+ -+ dnl Check that build works with given libs -+ AC_CACHE_CHECK(whether libxml build works, php_cv_libxml_build_works, [ -+ PHP_TEST_BUILD(xmlInitParser, -+ [ -+ php_cv_libxml_build_works=yes -+ AC_MSG_RESULT(yes) -+ ], [ -+ AC_MSG_RESULT(no) -+ AC_MSG_ERROR([build test failed. Please check the config.log for details.]) -+ ], [ -+ [$]$1 -+ ]) -+ ]) -+ if test "$php_cv_libxml_build_works" = "yes"; then -+ AC_DEFINE(HAVE_LIBXML, 1, [ ]) -+ fi -+ $2 -+], [ -+ AC_MSG_ERROR([$LIBXML_PKG_ERRORS]) - ]) - -- if test -x "$ac_cv_php_xml2_config_path"; then -- XML2_CONFIG="$ac_cv_php_xml2_config_path" -- libxml_full_version=`$XML2_CONFIG --version` -- ac_IFS=$IFS -- IFS="." -- set $libxml_full_version -- IFS=$ac_IFS -- LIBXML_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3` -- if test "$LIBXML_VERSION" -ge "2006011"; then -- LIBXML_LIBS=`$XML2_CONFIG --libs` -- LIBXML_INCS=`$XML2_CONFIG --cflags` -- PHP_EVAL_LIBLINE($LIBXML_LIBS, $1) -- PHP_EVAL_INCLINE($LIBXML_INCS) -- -- dnl Check that build works with given libs -- AC_CACHE_CHECK(whether libxml build works, php_cv_libxml_build_works, [ -- PHP_TEST_BUILD(xmlInitParser, -- [ -- php_cv_libxml_build_works=yes -- ], [ -- AC_MSG_RESULT(no) -- AC_MSG_ERROR([build test failed. Please check the config.log for details.]) -- ], [ -- [$]$1 -- ]) -- ]) -- if test "$php_cv_libxml_build_works" = "yes"; then -- AC_DEFINE(HAVE_LIBXML, 1, [ ]) -- fi -- $2 -- else -- AC_MSG_ERROR([libxml2 version 2.6.11 or greater required.]) -- fi --ifelse([$3],[],,[else $3]) -- fi - ]) - - dnl ------------------------------------------------------------------------- --- -1.9.3 - diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude.m4-don-t-unset-cache-variables.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude.m4-don-t-unset-cache-variables.patch deleted file mode 100644 index a250cac8..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude.m4-don-t-unset-cache-variables.patch +++ /dev/null @@ -1,39 +0,0 @@ -From dfebe81f946a83fe2499fc84d4f3dbdc5612276c Mon Sep 17 00:00:00 2001 -From: Anuj Mittal -Date: Tue, 3 Apr 2018 11:35:03 +0800 -Subject: [PATCH] acinclude.m4: don't unset cache variables - -Unsetting prevents cache variable from being passed to configure. - -Upstream-Status: Inappropriate [OE-specific] - -Signed-off-by: Anuj Mittal ---- - acinclude.m4 | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/acinclude.m4 b/acinclude.m4 -index f6a55ec..d3346df 100644 ---- a/acinclude.m4 -+++ b/acinclude.m4 -@@ -1890,8 +1890,6 @@ define([phpshift],[ifelse(index([$@],[,]),-1,,[substr([$@],incr(index([$@],[,])) - dnl - AC_DEFUN([PHP_CHECK_FUNC_LIB],[ - ifelse($2,,:,[ -- unset ac_cv_lib_$2[]_$1 -- unset ac_cv_lib_$2[]___$1 - unset found - AC_CHECK_LIB($2, $1, [found=yes], [ - AC_CHECK_LIB($2, __$1, [found=yes], [found=no]) -@@ -1923,8 +1921,6 @@ dnl in the default libraries and as a fall back in the specified library. - dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS. - dnl - AC_DEFUN([PHP_CHECK_FUNC],[ -- unset ac_cv_func_$1 -- unset ac_cv_func___$1 - unset found - - AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ]) --- -2.7.4 - diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude.m4-skip-binconfig-check-for-libxml.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude.m4-skip-binconfig-check-for-libxml.patch deleted file mode 100644 index 15329261..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude.m4-skip-binconfig-check-for-libxml.patch +++ /dev/null @@ -1,56 +0,0 @@ -From a2d146b8dd9d02f523d1e205d79792626a71dec3 Mon Sep 17 00:00:00 2001 -From: Anuj Mittal -Date: Mon, 2 Apr 2018 15:27:09 +0800 -Subject: [PATCH] acinclude.m4: skip binconfig check for libxml - -We want libxml flags to be picked up using pkg-config instead of the -xml2-config file. - -Upstream-Status: Inappropriate [OE-specific] - -Signed-off-by: Anuj Mittal - ---- - acinclude.m4 | 29 ----------------------------- - 1 file changed, 29 deletions(-) - -diff --git a/acinclude.m4 b/acinclude.m4 -index d42d708..d32766a 100644 ---- a/acinclude.m4 -+++ b/acinclude.m4 -@@ -2525,35 +2525,6 @@ dnl - AC_DEFUN([PHP_SETUP_LIBXML], [ - found_libxml=no - -- dnl First try to find xml2-config -- AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path, -- [ -- for i in $PHP_LIBXML_DIR /usr/local /usr; do -- if test -x "$i/bin/xml2-config"; then -- ac_cv_php_xml2_config_path="$i/bin/xml2-config" -- break -- fi -- done -- ]) -- -- if test -x "$ac_cv_php_xml2_config_path"; then -- XML2_CONFIG="$ac_cv_php_xml2_config_path" -- libxml_full_version=`$XML2_CONFIG --version` -- ac_IFS=$IFS -- IFS="." -- set $libxml_full_version -- IFS=$ac_IFS -- LIBXML_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3` -- if test "$LIBXML_VERSION" -ge "2006011"; then -- found_libxml=yes -- LIBXML_LIBS=`$XML2_CONFIG --libs` -- LIBXML_INCS=`$XML2_CONFIG --cflags` -- else -- AC_MSG_ERROR([libxml2 version 2.6.11 or greater required.]) -- fi -- fi -- -- dnl If xml2-config fails, try pkg-config - if test "$found_libxml" = "no"; then - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-configure.ac-don-t-include-build-libtool.m4.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-configure.ac-don-t-include-build-libtool.m4.patch new file mode 100644 index 00000000..2861366a --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-configure.ac-don-t-include-build-libtool.m4.patch @@ -0,0 +1,30 @@ +From f5a34e771532b8433f307b679500c26af328ba35 Mon Sep 17 00:00:00 2001 +From: Changqing Li +Date: Fri, 17 Apr 2020 15:01:57 +0800 +Subject: [PATCH] configure.ac: don't include build/libtool.m4 + +we delete build/libtool.m4 before do_configure, +we will use libtool.m4 under ACLOCALDIR + +Upstream-Status: Inappropriate [oe-specific] + +Signed-off-by: Changqing Li +--- + configure.ac | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 06c6a27..f85144e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -6,7 +6,6 @@ dnl ---------------------------------------------------------------------------- + m4_include([build/ax_check_compile_flag.m4]) + m4_include([build/ax_func_which_gethostbyname_r.m4]) + m4_include([build/ax_gcc_func_attribute.m4]) +-m4_include([build/libtool.m4]) + m4_include([build/php_cxx_compile_stdcxx.m4]) + m4_include([build/php.m4]) + m4_include([build/pkg.m4]) +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-fix-error-caused-by-a-new-variable-is-declared-after.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-fix-error-caused-by-a-new-variable-is-declared-after.patch deleted file mode 100644 index 6ab101b4..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-fix-error-caused-by-a-new-variable-is-declared-after.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 0d88d735887c6f2fa00a743c27124c7a52006a41 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Sun, 15 Apr 2018 19:17:27 -0700 -Subject: [PATCH] fix error caused by a new variable is declared after the - label - -There is a build failure on mips: -... -|sljitNativeMIPS_common.c: In function 'sljit_has_cpu_feature': -|sljitNativeMIPS_common.c:506:3: error: a label can only be part -of a statement and a declaration is not a statement -| sljit_sw fir; -| ^~~~~~~~ -... - -Upstream-Status: Pending - -Signed-off-by: Hongxu Jia ---- - ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c b/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c -index ee207fe..adfd342 100644 ---- a/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c -+++ b/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c -@@ -498,12 +498,14 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil - - SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_has_cpu_feature(sljit_s32 feature_type) - { -+#if defined(__GNUC__) -+ sljit_sw fir; -+#endif - switch (feature_type) { - case SLJIT_HAS_FPU: - #ifdef SLJIT_IS_FPU_AVAILABLE - return SLJIT_IS_FPU_AVAILABLE; - #elif defined(__GNUC__) -- sljit_sw fir; - asm ("cfc1 %0, $0" : "=r"(fir)); - return (fir >> 22) & 0x1; - #else --- -2.10.2 - diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-main-php_ini.c-build-empty-php_load_zend_extension_c.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-main-php_ini.c-build-empty-php_load_zend_extension_c.patch deleted file mode 100644 index fce9738f..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-main-php_ini.c-build-empty-php_load_zend_extension_c.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 2842aa2a078eb1cad55540b61e7edf111395150d Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Mon, 26 Feb 2018 19:30:55 +0100 -Subject: [PATCH] main/php_ini.c: build empty php_load_zend_extension_cb() when - !HAVE_LIBDL - -Commit 0782a7fc6314c8bd3cbfd57f12d0479bf9cc8dc7 ("Fixed bug #74866 -extension_dir = "./ext" now use current directory for base") modified -the php_load_zend_extension_cb() function to use php_load_shlib(), and -pass a handle to the newly introduced zend_load_extension_handle() -function instead of passing the extension path to -zend_load_extension(). - -While doing so, it introduced a call to php_load_shlib() from code -that is built even when HAVE_LIBDL is not defined. However, -php_load_shlib() is not implemented when HAVE_LIBDL is not defined, -for obvious reasons. - -It turns out that zend_load_extension_handle() anyway doesn't do -anything when ZEND_EXTENSIONS_SUPPORT is defined to 0, and -ZEND_EXTENSIONS_SUPPORT is not defined when HAVE_LIBDL is not defined -(Zend/zend_portability.h). - -Fixes the following build failure when building on a system that -doesn't have libdl: - -main/php_ini.o: In function `php_load_zend_extension_cb': -php_ini.c:(.text+0x478): undefined reference to `php_load_shlib' -php_ini.c:(.text+0x4b0): undefined reference to `php_load_shlib' -collect2: error: ld returned 1 exit status - -Upstream-Status: Backport [http://git.php.net/?p=php-src.git;a=commit;h=2842aa2a078eb1cad55540b61e7edf111395150d] -Signed-off-by: Thomas Petazzoni -Signed-off-by: Anuj Mittal ---- - main/php_ini.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/main/php_ini.c b/main/php_ini.c -index ba58eb1..fca263e 100644 ---- a/main/php_ini.c -+++ b/main/php_ini.c -@@ -350,6 +350,7 @@ static void php_load_php_extension_cb(void *arg) - - /* {{{ php_load_zend_extension_cb - */ -+#ifdef HAVE_LIBDL - static void php_load_zend_extension_cb(void *arg) - { - char *filename = *((char **) arg); -@@ -409,6 +410,9 @@ static void php_load_zend_extension_cb(void *arg) - efree(libpath); - } - } -+#else -+static void php_load_zend_extension_cb(void *arg) { } -+#endif - /* }}} */ - - /* {{{ php_init_config --- -2.7.4 - diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-opcache-config.m4-enable-opcache.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-opcache-config.m4-enable-opcache.patch index 0d24d34f..1f3e683a 100644 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-opcache-config.m4-enable-opcache.patch +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-opcache-config.m4-enable-opcache.patch @@ -1,51 +1,55 @@ -From b2fb725dc404d471371731b663234e87cb0fca84 Mon Sep 17 00:00:00 2001 -From: Anuj Mittal -Date: Mon, 2 Apr 2018 17:54:52 +0800 +From a74b42098aededd296ec6a3cd4cf5a17e59d6f29 Mon Sep 17 00:00:00 2001 +From: Claude Bing +Date: Fri, 8 May 2020 10:15:32 -0400 Subject: [PATCH] opcache/config.m4: enable opcache -We can't use AC_TRY_RUN to run programs in a cross compile environment. Set -the variables directly instead since we know that we'd be running on latest +We can't use AC_TRY_RUN to run programs in a cross compile environment. +Set +the variables directly instead since we know that we'd be running on +latest enough linux kernel. Upstream-Status: Inappropriate [Configuration] Signed-off-by: Anuj Mittal + +update patch to version 7.4.4 +Signed-off-by: Changqing Li + +fix issue linking with librt +Signed-off-by: Claude Bing --- - ext/opcache/config.m4 | 349 ++------------------------------------------------ - 1 file changed, 8 insertions(+), 341 deletions(-) + ext/opcache/config.m4 | 195 +----------------------------------------- + 1 file changed, 4 insertions(+), 191 deletions(-) diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4 -index 7b500f0..10bb99a 100644 +index 6c40cafc1c..6569aa9e1c 100644 --- a/ext/opcache/config.m4 +++ b/ext/opcache/config.m4 -@@ -28,353 +28,20 @@ if test "$PHP_OPCACHE" != "no"; then - - AC_CHECK_HEADERS([unistd.h sys/uio.h]) +@@ -23,201 +23,14 @@ if test "$PHP_OPCACHE" != "no"; then + AC_CHECK_FUNCS([mprotect]) -- AC_MSG_CHECKING(for sysvipc shared memory support) -- AC_TRY_RUN([ + AC_MSG_CHECKING(for sysvipc shared memory support) +- AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#include -#include -#include -#include -#include -+ AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support]) - +- -int main() { - pid_t pid; - int status; - int ipc_id; - char *shm; - struct shmid_ds shmbuf; -+ AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support]) - +- - ipc_id = shmget(IPC_PRIVATE, 4096, (IPC_CREAT | SHM_R | SHM_W)); - if (ipc_id == -1) { - return 1; - } -+ AC_DEFINE(HAVE_SHM_MMAP_ZERO, 1, [Define if you have mmap("/dev/zero") SHM support]) - +- - shm = shmat(ipc_id, NULL, 0); - if (shm == (void *)-1) { - shmctl(ipc_id, IPC_RMID, NULL); @@ -90,13 +94,14 @@ index 7b500f0..10bb99a 100644 - } - return 0; -} --],dnl +-]])],[dnl - AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support]) -- msg=yes,msg=no,msg=no) +- msg=yes],[msg=no],[msg=no]) - AC_MSG_RESULT([$msg]) -- -- AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support) -- AC_TRY_RUN([ ++ AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support]) + + AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support) +- AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#include -#include @@ -111,7 +116,8 @@ index 7b500f0..10bb99a 100644 -#ifndef MAP_FAILED -# define MAP_FAILED ((void*)-1) -#endif -- ++ AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support]) + -int main() { - pid_t pid; - int status; @@ -142,68 +148,14 @@ index 7b500f0..10bb99a 100644 - } - return 0; -} --],dnl +-]])],[dnl - AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support]) -- msg=yes,msg=no,msg=no) -- AC_MSG_RESULT([$msg]) -- -- AC_MSG_CHECKING(for mmap() using /dev/zero shared memory support) -- AC_TRY_RUN([ --#include --#include --#include --#include --#include --#include --#include -- --#ifndef MAP_FAILED --# define MAP_FAILED ((void*)-1) --#endif -- --int main() { -- pid_t pid; -- int status; -- int fd; -- char *shm; -- -- fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR); -- if (fd == -1) { -- return 1; -- } -- -- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); -- if (shm == MAP_FAILED) { -- return 2; -- } -- -- strcpy(shm, "hello"); -- -- pid = fork(); -- if (pid < 0) { -- return 5; -- } else if (pid == 0) { -- strcpy(shm, "bye"); -- return 6; -- } -- if (wait(&status) != pid) { -- return 7; -- } -- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { -- return 8; -- } -- if (strcmp(shm, "bye") != 0) { -- return 9; -- } -- return 0; --} --],dnl -- AC_DEFINE(HAVE_SHM_MMAP_ZERO, 1, [Define if you have mmap("/dev/zero") SHM support]) -- msg=yes,msg=no,msg=no) +- msg=yes],[msg=no],[msg=no]) - AC_MSG_RESULT([$msg]) - -- AC_MSG_CHECKING(for mmap() using shm_open() shared memory support) -- AC_TRY_RUN([ +- PHP_CHECK_FUNC_LIB(shm_open, rt) + AC_MSG_CHECKING(for mmap() using shm_open() shared memory support) +- AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#include -#include @@ -225,7 +177,7 @@ index 7b500f0..10bb99a 100644 - char *shm; - char tmpname[4096]; - -- sprintf(tmpname,"test.shm.%dXXXXXX", getpid()); +- sprintf(tmpname,"/opcache.test.shm.%dXXXXXX", getpid()); - if (mktemp(tmpname) == NULL) { - return 1; - } @@ -266,120 +218,20 @@ index 7b500f0..10bb99a 100644 - } - return 0; -} --],dnl +-]])],[dnl - AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support]) -- msg=yes,msg=no,msg=no) -- AC_MSG_RESULT([$msg]) +- AC_MSG_RESULT([yes]) +- PHP_CHECK_LIBRARY(rt, shm_unlink, [PHP_ADD_LIBRARY(rt,1,OPCACHE_SHARED_LIBADD)]) +- ],[ +- AC_MSG_RESULT([no]) +- ],[ +- AC_MSG_RESULT([no]) +- ]) + AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support]) ++ PHP_CHECK_LIBRARY(rt, shm_unlink, [PHP_ADD_LIBRARY(rt,1,OPCACHE_SHARED_LIBADD)]) - AC_MSG_CHECKING(for mmap() using regular file shared memory support) -- AC_TRY_RUN([ --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#ifndef MAP_FAILED --# define MAP_FAILED ((void*)-1) --#endif -- --int main() { -- pid_t pid; -- int status; -- int fd; -- char *shm; -- char tmpname[4096]; -- -- sprintf(tmpname,"test.shm.%dXXXXXX", getpid()); -- if (mktemp(tmpname) == NULL) { -- return 1; -- } -- fd = open(tmpname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); -- if (fd == -1) { -- return 2; -- } -- if (ftruncate(fd, 4096) < 0) { -- close(fd); -- unlink(tmpname); -- return 3; -- } -- -- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); -- if (shm == MAP_FAILED) { -- return 4; -- } -- unlink(tmpname); -- close(fd); -- -- strcpy(shm, "hello"); -- -- pid = fork(); -- if (pid < 0) { -- return 5; -- } else if (pid == 0) { -- strcpy(shm, "bye"); -- return 6; -- } -- if (wait(&status) != pid) { -- return 7; -- } -- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { -- return 8; -- } -- if (strcmp(shm, "bye") != 0) { -- return 9; -- } -- return 0; --} --],dnl -- AC_DEFINE(HAVE_SHM_MMAP_FILE, 1, [Define if you have mmap() SHM support]) -- msg=yes,msg=no,msg=no) -- AC_MSG_RESULT([$msg]) -- --flock_type=unknown --AC_MSG_CHECKING("whether flock struct is linux ordered") --AC_TRY_RUN([ -- #include -- struct flock lock = { 1, 2, 3, 4, 5 }; -- int main() { -- if(lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 3 && lock.l_len == 4) { -- return 0; -- } -- return 1; -- } --], [ -- flock_type=linux -- AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type]) -- AC_MSG_RESULT("yes") --], AC_MSG_RESULT("no") ) -+ -+ AC_DEFINE(HAVE_SHM_MMAP_FILE, 1, [Define if you have mmap() SHM support]) - --AC_MSG_CHECKING("whether flock struct is BSD ordered") --AC_TRY_RUN([ -- #include -- struct flock lock = { 1, 2, 3, 4, 5 }; -- int main() { -- if(lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 && lock.l_whence == 5) { -- return 0; -- } -- return 1; -- } --], [ -- flock_type=bsd -- AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type]) -- AC_MSG_RESULT("yes") --], AC_MSG_RESULT("no") ) -+ flock_type=linux -+ AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type]) - - if test "$flock_type" = "unknown"; then - AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no]) + PHP_NEW_EXTENSION(opcache, + ZendAccelerator.c \ -- -2.7.4 +2.17.1 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-php-don-t-use-broken-wrapper-for-mkdir.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-php-don-t-use-broken-wrapper-for-mkdir.patch index 2f7d5815..d6873736 100644 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-php-don-t-use-broken-wrapper-for-mkdir.patch +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-php-don-t-use-broken-wrapper-for-mkdir.patch @@ -4,17 +4,20 @@ Date: Thu, 3 Nov 2011 14:27:15 +0100 Subject: [PATCH 2/8] php: don't use broken wrapper for mkdir Signed-off-by: Koen Kooi + +update patch to version 7.4.4 +Signed-off-by: Changqing Li --- Upstream-Status: Inappropriate - Makefile.global | 2 +- + build/Makefile.global | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/Makefile.global b/Makefile.global +diff --git a/build/Makefile.global b/build/Makefile.global index ff858c2..ae554b4 100644 ---- a/Makefile.global -+++ b/Makefile.global +--- a/build/Makefile.global ++++ b/build/Makefile.global @@ -1,4 +1,4 @@ -mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p +mkinstalldirs = mkdir -p diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-php.m4-don-t-unset-cache-variables.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-php.m4-don-t-unset-cache-variables.patch new file mode 100644 index 00000000..0d721ec5 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-php.m4-don-t-unset-cache-variables.patch @@ -0,0 +1,39 @@ +php.m4: don't unset cache variables + +Unsetting prevents cache variable from being passed to configure. + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Anuj Mittal + +update this patch to 7.4.4, acinclude.m4 move to build/php.m4 +Signed-off-by: Changqing Li +--- + build/php.m4 | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/build/php.m4 b/build/php.m4 +index 5c45d13..218ec47 100644 +--- a/build/php.m4 ++++ b/build/php.m4 +@@ -1587,8 +1587,6 @@ dnl PHP_CHECK_FUNC_LIB + dnl + AC_DEFUN([PHP_CHECK_FUNC_LIB],[ + ifelse($2,,:,[ +- unset ac_cv_lib_$2[]_$1 +- unset ac_cv_lib_$2[]___$1 + unset found + AC_CHECK_LIB($2, $1, [found=yes], [ + AC_CHECK_LIB($2, __$1, [found=yes], [found=no]) +@@ -1620,8 +1618,6 @@ dnl and as a fall back in the specified library. Defines HAVE_func and + dnl HAVE_library if found and adds the library to LIBS. + dnl + AC_DEFUN([PHP_CHECK_FUNC],[ +- unset ac_cv_func_$1 +- unset ac_cv_func___$1 + unset found + + AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ]) +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/70_mod_php5.conf b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/70_mod_php5.conf deleted file mode 100644 index 1de6fb11..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/70_mod_php5.conf +++ /dev/null @@ -1,12 +0,0 @@ -# vim: ft=apache sw=4 ts=4 - - # Load the module first - - LoadModule php5_module lib/apache2/modules/libphp5.so - - - # Set it to handle the files - AddHandler php5-script .php .phtml .php3 .php4 .php5 - AddType application/x-httpd-php-source .phps - DirectoryIndex index.html index.html.var index.php index.phtml - diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/CVE-2017-9120.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/CVE-2017-9120.patch deleted file mode 100644 index 728f25bb..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/CVE-2017-9120.patch +++ /dev/null @@ -1,21 +0,0 @@ -php: patch for CVE-2017-9120 - -Upstream-Status: Backport [https://bugs.php.net/bug.php?id=74544] - -CVE: CVE-2017-9120 - -Signed-off-by: Changqing Li - -diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c -index 03a39d7..7b88731 100644 ---- a/ext/mysqli/mysqli_api.c -+++ b/ext/mysqli/mysqli_api.c -@@ -1965,7 +1965,7 @@ PHP_FUNCTION(mysqli_real_escape_string) { - } - MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID); - -- newstr = zend_string_alloc(2 * escapestr_len, 0); -+ newstr = zend_string_safe_alloc(2, escapestr_len, 0, 0); - ZSTR_LEN(newstr) = mysql_real_escape_string(mysql->mysql, ZSTR_VAL(newstr), escapestr, escapestr_len); - newstr = zend_string_truncate(newstr, ZSTR_LEN(newstr), 0); - diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/acinclude-xml2-config.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/acinclude-xml2-config.patch deleted file mode 100644 index d0831669..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/acinclude-xml2-config.patch +++ /dev/null @@ -1,25 +0,0 @@ -Upstream-Status: Pending - -diff --git a/acinclude.m4 b/acinclude.m4 -index 4fd452e..206fcbf 100644 ---- a/acinclude.m4 -+++ b/acinclude.m4 -@@ -2532,12 +2532,9 @@ dnl - AC_DEFUN([PHP_SETUP_LIBXML], [ - AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path, - [ -- for i in $PHP_LIBXML_DIR /usr/local /usr; do -- if test -x "$i/bin/xml2-config"; then -- ac_cv_php_xml2_config_path="$i/bin/xml2-config" -- break -- fi -- done -+ -+ ac_cv_php_xml2_config_path="$PHP_LIBXML_DIR/xml2-config" -+ - ]) - - if test -x "$ac_cv_php_xml2_config_path"; then --- -1.9.3 - diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/change-AC_TRY_RUN-to-AC_TRY_LINK.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/change-AC_TRY_RUN-to-AC_TRY_LINK.patch deleted file mode 100644 index 3e901841..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/change-AC_TRY_RUN-to-AC_TRY_LINK.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 3bfcc7fdd22261eaed10949714de0a90d31e10ab Mon Sep 17 00:00:00 2001 -From: Roy Li -Date: Thu, 20 Aug 2015 16:29:35 +0800 -Subject: [PATCH] [PATCH] config.m4: change AC_TRY_RUN to AC_TRY_LINK - -Upstream-Status: Pending - -AC_TRY_RUN is not suitable for cross-compile - -Signed-off-by: Roy Li - -%% original patch: change-AC_TRY_RUN-to-AC_TRY_LINK.patch ---- - ext/fileinfo/config.m4 | 31 ++++++------------------------- - 1 file changed, 6 insertions(+), 25 deletions(-) - -diff --git a/ext/fileinfo/config.m4 b/ext/fileinfo/config.m4 -index 523b4fd..0aaa4c8 100644 ---- a/ext/fileinfo/config.m4 -+++ b/ext/fileinfo/config.m4 -@@ -14,31 +14,12 @@ if test "$PHP_FILEINFO" != "no"; then - libmagic/readcdf.c libmagic/softmagic.c libmagic/der.c" - - AC_MSG_CHECKING([for strcasestr]) -- AC_TRY_RUN([ --#include --#include --#include -- --int main(void) --{ -- char *s0, *s1, *ret; -- -- s0 = (char *) malloc(42); -- s1 = (char *) malloc(8); -- -- memset(s0, 'X', 42); -- s0[24] = 'Y'; -- s0[26] = 'Z'; -- s0[41] = '\0'; -- memset(s1, 'x', 8); -- s1[0] = 'y'; -- s1[2] = 'Z'; -- s1[7] = '\0'; -- -- ret = strcasestr(s0, s1); -- -- return !(NULL != ret); --} -+ AC_TRY_COMPILE([ -+ #include -+ #include -+ #include -+ ],[ -+ strcasestr(NULL, NULL); - ],[ - dnl using the platform implementation - AC_MSG_RESULT(yes) --- -2.7.4 - diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/debian-php-fixheader.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/debian-php-fixheader.patch new file mode 100755 index 00000000..21050f76 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/debian-php-fixheader.patch @@ -0,0 +1,31 @@ +php: remove host specific info from header file + +https://sources.debian.org/data/main/p/php7.3/7.3.6-1/debian/patches/ + 0036-php-5.4.9-fixheader.patch + +Upstream-Status: Inappropriate [not author] +Signed-off-by: Joe Slater + +--- +From: Debian PHP Maintainers +Date: Sat, 2 May 2015 10:26:56 +0200 +Subject: php-5.4.9-fixheader + +Make generated php_config.h constant across rebuilds. +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 433d7e6..41893d7 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1357,7 +1357,7 @@ PHP_BUILD_DATE=`date -u +%Y-%m-%d` + fi + AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date]) + +-PHP_UNAME=`uname -a | xargs` ++PHP_UNAME=`uname | xargs` + AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output]) + PHP_OS=`uname | xargs` + AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output]) diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/iconv.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/iconv.patch index ecf7d872..9ec8a89b 100644 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/iconv.patch +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/iconv.patch @@ -1,32 +1,33 @@ -From 17cc5645f3acf943a5a06465d09d0ebcfea987bd Mon Sep 17 00:00:00 2001 -From: Koen Kooi -Date: Wed, 2 Nov 2011 16:54:57 +0100 -Subject: [PATCH] Upstream-Status: Pending +Subject: [PATCH] From 17cc5645f3acf943a5a06465d09d0ebcfea987bd Mon Sep 17 + 00:00:00 2001 From: Koen Kooi Date: Wed, 2 Nov + 2011 16:54:57 +0100 Subject: [PATCH] Upstream-Status: Pending +update patch to version 7.4.4 +Signed-off-by: Changqing Li --- - acinclude.m4 | 3 ++- + build/php.m4 | 3 ++- ext/iconv/config.m4 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) -diff --git a/acinclude.m4 b/acinclude.m4 -index d32766a..ad5166e 100644 ---- a/acinclude.m4 -+++ b/acinclude.m4 -@@ -2445,7 +2445,8 @@ AC_DEFUN([PHP_SETUP_ICONV], [ - dnl Check libc first if no path is provided in --with-iconv - dnl +diff --git a/build/php.m4 b/build/php.m4 +index 7392876..5c45d13 100644 +--- a/build/php.m4 ++++ b/build/php.m4 +@@ -1950,7 +1950,8 @@ AC_DEFUN([PHP_SETUP_ICONV], [ + echo > ext/iconv/php_iconv_supports_errno.h + dnl Check libc first if no path is provided in --with-iconv. - if test "$PHP_ICONV" = "yes"; then + dnl must check against no, not against yes as PHP_ICONV can also include a path, which implies yes + if test "$PHP_ICONV" != "no"; then - dnl Reset LIBS temporarily as it may have already been included - dnl -liconv in. + dnl Reset LIBS temporarily as it may have already been included -liconv in. LIBS_save="$LIBS" + LIBS= diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4 -index 6a05697..973e750 100644 +index fe9b47a..b6b632f 100644 --- a/ext/iconv/config.m4 +++ b/ext/iconv/config.m4 -@@ -15,7 +15,7 @@ if test "$PHP_ICONV" != "no"; then +@@ -14,7 +14,7 @@ if test "$PHP_ICONV" != "no"; then if test "$iconv_avail" != "no"; then if test -z "$ICONV_DIR"; then @@ -35,3 +36,6 @@ index 6a05697..973e750 100644 if test -f "$i/include/iconv.h" || test -f "$i/include/giconv.h"; then PHP_ICONV_PREFIX="$i" break +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/imap-fix-autofoo.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/imap-fix-autofoo.patch index 16359af9..ebe5f6a9 100644 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/imap-fix-autofoo.patch +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/imap-fix-autofoo.patch @@ -1,32 +1,19 @@ -From c084c8349d1780980e232cb28b60a109e3d89438 Mon Sep 17 00:00:00 2001 -From: Koen Kooi -Date: Wed, 2 Nov 2011 16:54:57 +0100 -Subject: [PATCH] Upstream-Status: Pending +Subject: [PATCH] From c084c8349d1780980e232cb28b60a109e3d89438 Mon Sep 17 + 00:00:00 2001 From: Koen Kooi Date: Wed, 2 Nov + 2011 16:54:57 +0100 Subject: [PATCH] Upstream-Status: Pending +update patch to version 7.4.4 +Signed-off-by: Changqing Li --- - acinclude.m4 | 2 +- ext/imap/config.m4 | 10 ++-------- - 2 files changed, 3 insertions(+), 9 deletions(-) + 1 file changed, 2 insertions(+), 8 deletions(-) -diff --git a/acinclude.m4 b/acinclude.m4 -index ad5166e..f6a55ec 100644 ---- a/acinclude.m4 -+++ b/acinclude.m4 -@@ -2350,7 +2350,7 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[ - PHP_OPENSSL_DIR="/usr/local/ssl /usr/local /usr /usr/local/openssl" - fi - -- for i in $PHP_OPENSSL_DIR; do -+ for i in $PHP_OPENSSL_DIR $PHP_OPENSSL_DIR/usr; do - if test -r $i/include/openssl/evp.h; then - OPENSSL_INCDIR=$i/include - fi diff --git a/ext/imap/config.m4 b/ext/imap/config.m4 -index badb6e2..8ff803c 100644 +index 5086a31..0e938bd 100644 --- a/ext/imap/config.m4 +++ b/ext/imap/config.m4 -@@ -109,7 +109,7 @@ if test "$PHP_IMAP" != "no"; then - PHP_NEW_EXTENSION(imap, php_imap.c, $ext_shared) +@@ -110,7 +110,7 @@ if test "$PHP_IMAP" != "no"; then + PHP_NEW_EXTENSION(imap, php_imap.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) AC_DEFINE(HAVE_IMAP,1,[ ]) - for i in $PHP_IMAP /usr/local /usr; do @@ -34,7 +21,7 @@ index badb6e2..8ff803c 100644 IMAP_INC_CHK() el[]IMAP_INC_CHK(/include/c-client) el[]IMAP_INC_CHK(/include/imap) -@@ -198,13 +198,7 @@ if test "$PHP_IMAP" != "no"; then +@@ -199,13 +199,7 @@ if test "$PHP_IMAP" != "no"; then AC_MSG_ERROR(Cannot find rfc822.h. Please check your c-client installation.) fi @@ -49,3 +36,6 @@ index badb6e2..8ff803c 100644 IMAP_LIB=$lib IMAP_LIB_CHK($PHP_LIBDIR) IMAP_LIB_CHK(c-client) +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/phar-makefile.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/phar-makefile.patch index 336cf0d6..eb73bc44 100644 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/phar-makefile.patch +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/phar-makefile.patch @@ -1,24 +1,25 @@ -From 08962a56f69963e01892d98ca5b75de8354bd3f5 Mon Sep 17 00:00:00 2001 -From: Koen Kooi -Date: Wed, 2 Nov 2011 16:54:57 +0100 -Subject: [PATCH] Fix phar packaging +Subject: [PATCH] From 08962a56f69963e01892d98ca5b75de8354bd3f5 Mon Sep 17 + 00:00:00 2001 From: Koen Kooi Date: Wed, 2 Nov + 2011 16:54:57 +0100 Subject: [PATCH] Fix phar packaging Inherited from OE-Classic, with some additions to fix host paths leaking into the target package. Upstream-Status: Inappropriate [config] +update patch to version 7.4.4 +Signed-off-by: Changqing Li --- ext/phar/Makefile.frag | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag -index 0e3713f..22f7898 100644 +index 6442f33..6145412 100644 --- a/ext/phar/Makefile.frag +++ b/ext/phar/Makefile.frag @@ -10,20 +10,9 @@ pharcmd: $(builddir)/phar.php $(builddir)/phar.phar - PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0 -d 'safe_mode=0' + PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0 PHP_PHARCMD_EXECUTABLE = ` \ - if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \ - $(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \ @@ -34,9 +35,12 @@ index 0e3713f..22f7898 100644 - $(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \ - fi;` -PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";` -+ $(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; ` ++ $(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; ` + +PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";` $(builddir)/phar/phar.inc: $(srcdir)/phar/phar.inc -@test -d $(builddir)/phar || mkdir $(builddir)/phar +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php-fpm-apache.conf b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php-fpm-apache.conf index 77cdd82a..f7f46d20 100644 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php-fpm-apache.conf +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php-fpm-apache.conf @@ -1,6 +1,6 @@ # Taken from http://wiki.apache.org/httpd/PHP-FPM -LoadModule proxy_module lib/apache2/modules/mod_proxy.so -LoadModule proxy_fcgi_module lib/apache2/modules/mod_proxy_fcgi.so +LoadModule proxy_module /usr/libexec/apache2/modules/mod_proxy.so +LoadModule proxy_fcgi_module /usr/libexec/apache2/modules/mod_proxy_fcgi.so ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/usr/share/apache2/htdocs/ diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-0001-opcache-config.m4-enable-opcache.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-0001-opcache-config.m4-enable-opcache.patch deleted file mode 100644 index 7be67ea9..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-0001-opcache-config.m4-enable-opcache.patch +++ /dev/null @@ -1,387 +0,0 @@ -From fafcfac0933c17e1bf551600080eb0541186caf5 Mon Sep 17 00:00:00 2001 -From: Anuj Mittal -Date: Mon, 2 Apr 2018 17:54:52 +0800 -Subject: [PATCH] opcache/config.m4: enable opcache - -We can't use AC_TRY_RUN to run programs in a cross compile environment. Set -the variables directly instead since we know that we'd be running on latest -enough linux kernel. - -Upstream-Status: Inappropriate [Configuration] - -Signed-off-by: Anuj Mittal - -%% original patch: php5-0001-opcache-config.m4-enable-opcache.patch ---- - ext/opcache/config.m4 | 349 ++------------------------------------------------ - 1 file changed, 8 insertions(+), 341 deletions(-) - -diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4 -index 5a8b86c..6e87fa5 100644 ---- a/ext/opcache/config.m4 -+++ b/ext/opcache/config.m4 -@@ -11,353 +11,20 @@ if test "$PHP_OPCACHE" != "no"; then - AC_DEFINE(HAVE_MPROTECT, 1, [Define if you have mprotect() function]) - ]) - -- AC_MSG_CHECKING(for sysvipc shared memory support) -- AC_TRY_RUN([ --#include --#include --#include --#include --#include --#include -+ AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support]) - --int main() { -- pid_t pid; -- int status; -- int ipc_id; -- char *shm; -- struct shmid_ds shmbuf; -+ AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support]) - -- ipc_id = shmget(IPC_PRIVATE, 4096, (IPC_CREAT | SHM_R | SHM_W)); -- if (ipc_id == -1) { -- return 1; -- } -+ AC_DEFINE(HAVE_SHM_MMAP_ZERO, 1, [Define if you have mmap("/dev/zero") SHM support]) - -- shm = shmat(ipc_id, NULL, 0); -- if (shm == (void *)-1) { -- shmctl(ipc_id, IPC_RMID, NULL); -- return 2; -- } -- -- if (shmctl(ipc_id, IPC_STAT, &shmbuf) != 0) { -- shmdt(shm); -- shmctl(ipc_id, IPC_RMID, NULL); -- return 3; -- } -- -- shmbuf.shm_perm.uid = getuid(); -- shmbuf.shm_perm.gid = getgid(); -- shmbuf.shm_perm.mode = 0600; -- -- if (shmctl(ipc_id, IPC_SET, &shmbuf) != 0) { -- shmdt(shm); -- shmctl(ipc_id, IPC_RMID, NULL); -- return 4; -- } -- -- shmctl(ipc_id, IPC_RMID, NULL); -- -- strcpy(shm, "hello"); -- -- pid = fork(); -- if (pid < 0) { -- return 5; -- } else if (pid == 0) { -- strcpy(shm, "bye"); -- return 6; -- } -- if (wait(&status) != pid) { -- return 7; -- } -- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { -- return 8; -- } -- if (strcmp(shm, "bye") != 0) { -- return 9; -- } -- return 0; --} --],dnl -- AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support]) -- msg=yes,msg=no,msg=no) -- AC_MSG_RESULT([$msg]) -- -- AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support) -- AC_TRY_RUN([ --#include --#include --#include --#include --#include -- --#ifndef MAP_ANON --# ifdef MAP_ANONYMOUS --# define MAP_ANON MAP_ANONYMOUS --# endif --#endif --#ifndef MAP_FAILED --# define MAP_FAILED ((void*)-1) --#endif -- --int main() { -- pid_t pid; -- int status; -- char *shm; -- -- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0); -- if (shm == MAP_FAILED) { -- return 1; -- } -- -- strcpy(shm, "hello"); -- -- pid = fork(); -- if (pid < 0) { -- return 5; -- } else if (pid == 0) { -- strcpy(shm, "bye"); -- return 6; -- } -- if (wait(&status) != pid) { -- return 7; -- } -- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { -- return 8; -- } -- if (strcmp(shm, "bye") != 0) { -- return 9; -- } -- return 0; --} --],dnl -- AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support]) -- msg=yes,msg=no,msg=no) -- AC_MSG_RESULT([$msg]) -- -- AC_MSG_CHECKING(for mmap() using /dev/zero shared memory support) -- AC_TRY_RUN([ --#include --#include --#include --#include --#include --#include --#include -- --#ifndef MAP_FAILED --# define MAP_FAILED ((void*)-1) --#endif -- --int main() { -- pid_t pid; -- int status; -- int fd; -- char *shm; -- -- fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR); -- if (fd == -1) { -- return 1; -- } -- -- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); -- if (shm == MAP_FAILED) { -- return 2; -- } -- -- strcpy(shm, "hello"); -- -- pid = fork(); -- if (pid < 0) { -- return 5; -- } else if (pid == 0) { -- strcpy(shm, "bye"); -- return 6; -- } -- if (wait(&status) != pid) { -- return 7; -- } -- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { -- return 8; -- } -- if (strcmp(shm, "bye") != 0) { -- return 9; -- } -- return 0; --} --],dnl -- AC_DEFINE(HAVE_SHM_MMAP_ZERO, 1, [Define if you have mmap("/dev/zero") SHM support]) -- msg=yes,msg=no,msg=no) -- AC_MSG_RESULT([$msg]) -- -- AC_MSG_CHECKING(for mmap() using shm_open() shared memory support) -- AC_TRY_RUN([ --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#ifndef MAP_FAILED --# define MAP_FAILED ((void*)-1) --#endif -- --int main() { -- pid_t pid; -- int status; -- int fd; -- char *shm; -- char tmpname[4096]; -- -- sprintf(tmpname,"test.shm.%dXXXXXX", getpid()); -- if (mktemp(tmpname) == NULL) { -- return 1; -- } -- fd = shm_open(tmpname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); -- if (fd == -1) { -- return 2; -- } -- if (ftruncate(fd, 4096) < 0) { -- close(fd); -- shm_unlink(tmpname); -- return 3; -- } -- -- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); -- if (shm == MAP_FAILED) { -- return 4; -- } -- shm_unlink(tmpname); -- close(fd); -- -- strcpy(shm, "hello"); -- -- pid = fork(); -- if (pid < 0) { -- return 5; -- } else if (pid == 0) { -- strcpy(shm, "bye"); -- return 6; -- } -- if (wait(&status) != pid) { -- return 7; -- } -- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { -- return 8; -- } -- if (strcmp(shm, "bye") != 0) { -- return 9; -- } -- return 0; --} --],dnl -- AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support]) -- msg=yes,msg=no,msg=no) -- AC_MSG_RESULT([$msg]) -+ AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support]) - - AC_MSG_CHECKING(for mmap() using regular file shared memory support) -- AC_TRY_RUN([ --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#ifndef MAP_FAILED --# define MAP_FAILED ((void*)-1) --#endif -- --int main() { -- pid_t pid; -- int status; -- int fd; -- char *shm; -- char tmpname[4096]; -- -- sprintf(tmpname,"test.shm.%dXXXXXX", getpid()); -- if (mktemp(tmpname) == NULL) { -- return 1; -- } -- fd = open(tmpname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); -- if (fd == -1) { -- return 2; -- } -- if (ftruncate(fd, 4096) < 0) { -- close(fd); -- unlink(tmpname); -- return 3; -- } -- -- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); -- if (shm == MAP_FAILED) { -- return 4; -- } -- unlink(tmpname); -- close(fd); -- -- strcpy(shm, "hello"); -- -- pid = fork(); -- if (pid < 0) { -- return 5; -- } else if (pid == 0) { -- strcpy(shm, "bye"); -- return 6; -- } -- if (wait(&status) != pid) { -- return 7; -- } -- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { -- return 8; -- } -- if (strcmp(shm, "bye") != 0) { -- return 9; -- } -- return 0; --} --],dnl -- AC_DEFINE(HAVE_SHM_MMAP_FILE, 1, [Define if you have mmap() SHM support]) -- msg=yes,msg=no,msg=no) -- AC_MSG_RESULT([$msg]) -- --flock_type=unknown --AC_MSG_CHECKING("whether flock struct is linux ordered") --AC_TRY_RUN([ -- #include -- struct flock lock = { 1, 2, 3, 4, 5 }; -- int main() { -- if(lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 3 && lock.l_len == 4) { -- return 0; -- } -- return 1; -- } --], [ -- flock_type=linux -- AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type]) -- AC_MSG_RESULT("yes") --], AC_MSG_RESULT("no") ) -+ -+ AC_DEFINE(HAVE_SHM_MMAP_FILE, 1, [Define if you have mmap() SHM support]) - --AC_MSG_CHECKING("whether flock struct is BSD ordered") --AC_TRY_RUN([ -- #include -- struct flock lock = { 1, 2, 3, 4, 5 }; -- int main() { -- if(lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 && lock.l_whence == 5) { -- return 0; -- } -- return 1; -- } --], [ -- flock_type=bsd -- AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type]) -- AC_MSG_RESULT("yes") --], AC_MSG_RESULT("no") ) -+ flock_type=linux -+ AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type]) - - if test "$flock_type" = "unknown"; then - AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no]) --- -2.7.4 - diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch deleted file mode 100644 index 1d21f8c5..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 5f49987e88dfcbdb84be6e0c9025432fbd998709 Mon Sep 17 00:00:00 2001 -From: Roy Li -Date: Thu, 20 Aug 2015 16:29:35 +0800 -Subject: [PATCH] config.m4: change AC_TRY_RUN to AC_TRY_LINK - -Upstream-Status: Pending - -AC_TRY_RUN is not suitable for cross-compile - -Signed-off-by: Roy Li - -%% original patch: change-AC_TRY_RUN-to-AC_TRY_LINK.patch - -%% original patch: php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch ---- - ext/fileinfo/config.m4 | 31 ++++++------------------------- - 1 file changed, 6 insertions(+), 25 deletions(-) - -diff --git a/ext/fileinfo/config.m4 b/ext/fileinfo/config.m4 -index 7e98d62..8a8ea0e 100644 ---- a/ext/fileinfo/config.m4 -+++ b/ext/fileinfo/config.m4 -@@ -14,31 +14,12 @@ if test "$PHP_FILEINFO" != "no"; then - libmagic/readcdf.c libmagic/softmagic.c" - - AC_MSG_CHECKING([for strcasestr]) -- AC_TRY_RUN([ --#include --#include --#include -- --int main(void) --{ -- char *s0, *s1, *ret; -- -- s0 = (char *) malloc(42); -- s1 = (char *) malloc(8); -- -- memset(s0, 'X', 42); -- s0[24] = 'Y'; -- s0[26] = 'Z'; -- s0[41] = '\0'; -- memset(s1, 'x', 8); -- s1[0] = 'y'; -- s1[2] = 'Z'; -- s1[7] = '\0'; -- -- ret = strcasestr(s0, s1); -- -- return !(NULL != ret); --} -+ AC_TRY_COMPILE([ -+ #include -+ #include -+ #include -+ ],[ -+ strcasestr(NULL, NULL); - ],[ - dnl using the platform implementation - AC_MSG_RESULT(yes) --- -2.7.4 - diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-pear-makefile.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-pear-makefile.patch deleted file mode 100644 index 99743030..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-pear-makefile.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 79725e82d5981fc94eb657f0f46a499dbfc1cc40 Mon Sep 17 00:00:00 2001 -From: Koen Kooi -Date: Wed, 2 Nov 2011 16:54:57 +0100 -Subject: [PATCH] Upstream-Status: Pending - -%% original patch: php5-pear-makefile.patch ---- - pear/Makefile.frag | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pear/Makefile.frag b/pear/Makefile.frag -index 00bacae..739eeca 100644 ---- a/pear/Makefile.frag -+++ b/pear/Makefile.frag -@@ -11,7 +11,7 @@ PEAR_PREFIX = -dp a${program_prefix} - PEAR_SUFFIX = -ds a$(program_suffix) - - install-pear-installer: $(SAPI_CLI_PATH) -- @$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX} -+ @$(PHP_NATIVE_DIR)/php $(PEAR_INSTALL_FLAGS) $(builddir)/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX} - - install-pear: - @echo "Installing PEAR environment: $(INSTALL_ROOT)$(peardir)/" --- -2.7.4 - diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-phar-makefile.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-phar-makefile.patch deleted file mode 100644 index 4e1efd40..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-phar-makefile.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 3ea626a8d081f56b01004b7992534d4e6b81a9cc Mon Sep 17 00:00:00 2001 -From: Koen Kooi -Date: Wed, 2 Nov 2011 16:54:57 +0100 -Subject: [PATCH] Fix phar packaging - -Inherited from OE-Classic, with some additions to fix host paths leaking -into the target package. - -Upstream-Status: Inappropriate [config] - -%% original patch: php5-phar-makefile.patch ---- - ext/phar/Makefile.frag | 17 +++-------------- - 1 file changed, 3 insertions(+), 14 deletions(-) - -diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag -index b8b1b42..1005b2d 100644 ---- a/ext/phar/Makefile.frag -+++ b/ext/phar/Makefile.frag -@@ -5,20 +5,9 @@ pharcmd: $(builddir)/phar.php $(builddir)/phar.phar - - PHP_PHARCMD_SETTINGS = -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0 -d 'safe_mode=0' - PHP_PHARCMD_EXECUTABLE = ` \ -- if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \ -- $(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \ -- if test "x$(PHP_MODULES)" != "x"; then \ -- $(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \ -- for i in bz2 zlib phar; do \ -- if test -f "$(top_builddir)/modules/$$i.la"; then \ -- . $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \ -- fi; \ -- done; \ -- fi; \ -- else \ -- $(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \ -- fi;` --PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";` -+ $(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; ` -+ -+PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";` - - $(builddir)/phar/phar.inc: $(srcdir)/phar/phar.inc - -@test -d $(builddir)/phar || mkdir $(builddir)/phar --- -2.7.4 - diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php_exec_native.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php_exec_native.patch index 80409000..4aec4812 100644 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php_exec_native.patch +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php_exec_native.patch @@ -1,22 +1,26 @@ -From d251b5aa3d23803d016ca16818e2e1d2f2b70a02 Mon Sep 17 00:00:00 2001 -From: Koen Kooi -Date: Wed, 2 Nov 2011 16:54:57 +0100 -Subject: [PATCH] Upstream-Status: Inappriate +Subject: [PATCH] rom d251b5aa3d23803d016ca16818e2e1d2f2b70a02 Mon Sep 17 + 00:00:00 2001 From: Koen Kooi Date: Wed, 2 Nov + 2011 16:54:57 +0100 Subject: [PATCH] Upstream-Status: Inappriate +update patch to version 7.4.4 +Signed-off-by: Changqing Li --- sapi/cli/config.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/cli/config.m4 b/sapi/cli/config.m4 -index 2168151..20a81db 100644 +index 917d45f..aaf1e27 100644 --- a/sapi/cli/config.m4 +++ b/sapi/cli/config.m4 -@@ -50,7 +50,7 @@ if test "$PHP_CLI" != "no"; then +@@ -47,7 +47,7 @@ if test "$PHP_CLI" != "no"; then esac - dnl Set executable for tests + dnl Set executable for tests. - PHP_EXECUTABLE="\$(top_builddir)/\$(SAPI_CLI_PATH)" + PHP_EXECUTABLE="${PHP_NATIVE_DIR}/php" PHP_SUBST(PHP_EXECUTABLE) - dnl Expose to Makefile + dnl Expose to Makefile. +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/pthread-check-threads-m4.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/pthread-check-threads-m4.patch deleted file mode 100644 index 0c564cd8..00000000 --- a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/pthread-check-threads-m4.patch +++ /dev/null @@ -1,30 +0,0 @@ -From d8067ceacbf54e79c9c6b68675332c09eaa0b55d Mon Sep 17 00:00:00 2001 -From: Jackie Huang -Date: Mon, 8 Apr 2013 14:29:51 +0800 -Subject: [PATCH] pthread-check - -Enable pthreads support when cross-compiling - -Upstream-Status: Inapproprate [config] - -Signed-off-by: Jackie Huang ---- - TSRM/threads.m4 | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/TSRM/threads.m4 b/TSRM/threads.m4 -index 38494ce..15d9454 100644 ---- a/TSRM/threads.m4 -+++ b/TSRM/threads.m4 -@@ -86,7 +86,7 @@ int main() { - pthreads_working=no - ], [ - dnl For cross compiling running this test is of no use. NetWare supports pthreads -- pthreads_working=no -+ pthreads_working=yes - case $host_alias in - *netware*) - pthreads_working=yes --- -1.7.4.1 - diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/xfail_two_bug_tests.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/xfail_two_bug_tests.patch new file mode 100644 index 00000000..21057439 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/xfail_two_bug_tests.patch @@ -0,0 +1,34 @@ +php-ptest: xfail two tests + +If and when these tests are modified to expect the correct output, they will +succeed and generate warnings in the test summary. This patch can then be removed. + +Note that we add a closing '?>' to one test so that it can be executed directly by php. + +Upstream-Status: Pending + +Signed-off-By: Joe Slater + + +--- a/tests/basic/bug71273.phpt ++++ b/tests/basic/bug71273.phpt +@@ -16,6 +16,8 @@ Bug #71273 A wrong ext directory setup i + var_dump(preg_match(",.+a[\\/].+[\\/]w.php_kartoffelbrei.dll.+,s", $out)); + ?> + ==DONE== ++--XFAIL-- ++Output is int(0), not int(1) + --EXPECT-- + int(1) + ==DONE== +--- a/tests/run-test/bug75042-3.phpt ++++ b/tests/run-test/bug75042-3.phpt +@@ -8,5 +8,8 @@ display_errors=1 + nonexistentsharedmodule + --FILE-- + ++--XFAIL-- ++No warning message printed. + --EXPECTF-- + PHP Warning: PHP Startup: Unable to load dynamic library '%snonexistentsharedmodule.%s' %A -- cgit 1.2.3-korg