Fix embed sanity check on glibc mode

This commit is contained in:
crazywhalecc 2025-02-04 17:34:47 +08:00
parent 9c878ce613
commit cb73222e21
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680

View File

@ -186,7 +186,7 @@ abstract class UnixBuilderBase extends BuilderBase
$util = new SPCConfigUtil($this);
$config = $util->config($this->ext_list, $this->lib_list, $this->getOption('with-suggested-exts'), $this->getOption('with-suggested-libs'));
$lens = "{$config['cflags']} {$config['ldflags']} {$config['libs']}";
if (PHP_OS_FAMILY === 'Linux') {
if (PHP_OS_FAMILY === 'Linux' && $this->getOption('libc') !== 'glibc') {
$lens .= ' -static';
}
[$ret, $out] = shell()->cd($sample_file_path)->execWithResult(getenv('CC') . ' -o embed embed.c ' . $lens);