Skip to content

Conversation

@mho22
Copy link
Collaborator

@mho22 mho22 commented Nov 17, 2025

Motivation for the change

We need this pull request in order for our PHP.wasm build to be built without RELOCATABLE and avoid size increases when building with MAIN_MODULE. The pull request is in 4.0.19 release.

Implementation details

PHP.wasm

  • Modified emscripten version in base-image Dockerfile.
  • Removed setErrNo and malloc from EXPORT_RUNTIME_FUNCTIONS
  • Replaced setErrNo by __errno_location in phpwasm-emscripten-library
  • Replaced PHPLoader["free"] with _free in phpwasm-emscripten-library
  • Bound wasmExports['free'] in PHPLoader['free']
  • Bound wasmExports['malloc'] in PHPLoader['malloc']
  • Removed fd_close from JSPI_IMPORTS and JSPI_EXPORTS due to SuspendError: trying to suspend JS frames
  • Ignored default.profraw file in .gitignore
  • Added __funcs_on_exit function in JSPI_EXPORTS for PHP7.4 and PHP7.3
  • Modified patches related to signature mismatch in zend_list_free_wrapper in PHP7.4 and PHP7.3
✅ make all
✅ node_modules/.bin/nx reset && npm run recompile:php:node:jspi:all
✅ node_modules/.bin/nx reset && node_modules/.bin/nx run php-wasm-compile:xdebug:jspi:all
✅ node_modules/.bin/nx reset && node_modules/.bin/nx run php-wasm-compile-shared:intl:jspi:all 

🟡 node_modules/.bin/nx reset && npm run recompile:php:node:asyncify:all
〇 node_modules/.bin/nx reset && node_modules/.bin/nx run php-wasm-compile:xdebug:asyncify:all
〇 node_modules/.bin/nx reset && node_modules/.bin/nx run php-wasm-compile-shared:intl:asyncify:all

〇 node_modules/.bin/nx reset && npm run recompile:php:web:jspi:all
〇 node_modules/.bin/nx reset && npm run recompile:php:web:asyncify:all

Testing Instructions (or ideally a Blueprint)

CI

@mho22 mho22 force-pushed the upgrade-emscripten-version-to-nineteen branch from 9d08def to 0c23c20 Compare November 18, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants