From 71c0387ab02fe254ef355f4b029fd98685e50565 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 16 Feb 2024 20:17:34 +0800 Subject: [PATCH] remove tune flags, add debug output for extension sanity check --- src/SPC/builder/Extension.php | 5 ++++- src/SPC/builder/linux/SystemUtil.php | 6 +----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/SPC/builder/Extension.php b/src/SPC/builder/Extension.php index c5c026ff..1776a268 100644 --- a/src/SPC/builder/Extension.php +++ b/src/SPC/builder/Extension.php @@ -185,8 +185,11 @@ class Extension file_get_contents(ROOT_DIR . '/src/globals/tests/' . $this->getName() . '.php') ); - [$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -r "' . trim($test) . '"'); + [$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -r "' . trim($test) . '"'); if ($ret !== 0) { + if ($this->builder->getOption('debug')) { + var_dump($out); + } throw new RuntimeException('extension ' . $this->getName() . ' failed sanity check'); } } diff --git a/src/SPC/builder/linux/SystemUtil.php b/src/SPC/builder/linux/SystemUtil.php index e04c8e10..0cca1524 100644 --- a/src/SPC/builder/linux/SystemUtil.php +++ b/src/SPC/builder/linux/SystemUtil.php @@ -110,11 +110,7 @@ class SystemUtil public static function getTuneCFlags(string $arch): array { return match ($arch) { - 'x86_64' => [ - '-march=corei7', - '-mtune=core-avx2', - ], - 'arm64', 'aarch64' => [], + 'x86_64', 'arm64', 'aarch64' => [], default => throw new RuntimeException('unsupported arch: ' . $arch), }; }