Skip to content

Commit 6bbb3c9

Browse files
committed
remove -release handling functionality
1 parent 76025b9 commit 6bbb3c9

File tree

4 files changed

+3
-43
lines changed

4 files changed

+3
-43
lines changed

bin/spc-alpine-docker

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ RUN apk update; \
108108
wget \
109109
xz \
110110
gettext-dev \
111-
binutils-gold \
112-
patchelf
111+
binutils-gold
113112
114113
RUN curl -#fSL https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-linux-\$(uname -m).tar.gz | tar -xz -C /usr/local/bin && \
115114
chmod +x /usr/local/bin/php

bin/spc-gnu-docker

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ RUN echo "source scl_source enable devtoolset-10" >> /etc/bashrc
9292
RUN source /etc/bashrc
9393
RUN yum install -y which
9494
95-
RUN curl -fsSL -o patchelf.tgz https://github.com/NixOS/patchelf/releases/download/0.18.0/patchelf-0.18.0-$SPC_USE_ARCH.tar.gz && \
96-
mkdir -p /patchelf && \
97-
tar -xzf patchelf.tgz -C /patchelf --strip-components=1 && \
98-
cp /patchelf/bin/patchelf /usr/bin/
99-
10095
RUN curl -o cmake.tgz -#fSL https://github.com/Kitware/CMake/releases/download/v3.31.4/cmake-3.31.4-linux-$SPC_USE_ARCH.tar.gz && \
10196
mkdir /cmake && \
10297
tar -xzf cmake.tgz -C /cmake --strip-components 1

src/SPC/builder/linux/LinuxBuilder.php

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,6 @@ protected function buildEmbed(): void
284284
// process libphp.so for shared embed
285285
$libphpSo = BUILD_LIB_PATH . '/libphp.so';
286286
if (file_exists($libphpSo)) {
287-
// post actions: rename libphp.so to libphp-<release>.so if -release is set in LDFLAGS
288-
$this->processLibphpSoFile($libphpSo);
289287
// deploy libphp.so
290288
$this->deployBinary($libphpSo, $libphpSo, false);
291289
}
@@ -319,40 +317,11 @@ private function getMakeExtraVars(): array
319317
return array_filter([
320318
'EXTRA_CFLAGS' => getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS'),
321319
'EXTRA_LIBS' => $config['libs'],
322-
'EXTRA_LDFLAGS' => preg_replace('/-release\s+(\S+)/', '', getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS')),
320+
'EXTRA_LDFLAGS' => getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS'),
323321
'EXTRA_LDFLAGS_PROGRAM' => "-L{$lib} {$static} -pie",
324322
]);
325323
}
326324

327-
private function processLibphpSoFile(string $libphpSo): void
328-
{
329-
$ldflags = getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS') ?: '';
330-
$libDir = BUILD_LIB_PATH;
331-
$cwd = getcwd();
332-
333-
if (preg_match('/-release\s+(\S+)/', $ldflags, $matches)) {
334-
$release = $matches[1];
335-
$releaseName = "libphp-{$release}.so";
336-
$libphpRelease = "{$libDir}/{$releaseName}";
337-
if (!file_exists($libphpRelease) && file_exists($libphpSo)) {
338-
rename($libphpSo, $libphpRelease);
339-
}
340-
if (file_exists($libphpRelease)) {
341-
chdir($libDir);
342-
if (file_exists($libphpSo)) {
343-
unlink($libphpSo);
344-
}
345-
symlink($releaseName, 'libphp.so');
346-
shell()->exec(sprintf(
347-
'patchelf --set-soname %s %s',
348-
escapeshellarg($releaseName),
349-
escapeshellarg($libphpRelease)
350-
));
351-
}
352-
chdir($cwd);
353-
}
354-
}
355-
356325
/**
357326
* Patch micro.sfx after UPX compression.
358327
* micro needs special section handling in LinuxBuilder.

src/SPC/doctor/item/LinuxToolCheckList.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class LinuxToolCheckList
2222
'bzip2', 'cmake', 'gcc',
2323
'g++', 'patch', 'binutils-gold',
2424
'libtoolize', 'which',
25-
'patchelf',
2625
];
2726

2827
public const TOOLS_DEBIAN = [
@@ -31,16 +30,14 @@ class LinuxToolCheckList
3130
'tar', 'unzip', 'gzip', 'gcc', 'g++',
3231
'bzip2', 'cmake', 'patch',
3332
'xz', 'libtoolize', 'which',
34-
'patchelf',
3533
];
3634

3735
public const TOOLS_RHEL = [
3836
'perl', 'make', 'bison', 're2c', 'flex',
3937
'git', 'autoconf', 'automake',
4038
'tar', 'unzip', 'gzip', 'gcc', 'g++',
4139
'bzip2', 'cmake', 'patch', 'which',
42-
'xz', 'libtool', 'gettext-devel',
43-
'patchelf', 'file',
40+
'xz', 'libtool', 'gettext-devel', 'file',
4441
];
4542

4643
public const TOOLS_ARCH = [

0 commit comments

Comments
 (0)