From owner-svn-ports-all@freebsd.org Mon Nov 19 21:40:16 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0C1611280C7; Mon, 19 Nov 2018 21:40:16 +0000 (UTC) (envelope-from osa@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 647158D48E; Mon, 19 Nov 2018 21:40:16 +0000 (UTC) (envelope-from osa@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29CF627A0B; Mon, 19 Nov 2018 21:40:16 +0000 (UTC) (envelope-from osa@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJLeF5O093912; Mon, 19 Nov 2018 21:40:15 GMT (envelope-from osa@FreeBSD.org) Received: (from osa@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJLeFhG093910; Mon, 19 Nov 2018 21:40:15 GMT (envelope-from osa@FreeBSD.org) Message-Id: <201811192140.wAJLeFhG093910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: osa set sender to osa@FreeBSD.org using -f From: "Sergey A. Osokin" Date: Mon, 19 Nov 2018 21:40:15 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r485364 - in head/www/unit: . files X-SVN-Group: ports-head X-SVN-Commit-Author: osa X-SVN-Commit-Paths: in head/www/unit: . files X-SVN-Commit-Revision: 485364 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 647158D48E X-Spamd-Result: default: False [0.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.56)[0.557,0]; NEURAL_SPAM_MEDIUM(0.03)[0.027,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 21:40:17 -0000 Author: osa Date: Mon Nov 19 21:40:15 2018 New Revision: 485364 URL: https://svnweb.freebsd.org/changeset/ports/485364 Log: Fix the unit's php module build when the lang/php* was built with the ZTS option. Bump PORTREVISION. PR: 233255 Patch: https://github.com/nginx/unit/issues/184 Added: head/www/unit/files/php_zts.patch (contents, props changed) Modified: head/www/unit/Makefile Modified: head/www/unit/Makefile ============================================================================== --- head/www/unit/Makefile Mon Nov 19 21:00:03 2018 (r485363) +++ head/www/unit/Makefile Mon Nov 19 21:40:15 2018 (r485364) @@ -3,6 +3,7 @@ PORTNAME= unit PORTVERSION= 1.6 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= https://unit.nginx.org/download/ @@ -13,6 +14,8 @@ LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE BROKEN_powerpc64= fails to build: nxt_conf_validation.c:275: undefined reference to __builtin_popcount + +EXTRA_PATCHES= ${FILESDIR}/php_zts.patch:-p1 USES+= cpe Added: head/www/unit/files/php_zts.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/unit/files/php_zts.patch Mon Nov 19 21:40:15 2018 (r485364) @@ -0,0 +1,109 @@ +# HG changeset patch +# User Valentin Bartenev +# Date 1542651747 -10800 +# Mon Nov 19 21:22:27 2018 +0300 +# Node ID ea6d58aea6f59d23c53f90c98d29424aa635aed0 +# Parent cb3595d839665885cc83c6a20c84ae4ee1e0b5da +PHP: fixed compatibility with ZTS. + +This closes #184 issue on GitHub. + +diff -r cb3595d83966 -r ea6d58aea6f5 auto/modules/php +--- a/auto/modules/php Thu Nov 15 21:50:00 2018 +0300 ++++ b/auto/modules/php Mon Nov 19 21:22:27 2018 +0300 +@@ -111,7 +111,7 @@ if /bin/sh -c "${NXT_PHP_CONFIG} --versi + #include + + int main() { +- php_request_startup(); ++ php_module_startup(NULL, NULL, 0); + return 0; + }" + +diff -r cb3595d83966 -r ea6d58aea6f5 src/nxt_php_sapi.c +--- a/src/nxt_php_sapi.c Thu Nov 15 21:50:00 2018 +0300 ++++ b/src/nxt_php_sapi.c Mon Nov 19 21:22:27 2018 +0300 +@@ -45,19 +45,19 @@ static void nxt_php_set_options(nxt_task + int type); + static nxt_int_t nxt_php_alter_option(nxt_str_t *name, nxt_str_t *value, + int type); +-static int nxt_php_send_headers(sapi_headers_struct *sapi_headers); +-static char *nxt_php_read_cookies(void); ++static int nxt_php_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC); ++static char *nxt_php_read_cookies(TSRMLS_D); + static void nxt_php_set_sptr(nxt_unit_request_info_t *req, const char *name, + nxt_unit_sptr_t *v, uint32_t len, zval *track_vars_array TSRMLS_DC); + nxt_inline void nxt_php_set_str(nxt_unit_request_info_t *req, const char *name, + nxt_str_t *s, zval *track_vars_array TSRMLS_DC); + static void nxt_php_set_cstr(nxt_unit_request_info_t *req, const char *name, + char *str, uint32_t len, zval *track_vars_array TSRMLS_DC); +-static void nxt_php_register_variables(zval *track_vars_array); ++static void nxt_php_register_variables(zval *track_vars_array TSRMLS_DC); + #ifdef NXT_HAVE_PHP_LOG_MESSAGE_WITH_SYSLOG_TYPE + static void nxt_php_log_message(char *message, int syslog_type_int); + #else +-static void nxt_php_log_message(char *message); ++static void nxt_php_log_message(char *message TSRMLS_DC); + #endif + + #ifdef NXT_PHP7 +@@ -159,6 +159,9 @@ NXT_EXPORT nxt_app_module_t nxt_app_mod + + + static nxt_task_t *nxt_php_task; ++#ifdef ZTS ++static void ***tsrm_ls; ++#endif + + + static nxt_int_t +@@ -262,6 +265,17 @@ nxt_php_init(nxt_task_t *task, nxt_commo + nxt_memcpy(index->start, c->index.start, c->index.length); + } + ++#ifdef ZTS ++ tsrm_startup(1, 1, 0, NULL); ++ tsrm_ls = ts_resource(0); ++#endif ++ ++#ifdef NXT_PHP7 ++#if defined(ZEND_SIGNALS) || PHP_MINOR_VERSION > 0 ++ zend_signal_startup(); ++#endif ++#endif ++ + sapi_startup(&nxt_php_sapi_module); + + if (c->options != NULL) { +@@ -433,7 +447,8 @@ nxt_php_alter_option(nxt_str_t *name, nx + if (ini_entry->on_modify + && ini_entry->on_modify(ini_entry, cstr, value->length, + ini_entry->mh_arg1, ini_entry->mh_arg2, +- ini_entry->mh_arg3, ZEND_INI_STAGE_ACTIVATE) ++ ini_entry->mh_arg3, ZEND_INI_STAGE_ACTIVATE ++ TSRMLS_CC) + != SUCCESS) + { + nxt_free(cstr); +@@ -573,7 +588,11 @@ nxt_php_request_handler(nxt_unit_request + (char *) ctx->script.start); + } + ++#if (NXT_PHP7) + if (nxt_slow_path(php_request_startup() == FAILURE)) { ++#else ++ if (nxt_slow_path(php_request_startup(TSRMLS_C) == FAILURE)) { ++#endif + nxt_unit_req_debug(req, "php_request_startup() failed"); + rc = NXT_UNIT_ERROR; + +@@ -915,7 +934,7 @@ static void + nxt_php_log_message(char *message, int syslog_type_int) + #else + static void +-nxt_php_log_message(char *message) ++nxt_php_log_message(char *message TSRMLS_DC) + #endif + { + nxt_log(nxt_php_task, NXT_LOG_NOTICE, "php message: %s", message); +