Skip to content

[WASM] Link start/stop symbol weakly #21

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

Conversation

kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented Dec 14, 2019

This PR fixed my runtime implmentation in SwiftRT.
I've inserted dummy char data in each metadata sections to ensure that all start/stop symbols are generated in #11. But of cource this dummy data can be inserted anywhere in the section, so metadata sections were broken by this 1 byte.

I changed to link these start/stop symbols weakly. Non-generated start/stop variables get to be uninitialized. So stop-start results 0 length, and runtime library can avoid to load empty section.

After this and #6 are merged, print("Hello") will work again! 🎉

@kateinoigakukun kateinoigakukun marked this pull request as ready for review December 14, 2019 07:47
Copy link

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

🎉

@MaxDesiatov MaxDesiatov merged commit cb3c0eb into swiftwasm:swiftwasm Dec 14, 2019
@kateinoigakukun
Copy link
Member Author

Thanks! Now, I'm rebasing swiftwasm branch 👍

kateinoigakukun added a commit that referenced this pull request Dec 15, 2019
This PR fixed my runtime implementation in SwiftRT.
I've inserted dummy `char` data in each metadata sections to ensure that all start/stop symbols are generated in #11. But of cource this dummy data can be inserted anywhere in the section, so metadata sections were broken by this 1 byte.

I changed to link these start/stop symbols weakly. Non-generated start/stop variables get to be uninitialized. So `stop-start` results 0 length, and runtime library can avoid to load empty section.

After this and #6 are merged, `print("Hello")` will work again! 🎉
kateinoigakukun added a commit that referenced this pull request Jan 11, 2020
This PR fixed my runtime implementation in SwiftRT.
I've inserted dummy `char` data in each metadata sections to ensure that all start/stop symbols are generated in #11. But of cource this dummy data can be inserted anywhere in the section, so metadata sections were broken by this 1 byte.

I changed to link these start/stop symbols weakly. Non-generated start/stop variables get to be uninitialized. So `stop-start` results 0 length, and runtime library can avoid to load empty section.

After this and #6 are merged, `print("Hello")` will work again! 🎉
@kateinoigakukun kateinoigakukun deleted the katei/fix-dummy-char-adjustment branch January 28, 2020 12:42
MaxDesiatov pushed a commit that referenced this pull request Jan 29, 2020
This PR fixed my runtime implementation in SwiftRT.
I've inserted dummy `char` data in each metadata sections to ensure that all start/stop symbols are generated in #11. But of cource this dummy data can be inserted anywhere in the section, so metadata sections were broken by this 1 byte.

I changed to link these start/stop symbols weakly. Non-generated start/stop variables get to be uninitialized. So `stop-start` results 0 length, and runtime library can avoid to load empty section.

After this and #6 are merged, `print("Hello")` will work again! 🎉
MaxDesiatov pushed a commit that referenced this pull request Jan 29, 2020
[pull] swiftwasm from apple:master
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