Skip to content

Commit 52f40b7

Browse files
committed
the release option also affects shared extensions, which is unwanted, patchelf their soname back and rename them
1 parent 5a3a8db commit 52f40b7

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/SPC/builder/linux/LinuxBuilder.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,24 @@ protected function buildEmbed(): void
293293
$cwd = getcwd();
294294
chdir(BUILD_LIB_PATH);
295295
symlink($realLibName, 'libphp.so');
296+
chdir(BUILD_MODULES_PATH);
297+
foreach ($this->getExts() as $ext) {
298+
if (!$ext->isBuildShared()) {
299+
continue;
300+
}
301+
$name = $ext->getName();
302+
$versioned = "{$name}-{$release}.so";
303+
$unversioned = "{$name}.so";
304+
if (is_file(BUILD_MODULES_PATH . "/{$versioned}")) {
305+
rename(BUILD_MODULES_PATH . "/{$versioned}", BUILD_MODULES_PATH . "/{$unversioned}");
306+
shell()->cd(BUILD_MODULES_PATH)
307+
->exec(sprintf(
308+
'patchelf --set-soname %s %s',
309+
escapeshellarg($unversioned),
310+
escapeshellarg($unversioned)
311+
));
312+
}
313+
}
296314
chdir($cwd);
297315
}
298316
$this->patchPhpScripts();

src/SPC/doctor/item/LinuxToolCheckList.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class LinuxToolCheckList
2222
'bzip2', 'cmake', 'gcc',
2323
'g++', 'patch', 'binutils-gold',
2424
'libtoolize', 'which',
25+
'patchelf',
2526
];
2627

2728
public const TOOLS_DEBIAN = [
@@ -30,6 +31,7 @@ class LinuxToolCheckList
3031
'tar', 'unzip', 'gzip',
3132
'bzip2', 'cmake', 'patch',
3233
'xz', 'libtoolize', 'which',
34+
'patchelf',
3335
];
3436

3537
public const TOOLS_RHEL = [
@@ -38,6 +40,7 @@ class LinuxToolCheckList
3840
'tar', 'unzip', 'gzip', 'gcc',
3941
'bzip2', 'cmake', 'patch', 'which',
4042
'xz', 'libtool', 'gettext-devel',
43+
'perl', 'patchelf',
4144
];
4245

4346
public const TOOLS_ARCH = [

0 commit comments

Comments
 (0)