Skip to content

Commit f549aa8

Browse files
committed
Upgrade libopenssl and libz for PHP 8.4
1 parent 3c8ace8 commit f549aa8

File tree

457 files changed

+93998
-18116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

457 files changed

+93998
-18116
lines changed

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"reset": "nx reset",
2525
"recompile:php": "npm run recompile:php:web && npm run recompile:php:node",
2626
"recompile:php:web:jspi:all": "nx recompile-php:jspi:all php-wasm-web",
27+
"recompile:php:web:jspi:8.4": "nx recompile-php:jspi php-wasm-web -- --PHP_VERSION=8.4 ",
2728
"recompile:php:web:jspi:8.3": "nx recompile-php:jspi php-wasm-web -- --PHP_VERSION=8.3 ",
2829
"recompile:php:web:jspi:8.2": "nx recompile-php:jspi php-wasm-web -- --PHP_VERSION=8.2 ",
2930
"recompile:php:web:jspi:8.1": "nx recompile-php:jspi php-wasm-web -- --PHP_VERSION=8.1 ",
@@ -34,6 +35,7 @@
3435
"recompile:php:web:jspi:7.1": "nx recompile-php:jspi php-wasm-web -- --PHP_VERSION=7.1 ",
3536
"recompile:php:web:jspi:7.0": "nx recompile-php:jspi php-wasm-web -- --PHP_VERSION=7.0 ",
3637
"recompile:php:web:asyncify:all": "nx recompile-php:asyncify:all php-wasm-web",
38+
"recompile:php:web:asyncify:8.4": "nx recompile-php:asyncify php-wasm-web -- --PHP_VERSION=8.4 ",
3739
"recompile:php:web:asyncify:8.3": "nx recompile-php:asyncify php-wasm-web -- --PHP_VERSION=8.3 ",
3840
"recompile:php:web:asyncify:8.2": "nx recompile-php:asyncify php-wasm-web -- --PHP_VERSION=8.2 ",
3941
"recompile:php:web:asyncify:8.1": "nx recompile-php:asyncify php-wasm-web -- --PHP_VERSION=8.1 ",
@@ -45,6 +47,7 @@
4547
"recompile:php:web:asyncify:7.0": "nx recompile-php:asyncify php-wasm-web -- --PHP_VERSION=7.0 ",
4648
"recompile:php:node": "nx recompile-php:all php-wasm-node ",
4749
"recompile:php:node:jspi:all": "nx recompile-php:jspi:all php-wasm-node ",
50+
"recompile:php:node:jspi:8.4": "nx recompile-php:jspi php-wasm-node -- --PHP_VERSION=8.4 ",
4851
"recompile:php:node:jspi:8.3": "nx recompile-php:jspi php-wasm-node -- --PHP_VERSION=8.3 ",
4952
"recompile:php:node:jspi:8.2": "nx recompile-php:jspi php-wasm-node -- --PHP_VERSION=8.2 ",
5053
"recompile:php:node:jspi:8.1": "nx recompile-php:jspi php-wasm-node -- --PHP_VERSION=8.1 ",
@@ -55,6 +58,7 @@
5558
"recompile:php:node:jspi:7.1": "nx recompile-php:jspi php-wasm-node -- --PHP_VERSION=7.1 ",
5659
"recompile:php:node:jspi:7.0": "nx recompile-php:jspi php-wasm-node -- --PHP_VERSION=7.0 ",
5760
"recompile:php:node:asyncify:all": "nx recompile-php:asyncify:all php-wasm-node ",
61+
"recompile:php:node:asyncify:8.4": "nx recompile-php:asyncify php-wasm-node -- --PHP_VERSION=8.4 ",
5862
"recompile:php:node:asyncify:8.3": "nx recompile-php:asyncify php-wasm-node -- --PHP_VERSION=8.3 ",
5963
"recompile:php:node:asyncify:8.2": "nx recompile-php:asyncify php-wasm-node -- --PHP_VERSION=8.2 ",
6064
"recompile:php:node:asyncify:8.1": "nx recompile-php:asyncify php-wasm-node -- --PHP_VERSION=8.1 ",

packages/php-wasm/compile/Makefile

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,37 @@ libxml2/jspi/dist/root/lib/lib/libxml2.a: base-image libz_jspi
110110
docker cp $$(docker create playground-php-wasm:libxml2):/root/lib/lib ./libxml2/jspi/dist/root/lib
111111
docker cp $$(docker create playground-php-wasm:libxml2):/root/lib/include ./libxml2/jspi/dist/root/lib
112112

