diff --git a/config/env.ini b/config/env.ini index f70ad0a2..4fd1a28a 100644 --- a/config/env.ini +++ b/config/env.ini @@ -68,7 +68,7 @@ CXX=${SPC_LINUX_DEFAULT_CXX} AR=${SPC_LINUX_DEFAULT_AR} LD=ld.gold ; default compiler flags, used in CMake toolchain file, openssl and pkg-config build -SPC_DEFAULT_C_FLAGS="-fPIC" +SPC_DEFAULT_C_FLAGS="-fPIC -std=c11" SPC_DEFAULT_CXX_FLAGS= ; extra libs for building php executable, used in `make` command for building php (this value may changed by extension build process, space separated) SPC_EXTRA_LIBS= @@ -97,7 +97,7 @@ SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS="-L${BUILD_LIB_PATH}" ; LIBS for configuring php SPC_CMD_VAR_PHP_CONFIGURE_LIBS="-ldl -lpthread -lm" ; EXTRA_CFLAGS for `make` php -SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -Os -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-ident -fPIE -fPIC" +SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -fPIE -fPIC -Os -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-ident" ; EXTRA_LIBS for `make` php SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm" ; EXTRA_LDFLAGS_PROGRAM for `make` php diff --git a/config/source.json b/config/source.json index a4b25cb8..2beea67c 100644 --- a/config/source.json +++ b/config/source.json @@ -859,7 +859,7 @@ "spx": { "type": "git", "rev": "master", - "url": "https://github.com/static-php/php-spx.git", + "url": "https://github.com/NoiseByNorthwest/php-spx.git", "path": "php-src/ext/spx", "license": { "type": "file", diff --git a/src/SPC/builder/extension/spx.php b/src/SPC/builder/extension/spx.php index dc341e39..ef9e95bf 100644 --- a/src/SPC/builder/extension/spx.php +++ b/src/SPC/builder/extension/spx.php @@ -5,25 +5,14 @@ declare(strict_types=1); namespace SPC\builder\extension; use SPC\builder\Extension; -use SPC\exception\WrongUsageException; use SPC\util\CustomExt; #[CustomExt('spx')] class spx extends Extension { - /** - * @throws WrongUsageException - */ - public function validate(): void - { - if ($this->builder->getOption('enable-zts')) { - throw new WrongUsageException('ext-spx is not thread safe, do not build it with ZTS builds'); - } - } - public function getUnixConfigureArg(bool $shared = false): string { - $arg = '--enable-spx'; + $arg = '--enable-SPX'; if ($this->builder->getExt('zlib') === null) { $arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH; } diff --git a/src/SPC/command/BuildPHPCommand.php b/src/SPC/command/BuildPHPCommand.php index 49067b0b..0cf64f67 100644 --- a/src/SPC/command/BuildPHPCommand.php +++ b/src/SPC/command/BuildPHPCommand.php @@ -73,7 +73,7 @@ class BuildPHPCommand extends BuildCommand } $static_and_shared = array_intersect($static_extensions, $shared_extensions); if (!empty($static_and_shared)) { - $this->output->writeln('Building extensions [' . implode(',', $static_and_shared) . '] as both static and shared\, tests may not be accurate or fail.'); + $this->output->writeln('Building extensions [' . implode(',', $static_and_shared) . '] as both static and shared, tests may not be accurate or fail.'); } if ($rule === BUILD_TARGET_NONE) { @@ -128,7 +128,6 @@ class BuildPHPCommand extends BuildCommand $include_suggest_lib = $this->getOption('with-suggested-libs'); [$extensions, $libraries, $not_included] = DependencyUtil::getExtsAndLibs(array_merge($static_extensions, $shared_extensions), $libraries, $include_suggest_ext, $include_suggest_lib); $display_libs = array_filter($libraries, fn ($lib) => in_array(Config::getLib($lib, 'type', 'lib'), ['lib', 'package'])); - $display_extensions = array_map(fn ($ext) => in_array($ext, $shared_extensions) ? "*{$ext}" : $ext, $extensions); // separate static and shared extensions from $extensions // filter rule: including shared extensions if they are in $static_extensions or $shared_extensions @@ -138,7 +137,8 @@ class BuildPHPCommand extends BuildCommand $indent_texts = [ 'Build OS' => PHP_OS_FAMILY . ' (' . php_uname('m') . ')', 'Build SAPI' => $builder->getBuildTypeName($rule), - 'Extensions (' . count($extensions) . ')' => implode(',', $display_extensions), + 'Extensions (' . count($extensions) . ')' => implode(',', $extensions), + 'Shared Extensions (' . count($shared_extensions) . ')' => implode(',', $shared_extensions), 'Libraries (' . count($libraries) . ')' => implode(',', $display_libs), 'Strip Binaries' => $builder->getOption('no-strip') ? 'no' : 'yes', 'Enable ZTS' => $builder->getOption('enable-zts') ? 'yes' : 'no',