Skip to content

Conversation

@mho22
Copy link
Collaborator

@mho22 mho22 commented Dec 29, 2025

Motivation for the change, related issues

TBD

Implementation details

TBD

Testing Instructions (or ideally a Blueprint)

CI

@mho22
Copy link
Collaborator Author

mho22 commented Dec 30, 2025

Recompiling PHP with MAIN_MODULE=2 implies linking it with every shared libraries used.

Meaning :

	emcc $OPTIMIZATION_FLAGS \
	--js-library /root/phpwasm-emscripten-library.js \
	--js-library /root/phpwasm-emscripten-library-dynamic-linking.js \
	--js-library /root/phpwasm-emscripten-library-known-undefined-functions.js \
	$PLATFORM_SPECIFIC_ARGS \
	-I .  \
	-I ext   \
	-I ext/json   \
	-I Zend  \
	-I main  \
	-I TSRM/ \
	-I/root/lib -I/root/lib/include \
	-L/root/lib -L/root/lib/lib/ \
	-D__x86_64__\
	-lproxyfs.js \
	$ASYNCIFY_FLAGS \
	$(cat /root/.emcc-php-wasm-flags) \
+	/root/extensions/intl.so \
+	/root/extensions/xdebug.so \
	-s MAIN_MODULE=2 \
	-s EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS" \

This means I will need to access node-builds and web-builds inside this Dockerfile.

Another error is related to getpid. I replaced __wrap_getpid with getpid. But this can possibly break file locking.

@mho22
Copy link
Collaborator Author

mho22 commented Dec 30, 2025

It basically moved the 4-5Mb from .wasm to .js file. Not really what I expected. But I now understand how things should work.

@mho22 mho22 force-pushed the set-main-module-2 branch from 1af6fbf to 4ef1b86 Compare January 5, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants