Skip to content

Commit 61b0972

Browse files
committed
Correct errors from upgrading emscripten
1 parent 92dcce6 commit 61b0972

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

packages/php-wasm/compile/php/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,10 +2232,10 @@ RUN set -euxo pipefail; \
22322232
export JSPI_ADD_IMPORTS=",fd_close"; \
22332233
export JSPI_ADD_EXPORTS=",fd_close"; \
22342234
fi; \
2235-
export ASYNCIFY_FLAGS=" -s ASYNCIFY=2 -sSUPPORT_LONGJMP=wasm -fwasm-exceptions -sJSPI_IMPORTS=js_open_process,js_fd_read,js_waitpid,js_process_status,js_create_input_device,wasm_setsockopt,wasm_shutdown,wasm_close,wasm_recv,__syscall_fcntl64,js_flock,js_release_file_locks,js_waitpid$JSPI_ADD_IMPORTS -sJSPI_EXPORTS=php_wasm_init,wasm_sleep,wasm_read,emscripten_sleep,wasm_sapi_handle_request,wasm_sapi_request_shutdown,wasm_poll_socket,wrap_select,__wrap_select,select,php_pollfd_for,fflush,wasm_popen,wasm_read,wasm_php_exec,run_cli,wasm_recv$JSPI_ADD_EXPORTS -s EXPORTED_RUNTIME_METHODS=ccall,PROXYFS,wasmExports "; \
2235+
export ASYNCIFY_FLAGS=" -s ASYNCIFY=2 -sSUPPORT_LONGJMP=wasm -fwasm-exceptions -sJSPI_IMPORTS=js_open_process,js_fd_read,js_waitpid,js_process_status,js_create_input_device,wasm_setsockopt,wasm_shutdown,wasm_close,wasm_recv,__syscall_fcntl64,js_flock,js_release_file_locks,js_waitpid$JSPI_ADD_IMPORTS -sJSPI_EXPORTS=php_wasm_init,wasm_sleep,wasm_read,emscripten_sleep,wasm_sapi_handle_request,wasm_sapi_request_shutdown,wasm_poll_socket,wrap_select,__wrap_select,select,php_pollfd_for,fflush,wasm_popen,wasm_read,wasm_php_exec,run_cli,wasm_recv,__wasm_call_ctors$JSPI_ADD_EXPORTS -s EXPORTED_RUNTIME_METHODS=ccall,PROXYFS,wasmExports "; \
22362236
echo '#define PLAYGROUND_JSPI 1' > /root/php_wasm_asyncify.h; \
22372237
else \
2238-
export ASYNCIFY_FLAGS=" -s ASYNCIFY=1 -s ASYNCIFY_IGNORE_INDIRECT=1 -s EXPORTED_RUNTIME_METHODS=ccall,PROXYFS,wasmExports,setErrNo $(cat /root/.emcc-php-asyncify-flags) "; \
2238+
export ASYNCIFY_FLAGS=" -s ASYNCIFY=1 -s ASYNCIFY_IGNORE_INDIRECT=1 -s EXPORTED_RUNTIME_METHODS=ccall,PROXYFS,wasmExports $(cat /root/.emcc-php-asyncify-flags) "; \
22392239
echo '' > /root/php_wasm_asyncify.h; \
22402240
fi; \
22412241
export EXPORTED_FUNCTIONS=$'["_exit", \n\

packages/php-wasm/compile/shared/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ const argParser = yargs(process.argv.slice(2))
2929
description: 'Build with DWARF debug information.',
3030
},
3131
WITH_JSPI: {
32-
type: 'boolean',
33-
default: false,
32+
type: 'string',
33+
choices: ['yes', 'no'],
3434
description: 'Build with JSPI support',
3535
},
3636
});

packages/php-wasm/compile/shared/intl/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ RUN cd /root && git apply --no-index /root/php${PHP_VERSION:0:3}*.patch -v
5959
RUN source /root/emsdk/emsdk_env.sh && \
6060
cd php-src && \
6161
emconfigure ./configure \
62+
--host=i386-unknown-freebsd \
6263
--disable-fiber-asm \
6364
--enable-embed \
6465
--disable-cgi \
@@ -126,8 +127,8 @@ RUN set -euxo pipefail; \
126127
cd /root/icu/source; \
127128
mkdir -p /root; \
128129
source /root/emsdk/emsdk_env.sh; \
129-
export CFLAGS="-sSIDE_MODULE -D__x86_64__"; \
130-
export CXXFLAGS="-sSIDE_MODULE -D__x86_64__"; \
130+
export CFLAGS="-fPIC -D__x86_64__"; \
131+
export CXXFLAGS="-fPIC -D__x86_64__"; \
131132

132133
emconfigure ./configure \
133134
--host=i386-unknown-freebsd \
@@ -185,7 +186,7 @@ RUN set -euxo pipefail; \
185186
fi; \
186187

187188
if [ "$WITH_JSPI" = "yes" ]; then \
188-
export EMCC_FLAGS="${EMCC_FLAGS} -sJSPI"; \
189+
export EMCC_FLAGS="${EMCC_FLAGS} -sSUPPORT_LONGJMP=wasm -fwasm-exceptions -sJSPI"; \
189190
else \
190191
export EMCC_FLAGS="${EMCC_FLAGS} -sASYNCIFY -sASYNCIFY_ADVISE"; \
191192
fi; \

packages/php-wasm/compile/xdebug/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ RUN cd /root && git apply --no-index /root/php${PHP_VERSION:0:3}*.patch -v
5353
RUN source /root/emsdk/emsdk_env.sh && \
5454
cd php-src && \
5555
emconfigure ./configure \
56+
--host=i386-unknown-freebsd \
5657
--disable-fiber-asm \
5758
--enable-embed \
5859
--disable-cgi \
@@ -128,7 +129,7 @@ RUN set -euxo pipefail; \
128129
fi; \
129130

130131
if [ "$JSPI" = "yes" ]; then \
131-
export EMCC_FLAGS="${EMCC_FLAGS} -sJSPI -sJSPI_IMPORTS=wasm_recv -sJSPI_EXPORTS=wasm_recv -sSUPPORT_LONGJMP=wasm -fwasm-exceptions "; \
132+
export EMCC_FLAGS="${EMCC_FLAGS} -sSUPPORT_LONGJMP=wasm -fwasm-exceptions -sJSPI -sJSPI_IMPORTS=wasm_recv -sJSPI_EXPORTS=wasm_recv"; \
132133
else \
133134
# execute_internal must be in ASYNCIFY_IMPORTS for Xdebug to trace internal PHP functions.
134135
# This enables async unwinding during breakpoints or stepping inside internal calls.

0 commit comments

Comments
 (0)