Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Nov 5, 2025

The bug here was the BINARYEN_FEATURES was been stashed right away after linking and then used unmodified for future binaryen calls.

Fixes: #25479

@sbc100 sbc100 requested review from juj and kripken November 5, 2025 00:14
@sbc100
Copy link
Collaborator Author

sbc100 commented Nov 5, 2025

Depends on #25718

Copy link
Collaborator

@juj juj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@sbc100 sbc100 force-pushed the data_count branch 4 times, most recently from f285fef to 2dd506a Compare November 5, 2025 16:54
@sbc100 sbc100 requested a review from juj November 5, 2025 16:54
@sbc100
Copy link
Collaborator Author

sbc100 commented Nov 5, 2025

Rebased

self.emcc('hello_world.c', ['-O3', '-o', 'bulk.js'])
self.assertTrue(has_data_count('bulk.wasm'))

self.emcc('hello_world.c', ['-O3', '-o', 'nobulk.js', '-mno-bulk-memory', '-mno-bulk-memory-opt'])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it might make sense to test the '-mno-bulk-memory' and '-mno-bulk-memory-opt' separately?

IIUC '-mno-bulk-memory' implies '-mno-bulk-memory-opt'?

So self.emcc('hello_world.c', ['-O3', '-o', 'nobulk.js', '-mno-bulk-memory'] should not get bulk memory either?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC '-mno-bulk-memory' implies '-mno-bulk-memory-opt'?

From the LLVM POV, I'm not sure it does sadly.

The bug here was the `binaryen_features` was been stashed right away after
linking and then used unmodified for future binaryen calls.

Fixes: emscripten-core#25479
@sbc100 sbc100 enabled auto-merge (squash) November 5, 2025 17:34
@sbc100 sbc100 merged commit 8f354ae into emscripten-core:main Nov 5, 2025
34 checks passed
@sbc100 sbc100 deleted the data_count branch November 5, 2025 19:29
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.

Bulk memory is enabled in -O3 even when asked not to.

2 participants