mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
the libwebp 1.6.0 bug affects centos 7 too
This commit is contained in:
parent
3c89ce6c7f
commit
d064e1353c
@ -43,4 +43,9 @@ EOF
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function getExtraEnv(): array
|
||||
{
|
||||
return ['CFLAGS' => '-std=c17'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,12 +5,16 @@ declare(strict_types=1);
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\util\executor\UnixCMakeExecutor;
|
||||
use SPC\util\SPCTarget;
|
||||
|
||||
trait libwebp
|
||||
{
|
||||
protected function build(): void
|
||||
{
|
||||
$code = 'int main() { return _mm256_cvtsi256_si32(_mm256_setzero_si256()); }';
|
||||
$cc = getenv('CC') ?: 'gcc';
|
||||
[$ret] = shell()->execWithResult("echo '{$code}' | {$cc} -x c -mavx2 -o /dev/null - 2>&1");
|
||||
$disableAvx2 = $ret !== 0 && GNU_ARCH === 'x86_64';
|
||||
|
||||
UnixCMakeExecutor::create($this)
|
||||
->addConfigureArgs(
|
||||
'-DWEBP_BUILD_EXTRAS=OFF',
|
||||
@ -23,7 +27,7 @@ trait libwebp
|
||||
'-DWEBP_BUILD_WEBPINFO=OFF',
|
||||
'-DWEBP_BUILD_WEBPMUX=OFF',
|
||||
'-DWEBP_BUILD_FUZZTEST=OFF',
|
||||
SPCTarget::getLibcVersion() === '2.31' && GNU_ARCH === 'x86_64' ? '-DWEBP_ENABLE_SIMD=OFF' : '' // fix an edge bug for debian 11 with gcc 10
|
||||
$disableAvx2 ? '-DWEBP_ENABLE_SIMD=OFF' : ''
|
||||
)
|
||||
->build();
|
||||
// patch pkgconfig
|
||||
|
||||
@ -16,19 +16,19 @@ $test_php_version = [
|
||||
// '8.1',
|
||||
// '8.2',
|
||||
// '8.3',
|
||||
'8.4',
|
||||
// '8.4',
|
||||
'8.5',
|
||||
// 'git',
|
||||
];
|
||||
|
||||
// test os (macos-15-intel, macos-15, ubuntu-latest, windows-latest are available)
|
||||
$test_os = [
|
||||
'macos-15-intel', // bin/spc for x86_64
|
||||
'macos-15', // bin/spc for arm64
|
||||
// 'macos-15-intel', // bin/spc for x86_64
|
||||
// 'macos-15', // bin/spc for arm64
|
||||
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64
|
||||
'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
|
||||
// 'ubuntu-24.04', // bin/spc for x86_64
|
||||
// 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
|
||||
'ubuntu-24.04', // bin/spc for x86_64
|
||||
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
|
||||
'ubuntu-24.04-arm', // bin/spc for arm64
|
||||
// 'windows-2022', // .\bin\spc.ps1
|
||||
// 'windows-2025',
|
||||
@ -50,7 +50,7 @@ $prefer_pre_built = false;
|
||||
|
||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||
$extensions = match (PHP_OS_FAMILY) {
|
||||
'Linux', 'Darwin' => 'bcmath,xsl,xml',
|
||||
'Linux', 'Darwin' => 'imagick',
|
||||
'Windows' => 'bcmath',
|
||||
};
|
||||
|
||||
@ -66,7 +66,7 @@ $with_suggested_libs = false;
|
||||
|
||||
// If you want to test extra libs for extensions, add them below (comma separated, example `libwebp,libavif`). Unnecessary, when $with_suggested_libs is true.
|
||||
$with_libs = match (PHP_OS_FAMILY) {
|
||||
'Linux', 'Darwin' => '',
|
||||
'Linux', 'Darwin' => 'libwebp',
|
||||
'Windows' => '',
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user