-
Notifications
You must be signed in to change notification settings - Fork 0
Prepare for exnref native build #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,13 +4,36 @@ set -eou | |
|
|
||
| make -j16 | ||
|
|
||
| wasm-opt -O3 \ | ||
| --emit-exnref \ | ||
| # Some wasm-opt passes are not compatible with EH. | ||
| # When generating debug info, we don't need to disable them but without debug info we do, otherwise wasm-opt crashes. | ||
| # The offending passes are flatten, dae-optimizing and inlining-optimizing. | ||
|
|
||
| # First asyncify while preserving debug info | ||
| # O4 is only here for good measure, the important part is asyncify | ||
| wasm-opt -g \ | ||
| -O4 \ | ||
| --no-validation \ | ||
| --all-features \ | ||
| --strip-debug \ | ||
| --disable-gc \ | ||
| --closed-world \ | ||
| --skip-pass=flatten \ | ||
| --skip-pass=dae-optimizing \ | ||
| --skip-pass=inlining-optimizing \ | ||
| --asyncify \ | ||
| --pass-arg=asyncify-imports@wasix_32v1.proc_snapshot \ | ||
| --pass-arg=asyncify-ignore-indirect \ | ||
| --pass-arg=max-func-params@32 \ | ||
| sapi/cli/php -o sapi/cli/php.wasm | ||
| sapi/cli/php -o sapi/cli/php-debug.wasm | ||
|
|
||
| # A second wasm-opt run for stripping debug | ||
| # info and running full O4 | ||
| wasm-opt --strip-debug \ | ||
| -O4 \ | ||
| --no-validation \ | ||
| --all-features \ | ||
| --disable-gc \ | ||
| --closed-world \ | ||
| --skip-pass=flatten \ | ||
| --skip-pass=dae-optimizing \ | ||
| --skip-pass=inlining-optimizing \ | ||
| sapi/cli/php-debug.wasm -o sapi/cli/php.wasm | ||
|
Comment on lines
+28
to
+39
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -48,9 +48,9 @@ export \ | |||||
| NM="wasixnm" \ | ||||||
| CC="wasixcc" \ | ||||||
| CXX="wasixcc++" \ | ||||||
| CFLAGS="-g -flto -O2" \ | ||||||
| CXXFLAGS="-g -flto -O2" \ | ||||||
| LIBS="-L$PHP_WASIX_DEPS/lib-eh --no-wasm-opt" \ | ||||||
| CFLAGS="-g -flto -O4" \ | ||||||
| CXXFLAGS="-g -flto -O4" \ | ||||||
| LIBS="-L$PHP_WASIX_DEPS/lib-eh --no-wasm-opt -g -flto -O4" \ | ||||||
|
||||||
| LIBS="-L$PHP_WASIX_DEPS/lib-eh --no-wasm-opt -g -flto -O4" \ | |
| LIBS="-L$PHP_WASIX_DEPS/lib-eh --no-wasm-opt" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment states that passes need to be disabled "without debug info" to avoid crashes, but in the actual implementation below, these passes are skipped in BOTH wasm-opt runs (both the one WITH debug info on line 13-26 and the one WITHOUT debug info on line 30-39). This creates an inconsistency between the comment and the implementation. Either the comment should be updated to reflect that passes are always skipped for EH compatibility, or the first wasm-opt run should not skip these passes if they're only problematic without debug info.