From adf22b6a0d3481f7fc4d38ade08a2a0dd4ea6f19 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Wed, 21 Nov 2018 18:22:19 +0300 Subject: PHP: fixed compatibility with ZTS. This closes #184 issue on GitHub. --- auto/modules/php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'auto/modules') diff --git a/auto/modules/php b/auto/modules/php index 762c1621..5d54c119 100644 --- a/auto/modules/php +++ b/auto/modules/php @@ -111,7 +111,7 @@ if /bin/sh -c "${NXT_PHP_CONFIG} --version" >> $NXT_AUTOCONF_ERR 2>&1; then #include int main() { - php_request_startup(); + php_module_startup(NULL, NULL, 0); return 0; }" -- cgit From 262578dc71e4c1aaad01656a9b0c78539b1e7371 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Thu, 22 Nov 2018 20:23:43 +0300 Subject: PHP: workaround for bug #71041. Since PHP 7, a zend_signal_startup() call is required if the interpreter was built with ZEND_SIGNALS defined; such a call was added in 3fd76e4ce70a. However, the zend_signal_startup() export is missing from the PHP library; as the result, dlopen() fails with the 'Undefined symbol "zend_signal_startup"' error while loading the PHP module. Meanwhile, if PHP is built without ZTS, the zend_signal_startup() call can be omitted; otherwise, the missing call causes segmentation fault. The PHP fix already was committed to upstream, but we still have to deal with numerous unpatched versions remaining at large. See the related PHP bug: https://bugs.php.net/bug.php?id=71041 --- auto/modules/php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'auto/modules') diff --git a/auto/modules/php b/auto/modules/php index 5d54c119..362bbc69 100644 --- a/auto/modules/php +++ b/auto/modules/php @@ -124,6 +124,30 @@ if /bin/sh -c "${NXT_PHP_CONFIG} --version" >> $NXT_AUTOCONF_ERR 2>&1; then exit 1; fi + # Bug #71041 (https://bugs.php.net/bug.php?id=71041). + + nxt_feature="PHP zend_signal_startup()" + nxt_feature_name="" + nxt_feature_run=no + nxt_feature_incs="${NXT_PHP_INCLUDE}" + nxt_feature_libs="${NXT_PHP_LIB} ${NXT_PHP_LDFLAGS}" + nxt_feature_test=" + #include + #include + + int main() { + zend_signal_startup(); + return 0; + }" + + . auto/feature + + if [ $nxt_found = yes ]; then + NXT_ZEND_SIGNAL_STARTUP=1 + else + NXT_ZEND_SIGNAL_STARTUP=0 + fi + else $echo $echo $0: error: no PHP found. @@ -181,6 +205,7 @@ for nxt_src in $NXT_PHP_MODULE_SRCS; do $NXT_BUILD_DIR/$nxt_obj: $nxt_src \$(CC) -c \$(CFLAGS) \$(NXT_INCS) $NXT_PHP_INCLUDE \\ + -DNXT_ZEND_SIGNAL_STARTUP=$NXT_ZEND_SIGNAL_STARTUP \\ $nxt_dep_flags \\ -o $NXT_BUILD_DIR/$nxt_obj $nxt_src $nxt_dep_post @@ -191,7 +216,7 @@ END done - + cat << END >> $NXT_MAKEFILE .PHONY: ${NXT_PHP_MODULE} -- cgit From d500e29f8818247c1eb6fe38c0d802405aa2c283 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Tue, 4 Dec 2018 17:18:00 +0300 Subject: Ruby: rpath made optional. In most cases it is not needed because Ruby libraries are in the default path. At the same time, rpath pointing to the default path is prohibited by rpmbuild on Fedora. This is related to issue #87 on GitHub. --- auto/modules/ruby | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'auto/modules') diff --git a/auto/modules/ruby b/auto/modules/ruby index 05072353..7d379f2f 100644 --- a/auto/modules/ruby +++ b/auto/modules/ruby @@ -62,10 +62,9 @@ if /bin/sh -c "$NXT_RUBY -v" >> $NXT_AUTOCONF_ERR 2>&1; then NXT_RUBY_LIBNAME=`$NXT_RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG["RUBY_SO_NAME"])'` NXT_RUBY_LIBSCONF=`$NXT_RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG["LIBS"])'` - NXT_RUBY_LIBPATH=`$NXT_RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG["libdir"])'` - NXT_RUBY_LIBS="-L$NXT_RUBY_LIBPATH -Wl,-rpath,${NXT_RUBY_LIBPATH} -l$NXT_RUBY_LIBNAME $NXT_RUBY_LIBSCONF" + NXT_RUBY_LIBS="-l$NXT_RUBY_LIBNAME $NXT_RUBY_LIBSCONF" - nxt_feature="Ruby" + nxt_feature="Ruby library" nxt_feature_name="" nxt_feature_run=no nxt_feature_incs="${NXT_RUBY_INCPATH}" @@ -80,6 +79,26 @@ if /bin/sh -c "$NXT_RUBY -v" >> $NXT_AUTOCONF_ERR 2>&1; then . auto/feature + if [ $nxt_found = no ]; then + NXT_RUBY_LIBPATH=`$NXT_RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG["libdir"])'` + NXT_RUBY_LIBS="-L$NXT_RUBY_LIBPATH -Wl,-rpath,${NXT_RUBY_LIBPATH} $NXT_RUBY_LIBS" + + nxt_feature="Ruby library in $NXT_RUBY_LIBPATH" + nxt_feature_name="" + nxt_feature_run=no + nxt_feature_incs="${NXT_RUBY_INCPATH}" + nxt_feature_libs="${NXT_RUBY_LIBS}" + nxt_feature_test=" + #include + + int main() { + ruby_init(); + return ruby_cleanup(0); + }" + + . auto/feature + fi + else $echo "checking for Ruby ... not found" fi -- cgit From f51f95fa54b51a6c70939eba54c9823f3b941b87 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Wed, 12 Dec 2018 19:54:52 +0300 Subject: Node.js: fixed global install in some cases. By default "npm install" switches to non-privileged user to run package scripts if it is invoked by root. As a result it may prevent node-gyp from writing to package directory and break installation of the module. To disable this switching the --unsafe-perm flag is added. --- auto/modules/nodejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'auto/modules') diff --git a/auto/modules/nodejs b/auto/modules/nodejs index 443ee9d5..96ef6b98 100644 --- a/auto/modules/nodejs +++ b/auto/modules/nodejs @@ -161,7 +161,7 @@ install: ${NXT_NODE}-$NXT_NODE_INSTALL ${NXT_NODE}-install: ${NXT_NODE_TARBALL} \ $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC ${NXT_NODE_EXPORTS} && \\ - ${NXT_NPM} install -g ${PWD}/${NXT_NODE_TARBALL} + ${NXT_NPM} install -g --unsafe-perm ${PWD}/${NXT_NODE_TARBALL} ${NXT_NODE}-uninstall: ${NXT_NPM} uninstall -g unit-http -- cgit From c55f329ecf8d32bad0d5bc2aae1da1522b3a92f8 Mon Sep 17 00:00:00 2001 From: Alexander Borisov Date: Wed, 19 Dec 2018 15:56:54 +0300 Subject: libunit: added generation of version header file. --- auto/modules/nodejs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'auto/modules') diff --git a/auto/modules/nodejs b/auto/modules/nodejs index 96ef6b98..d140eff1 100644 --- a/auto/modules/nodejs +++ b/auto/modules/nodejs @@ -123,8 +123,9 @@ fi NXT_NODE_TMP=${NXT_BUILD_DIR}/src/${NXT_NODE}/unit-http NXT_NODE_TARBALL=${NXT_BUILD_DIR}/${NXT_NODE}-unit-http.tar.gz -NXT_NODE_EXPORTS="export UNIT_SRC_PATH=${PWD}/src && \ - export UNIT_LIB_STATIC_PATH=${PWD}/${NXT_BUILD_DIR}/libunit.a" +NXT_NODE_EXPORTS="export UNIT_SRC_PATH=${PWD}/src \ + && export UNIT_BUILD_PATH=${PWD}/${NXT_BUILD_DIR} \ + && export UNIT_LIB_STATIC_PATH=${PWD}/${NXT_BUILD_DIR}/libunit.a" if [ -n "$NXT_NODE_LOCAL" ]; then NXT_NODE_INSTALL=local-install -- cgit From d6f38a3268dd4df717bdb9054f3f9ee47fa1f429 Mon Sep 17 00:00:00 2001 From: Alexander Borisov Date: Wed, 19 Dec 2018 15:56:57 +0300 Subject: Node.js: added check for libunit version at compile time. --- auto/modules/nodejs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'auto/modules') diff --git a/auto/modules/nodejs b/auto/modules/nodejs index d140eff1..e0208f5d 100644 --- a/auto/modules/nodejs +++ b/auto/modules/nodejs @@ -123,6 +123,7 @@ fi NXT_NODE_TMP=${NXT_BUILD_DIR}/src/${NXT_NODE}/unit-http NXT_NODE_TARBALL=${NXT_BUILD_DIR}/${NXT_NODE}-unit-http.tar.gz +NXT_NODE_VERSION_FILE=${NXT_NODE_TMP}/version.h NXT_NODE_EXPORTS="export UNIT_SRC_PATH=${PWD}/src \ && export UNIT_BUILD_PATH=${PWD}/${NXT_BUILD_DIR} \ && export UNIT_LIB_STATIC_PATH=${PWD}/${NXT_BUILD_DIR}/libunit.a" @@ -149,9 +150,15 @@ ${NXT_NODE}: ${NXT_NODE}-copy $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC ${NXT_NODE_EXPORTS} && \\ cd ${NXT_NODE_TMP} && ${NXT_NODE_GYP} configure build clean -${NXT_NODE}-copy: +${NXT_NODE}-copy: ${NXT_NODE_VERSION_FILE} mkdir -p ${NXT_BUILD_DIR}/src/ - cp -rp src/nodejs/ ${NXT_BUILD_DIR}/src/${NXT_NODE} + cp -rp src/nodejs/* ${NXT_BUILD_DIR}/src/${NXT_NODE} + +${NXT_NODE_VERSION_FILE}: src/nxt_main.h + mkdir -p ${NXT_NODE_TMP} + $echo -n '#define NXT_NODE_VERNUM ' > $NXT_NODE_VERSION_FILE + grep 'define NXT_VERNUM' src/nxt_main.h \\ + | sed -e 's/[^0-9]//g' >> $NXT_NODE_VERSION_FILE ${NXT_NODE_TARBALL}: ${NXT_NODE}-copy tar -zcvf ${NXT_NODE_TARBALL} -C ${NXT_NODE_TMP} . -- cgit