suboptimal solutions, but a bit closer to building

This commit is contained in:
DubbleClick 2025-06-23 12:57:00 +07:00
parent 955b586908
commit 7628847a46
6 changed files with 7 additions and 5 deletions

View File

@ -71,7 +71,7 @@ CXX=${SPC_LINUX_DEFAULT_CXX}
AR=${SPC_LINUX_DEFAULT_AR}
LD=${SPC_LINUX_DEFAULT_LD}
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
SPC_DEFAULT_C_FLAGS="-fPIC -Os"
SPC_DEFAULT_C_FLAGS="-fPIC -Os -Wno-error=date-time"
SPC_DEFAULT_CXX_FLAGS="-fPIC -Os"
; 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=

View File

@ -25,7 +25,7 @@ class amqp extends Extension
public function getUnixConfigureArg(bool $shared = false): string
{
return '--with-amqp' . ($shared ? '=shared' : '') . ' --with-librabbitmq-dir=' . BUILD_ROOT_PATH;
return '--with-amqp' . ($sh<ared ? '=shared' : '') . ' --with-librabbitmq-dir=' . BUILD_ROOT_PATH;
}
public function getWindowsConfigureArg($shared = false): string

View File

@ -19,7 +19,7 @@ class imagick extends Extension
return false;
}
// imagick with calls omp_pause_all, which requires openmp, on non-musl we build imagick without openmp
$extra_libs = trim(getenv('SPC_EXTRA_LIBS') . ' -lgomp');
$extra_libs = trim(getenv('SPC_EXTRA_LIBS') . ' -lomp');
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
return true;
}

View File

@ -348,7 +348,7 @@ abstract class UnixBuilderBase extends BuilderBase
'GOPATH' => PKG_ROOT_PATH . '/go',
'CGO_ENABLED' => '1',
'CGO_CFLAGS' => $config['cflags'],
'CGO_LDFLAGS' => "{$config['ldflags']} {$config['libs']} {$lrt}",
'CGO_LDFLAGS' => "{$config['ldflags']} {$config['libs']} {$lrt} -L/usr/lib64",
'XCADDY_GO_BUILD_FLAGS' => '-buildmode=pie ' .
'-ldflags \"-linkmode=external ' . $extLdFlags . ' ' . $debugFlags .
'-X \'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP ' .

View File

@ -6,6 +6,7 @@ namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
use SPC\util\executor\UnixAutoconfExecutor;
trait librdkafka
@ -16,6 +17,7 @@ trait librdkafka
*/
protected function build(): void
{
FileSystem::replaceFileStr($this->source_dir . '/lds-gen.py', "funcs.append('rd_ut_coverage_check')", '');
UnixAutoconfExecutor::create($this)
->optionalLib(
'zstd',

View File

@ -147,7 +147,7 @@ class SPCConfigUtil
}
// patch: imagick (imagemagick wrapper) for linux needs libgomp
if (in_array('imagemagick', $libraries) && PHP_OS_FAMILY === 'Linux' && !(getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10'))) {
$short_name[] = '-lgomp';
$short_name[] = '-lomp';
}
return implode(' ', $short_name);
}