Skip to content

Commit 61a9264

Browse files
committed
libraries must link against -lphp dynamic!
1 parent 4a70f26 commit 61a9264

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

bin/spc-alpine-docker

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ RUN apk update; \
8484
wget \
8585
xz \
8686
gettext-dev \
87-
binutils-gold
87+
binutils-gold \
88+
patchelf
8889
8990
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 && \
9091
chmod +x /usr/local/bin/php

bin/spc-gnu-docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ echo 'CC=/opt/rh/devtoolset-10/root/usr/bin/gcc' > /tmp/spc-gnu-docker.env
141141
echo 'CXX=/opt/rh/devtoolset-10/root/usr/bin/g++' >> /tmp/spc-gnu-docker.env
142142
echo 'AR=/opt/rh/devtoolset-10/root/usr/bin/ar' >> /tmp/spc-gnu-docker.env
143143
echo 'LD=/opt/rh/devtoolset-10/root/usr/bin/ld' >> /tmp/spc-gnu-docker.env
144-
echo 'SPC_DEFAULT_C_FLAGS=-fPIE -fPIC' >> /tmp/spc-gnu-docker.env
144+
echo 'SPC_DEFAULT_C_FLAGS=-fPIC' >> /tmp/spc-gnu-docker.env
145145
echo 'SPC_LIBC=glibc' >> /tmp/spc-gnu-docker.env
146146
echo 'SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-Wl,-O1 -pie"' >> /tmp/spc-gnu-docker.env
147147
echo 'SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm -lresolv -lutil -lrt"' >> /tmp/spc-gnu-docker.env

src/SPC/builder/Extension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ protected function getStaticAndSharedLibs(): array
503503
continue;
504504
}
505505
$static_lib = 'lib' . $lib . '.a';
506-
if (file_exists(BUILD_LIB_PATH . '/' . $static_lib)) {
506+
if (file_exists(BUILD_LIB_PATH . '/' . $static_lib) && !str_contains($static_lib, 'libphp')) {
507507
if (!str_contains($staticLibString, '-l' . $lib . ' ')) {
508508
$staticLibString .= '-l' . $lib . ' ';
509509
}

0 commit comments

Comments
 (0)