Skip to content
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

Use exported memory when building a MAIN_MODULE. NFC #22332

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Aug 7, 2024

Side modules import the memory but the main module should export it.

Side modules import the memory but the main module should export it.
@sbc100 sbc100 requested a review from kripken August 7, 2024 22:49
@sbc100 sbc100 marked this pull request as draft August 7, 2024 23:03
@sbc100
Copy link
Collaborator Author

sbc100 commented Aug 7, 2024

Marking as draft since I think this might be more complex that i thought.

I'm think as long as we are buiding the main module as PIC the linker cannot create the memory since it doesn't know how much space it needs to use.

@@ -315,8 +312,6 @@ var LibraryDylink = {
} else if (typeof value == 'bigint') {
entry.value = value;
#endif
} else {
throw new Error(`bad export type for '${symName}': ${typeof value}`);
Copy link
Member

Choose a reason for hiding this comment

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

I am guessing these changes are to do with handling a Memory export. But I see only removals. Where is the code that handles it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This should should just ignore exports such as memories and tables. Its only interesting in handling globals and functions.

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