Skip to content

Commit d064e13

Browse files
committed
the libwebp 1.6.0 bug affects centos 7 too
1 parent 3c89ce6 commit d064e13

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

src/SPC/builder/extension/memcache.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,9 @@ public function patchBeforeBuildconf(): bool
4343
);
4444
return true;
4545
}
46+
47+
protected function getExtraEnv(): array
48+
{
49+
return ['CFLAGS' => '-std=c17'];
50+
}
4651
}

src/SPC/builder/unix/library/libwebp.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
namespace SPC\builder\unix\library;
66

77
use SPC\util\executor\UnixCMakeExecutor;
8-
use SPC\util\SPCTarget;
98

109
trait libwebp
1110
{
1211
protected function build(): void
1312
{
13+
$code = 'int main() { return _mm256_cvtsi256_si32(_mm256_setzero_si256()); }';
14+
$cc = getenv('CC') ?: 'gcc';
15+
[$ret] = shell()->execWithResult("echo '{$code}' | {$cc} -x c -mavx2 -o /dev/null - 2>&1");
16+
$disableAvx2 = $ret !== 0 && GNU_ARCH === 'x86_64';
17+
1418
UnixCMakeExecutor::create($this)
1519
->addConfigureArgs(
1620
'-DWEBP_BUILD_EXTRAS=OFF',
@@ -23,7 +27,7 @@ protected function build(): void
2327
'-DWEBP_BUILD_WEBPINFO=OFF',
2428
'-DWEBP_BUILD_WEBPMUX=OFF',
2529
'-DWEBP_BUILD_FUZZTEST=OFF',
26-
SPCTarget::getLibcVersion() === '2.31' && GNU_ARCH === 'x86_64' ? '-DWEBP_ENABLE_SIMD=OFF' : '' // fix an edge bug for debian 11 with gcc 10
30+
$disableAvx2 ? '-DWEBP_ENABLE_SIMD=OFF' : ''
2731
)
2832
->build();
2933
// patch pkgconfig

src/globals/test-extensions.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616
// '8.1',
1717
// '8.2',
1818
// '8.3',
19-
'8.4',
19+
// '8.4',
2020
'8.5',
2121
// 'git',
2222
];
2323

2424
// test os (macos-15-intel, macos-15, ubuntu-latest, windows-latest are available)
2525
$test_os = [
26-
'macos-15-intel', // bin/spc for x86_64
27-
'macos-15', // bin/spc for arm64
26+
// 'macos-15-intel', // bin/spc for x86_64
27+
// 'macos-15', // bin/spc for arm64
2828
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64
2929
'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
30-
// 'ubuntu-24.04', // bin/spc for x86_64
31-
// 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
30+
'ubuntu-24.04', // bin/spc for x86_64
31+
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
3232
'ubuntu-24.04-arm', // bin/spc for arm64
3333
// 'windows-2022', // .\bin\spc.ps1
3434
// 'windows-2025',
@@ -50,7 +50,7 @@
5050

5151
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
5252
$extensions = match (PHP_OS_FAMILY) {
53-
'Linux', 'Darwin' => 'bcmath,xsl,xml',
53+
'Linux', 'Darwin' => 'imagick',
5454
'Windows' => 'bcmath',
5555
};
5656

@@ -66,7 +66,7 @@
6666

6767
// If you want to test extra libs for extensions, add them below (comma separated, example `libwebp,libavif`). Unnecessary, when $with_suggested_libs is true.
6868
$with_libs = match (PHP_OS_FAMILY) {
69-
'Linux', 'Darwin' => '',
69+
'Linux', 'Darwin' => 'libwebp',
7070
'Windows' => '',
7171
};
7272

0 commit comments

Comments
 (0)