113-
libopenssl_asyncify: libopenssl/asyncify/dist/root/lib/lib/libssl.a
114-
libopenssl/asyncify/dist/root/lib/lib/libssl.a: base-image libz_asyncify
113+
libopenssl_asyncify: libopenssl/asyncify/dist/1.1.0h/root/lib/lib/libssl.a libopenssl/asyncify/dist/1.1.1/root/lib/lib/libssl.a
114+
115+
libopenssl/asyncify/dist/1.1.0h/root/lib/lib/libssl.a: base-image libz_asyncify
116+
mkdir -p ./libopenssl/asyncify/dist/root/lib
117+
docker build -f ./libopenssl/Dockerfile -t playground-php-wasm:libopenssl-1.1.0h . --build-arg OPENSSL_VERSION=1.1.0h
118+
mkdir -p ./libopenssl/asyncify/dist/1.1.0h/root/lib
119+
docker cp $$(docker create playground-php-wasm:libopenssl-1.1.0h):/root/install/lib ./libopenssl/asyncify/dist/1.1.0h/root/lib
120+
docker cp $$(docker create playground-php-wasm:libopenssl-1.1.0h):/root/install/include ./libopenssl/asyncify/dist/1.1.0h/root/lib
121+
122+
libopenssl/asyncify/dist/1.1.1/root/lib/lib/libssl.a: base-image libz_asyncify
115123
mkdir -p ./libopenssl/asyncify/dist/root/lib
116-
docker build -f ./libopenssl/Dockerfile -t playground-php-wasm:libopenssl .
117-
docker cp $$(docker create playground-php-wasm:libopenssl):/root/install/lib ./libopenssl/asyncify/dist/root/lib
118-
docker cp $$(docker create playground-php-wasm:libopenssl):/root/install/include ./libopenssl/asyncify/dist/root/lib
124+
docker build -f ./libopenssl/Dockerfile -t playground-php-wasm:libopenssl-1.1.1 . --build-arg OPENSSL_VERSION=1.1.1t
125+
mkdir -p ./libopenssl/asyncify/dist/1.1.1/root/lib
126+
docker cp $$(docker create playground-php-wasm:libopenssl-1.1.1):/root/install/lib ./libopenssl/asyncify/dist/1.1.1/root/lib
127+
docker cp $$(docker create playground-php-wasm:libopenssl-1.1.1):/root/install/include ./libopenssl/asyncify/dist/1.1.1/root/lib
128+
129+
libopenssl_jspi: libopenssl/jspi/dist/1.1.0h/root/lib/lib/libssl.a libopenssl/jspi/dist/1.1.1/root/lib/lib/libssl.a
130+
131+
libopenssl/jspi/dist/1.1.0h/root/lib/lib/libssl.a: base-image libz_jspi
132+
mkdir -p ./libopenssl/jspi/dist/root/lib
133+
docker build -f ./libopenssl/Dockerfile -t playground-php-wasm:libopenssl-1.1.0h . --build-arg JSPI=1 --build-arg OPENSSL_VERSION=1.1.0h
134+
mkdir -p ./libopenssl/jspi/dist/1.1.0h/root/lib
135+
docker cp $$(docker create playground-php-wasm:libopenssl-1.1.0h):/root/install/lib ./libopenssl/jspi/dist/1.1.0h/root/lib
136+
docker cp $$(docker create playground-php-wasm:libopenssl-1.1.0h):/root/install/include ./libopenssl/jspi/dist/1.1.0h/root/lib
119137

120-
libopenssl_jspi: libopenssl/jspi/dist/root/lib/lib/libssl.a
121-
libopenssl/jspi/dist/root/lib/lib/libssl.a: base-image libz_jspi
138+
libopenssl/jspi/dist/1.1.1/root/lib/lib/libssl.a: base-image libz_jspi
122139
mkdir -p ./libopenssl/jspi/dist/root/lib
123-
docker build -f ./libopenssl/Dockerfile -t playground-php-wasm:libopenssl . --build-arg JSPI=1
124-
docker cp $$(docker create playground-php-wasm:libopenssl):/root/install/lib ./libopenssl/jspi/dist/root/lib
125-
docker cp $$(docker create playground-php-wasm:libopenssl):/root/install/include ./libopenssl/jspi/dist/root/lib
140+
docker build -f ./libopenssl/Dockerfile -t playground-php-wasm:libopenssl-1.1.1 . --build-arg JSPI=1 --build-arg OPENSSL_VERSION=1.1.1t
141+
mkdir -p ./libopenssl/jspi/dist/1.1.1/root/lib
142+
docker cp $$(docker create playground-php-wasm:libopenssl-1.1.1):/root/install/lib ./libopenssl/jspi/dist/1.1.1/root/lib
143+
docker cp $$(docker create playground-php-wasm:libopenssl-1.1.1):/root/install/include ./libopenssl/jspi/dist/1.1.1/root/lib
126144

