Skip to content

Commit 9041ec4

Browse files
committedMar 4, 2025
Update build scripts
1 parent c98048d commit 9041ec4

8 files changed

+48
-16
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ config.h.in
133133
/scripts/phpize
134134
php
135135
php.wasm
136+
php-eh.wasm
136137

137138
# ------------------------------------------------------------------------------
138139
# Lexer files generated by re2c

‎wasix-build-eh.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ set -eou
55
make -j16
66

77
wasm-opt -O3 \
8+
--experimental-new-eh \
9+
--no-validation \
10+
--all-features \
11+
--strip-debug \
812
--asyncify \
913
--pass-arg=asyncify-imports@wasix_32v1.proc_snapshot \
1014
--pass-arg=asyncify-ignore-indirect \
11-
-pa max-func-params@32 \
12-
sapi/cli/php -o sapi/cli/php.wasm
13-
14-
wasm-strip sapi/cli/php.wasm
15+
--pass-arg=max-func-params@32 \
16+
sapi/cli/php -o sapi/cli/php-eh.wasm

‎wasix-build.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ set -eou
44

55
make -j16
66

7-
wasm-opt -O3 --asyncify sapi/cli/php -o sapi/cli/php.wasm -pa max-func-params@32
8-
9-
wasm-strip sapi/cli/php.wasm
7+
wasm-opt -O3 \
8+
--strip-debug \
9+
--asyncify \
10+
--pass-arg=max-func-params@32 \
11+
sapi/cli/php -o sapi/cli/php.wasm

‎wasix-configure.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ export \
4545
PHP_BUILD_SYSTEM="clang(WASIX)" \
4646
PHP_EXTRA_INCLUDES="" \
4747
PHP_IPV6="yes" \
48-
RANLIB=llvm-ranlib-15 \
49-
AR=llvm-ar-15 \
50-
NM=llvm-nm-15 \
51-
CC="clang-15 --target=wasm32-wasi --sysroot=$SYSROOT" \
52-
CXX="clang++-15 --target=wasm32-wasi --sysroot=$SYSROOT" \
48+
RANLIB=llvm-ranlib-20 \
49+
AR=llvm-ar-20 \
50+
NM=llvm-nm-20 \
51+
CC="clang-20 --target=wasm32-wasi --sysroot=$SYSROOT" \
52+
CXX="clang++-20 --target=wasm32-wasi --sysroot=$SYSROOT" \
5353
CFLAGS="-matomics -mbulk-memory -mmutable-globals -pthread -mthread-model posix -ftls-model=local-exec \
5454
-fno-trapping-math -D_WASI_EMULATED_MMAN -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_PROCESS_CLOCKS \
5555
-g -flto -O2" \
@@ -59,7 +59,8 @@ export \
5959
LIBS="-Wl,--shared-memory -Wl,--max-memory=4294967296 -Wl,--import-memory -Wl,--export-dynamic \
6060
-Wl,--export=__heap_base -Wl,--export=__stack_pointer -Wl,--export=__data_end -Wl,--export=__wasm_init_tls \
6161
-Wl,--export=__wasm_signal -Wl,--export=__tls_size -Wl,--export=__tls_align -Wl,--export=__tls_base \
62-
-lwasi-emulated-mman -flto -g -Wl,-z,stack-size=8388608 -Wl,--error-limit=0 -L$PHP_WASIX_DEPS/lib -v"
62+
-lwasi-emulated-mman -flto -g -Wl,-z,stack-size=8388608 -Wl,--error-limit=0 -L$PHP_WASIX_DEPS/lib -v \
63+
--no-wasm-opt"
6364

6465
./buildconf --force
6566

‎wasix-execute-eh.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
set -eo
44

55
wasmer run sapi/cli/php-eh.wasm \
6-
--singlepass \
6+
--llvm \
77
--net \
88
--mapdir /app:../wordpress \
99
--mapdir /etc/ssl:../php-wasix-deps/openssl/ssl \
1010
--mapdir /icu:../php-wasix-deps/icu \
1111
--env SSL_CERT_DIR=/etc/ssl/certs \
12-
--env PHP_CLI_SERVER_WORKERS=3 \
12+
--env OPENSSL_CONF=/etc/ssl/openssl.cnf \
13+
--use amin/bash \
14+
--forward-host-env \
1315
-- \
1416
-S localhost:8080 \
1517
-t /app \

‎wasix-execute.sh

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ wasmer run sapi/cli/php.wasm \
99
--mapdir /etc/ssl:../php-wasix-deps/openssl/ssl \
1010
--mapdir /icu:../php-wasix-deps/icu \
1111
--env SSL_CERT_DIR=/etc/ssl/certs \
12+
--use amin/bash \
13+
--forward-host-env \
1214
--env PHP_CLI_SERVER_WORKERS=3 \
1315
-- \
1416
-S localhost:8080 \

‎wasmer-eh.toml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[package]
2+
name = 'php/php-eh'
3+
version = '8.3.404-beta.4'
4+
description = 'PHP with wasm exception handling support'
5+
readme = 'README.md'
6+
7+
# See more keys and definitions at https://docs.wasmer.io/registry/manifest
8+
9+
[dependencies]
10+
11+
[[module]]
12+
name = 'php'
13+
source = 'sapi/cli/php-eh.wasm'
14+
abi = 'wasi'
15+
16+
[[command]]
17+
name = 'php'
18+
module = 'php'
19+
20+
[fs]
21+
"/etc/ssl" = "../php-wasix-deps/openssl/ssl"
22+
"/icu" = "../php-wasix-deps/icu"

‎wasmer.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = 'php/php'
3-
version = '8.3.402'
3+
version = '8.3.404-beta.4'
44
description = 'PHP is a popular general-purpose scripting language that is especially suited to web development. Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world. PHP is distributed under the PHP License v3.01.'
55
readme = 'README.md'
66

0 commit comments

Comments
 (0)
Please sign in to comment.