127145
libsqlite3_asyncify: libsqlite3/asyncify/dist/root/lib/lib/libsqlite3.a
128146
libsqlite3/asyncify/dist/root/lib/lib/libsqlite3.a: base-image libz_asyncify

packages/php-wasm/compile/build.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ const argParser = yargs(process.argv.slice(2))
116116
description: 'The output directory',
117117
required: true,
118118
},
119+
WITH_OPENSSL_VERSION: {
120+
type: 'string',
121+
choices: ['1.1.0h', '1.1.1'],
122+
description: 'OpenSSL version to use',
123+
default: '1.1.0h',
124+
},
119125
});
120126

121127
const args = argParser.argv;
@@ -185,6 +191,8 @@ await asyncSpawn(
185191
'--build-arg',
186192
getArg('PHP_VERSION'),
187193
'--build-arg',
194+
`OPENSSL_VERSION=${args.WITH_OPENSSL_VERSION || '1.1.0h'}`,
195+
'--build-arg',
188196
getArg('WITH_FILEINFO'),
189197
'--build-arg',
190198
getArg('WITH_LIBXML'),
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM playground-php-wasm:base
22

33
ARG JSPI=0
4+
ARG OPENSSL_VERSION
45

56
RUN mkdir -p /root/lib/include /root/lib/lib
67
COPY ./libz/ /root/libz
@@ -13,23 +14,20 @@ RUN if [ "$JSPI" = "1" ]; then \
1314
RUN /root/copy-lib.sh lib-libz
1415
RUN set -euxo pipefail && \
1516
source /root/emsdk/emsdk_env.sh && \
16-
export OPENSSL_VERSION=1.1.0h && \
1717
wget https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz && \
1818
tar xf openssl-$OPENSSL_VERSION.tar.gz && \
1919
cd openssl-$OPENSSL_VERSION && \
20-
emconfigure ./Configure dist -DHAVE_FORK=0 -DOPENSSL_NO_AFALGENG=1 no-threads --prefix=/root/install;
20+
emconfigure ./Configure -DHAVE_FORK=0 -DOPENSSL_NO_AFALGENG=1 no-threads --prefix=/root/install linux-generic32;
2121

2222
RUN source /root/emsdk/emsdk_env.sh && \
23-
export OPENSSL_VERSION=1.1.0h && \
2423
cd openssl-$OPENSSL_VERSION && \
2524
sed -i 's|^CROSS_COMPILE.*$|CROSS_COMPILE=|g' Makefile && \
2625
export JSPI_FLAGS=$(if [ "$JSPI" = "1" ]; then echo "-sSUPPORT_LONGJMP=wasm -fwasm-exceptions"; else echo ""; fi) && \
2726
EMCC_FLAGS=" -sSIDE_MODULE $JSPI_FLAGS" EMCC_SKIP="-lz" emmake make -j 12 build_generated libssl.a libcrypto.a;
2827

2928
RUN source /root/emsdk/emsdk_env.sh && \
30-
export OPENSSL_VERSION=1.1.0h && \
3129
cd openssl-$OPENSSL_VERSION && \
3230
export JSPI_FLAGS=$(if [ "$JSPI" = "1" ]; then echo "-sSUPPORT_LONGJMP=wasm -fwasm-exceptions"; else echo ""; fi) && \
3331
cp -RL include/openssl /root/lib/include && \
3432
cp libcrypto.a libssl.a /root/lib/lib && \
35-
EMCC_FLAGS=" -sSIDE_MODULE $JSPI_FLAGS" EMCC_SKIP="-lz" emmake make install_sw;
33+
EMCC_FLAGS=" -sSIDE_MODULE $JSPI_FLAGS" EMCC_SKIP="-lz" emmake make install_sw || true;

0 commit comments

Comments
 (0)