Skip to content

Guest C custom sections containing component types#347

Merged
pchickey merged 11 commits intobytecodealliance:mainfrom
pchickey:guest_c_custom_sections
Oct 5, 2022
Merged

Guest C custom sections containing component types#347
pchickey merged 11 commits intobytecodealliance:mainfrom
pchickey:guest_c_custom_sections

Conversation

@pchickey
Copy link
Contributor

@pchickey pchickey commented Oct 5, 2022

Adds the custom section component types generation to the guest C generator.

Also tests that TeaVM guests can be translated to components as well. In the TeaVM case, we explicitly pass the imports and export interface to the ComponentEncoder.

I added stub functions to the WASI adapter for the additional functions required by wasi-libc and the TeaVM guests.

@pchickey pchickey force-pushed the guest_c_custom_sections branch from 0c6b397 to 2ec0c0b Compare October 5, 2022 01:56
@alexcrichton
Copy link
Member

Nice! This looks great to me 👍

Pat Hickey added 6 commits October 5, 2022 10:39
so that I can use it in all these structs that derive Default which
peter likes to use as a constructor. Its a nice pattern tbh
and use some symbol trickery to try to get it linked into the final
binary
wasi-libc ends up always importing these for stdio vtables
@pchickey pchickey force-pushed the guest_c_custom_sections branch from 4eda9f8 to 3a92b74 Compare October 5, 2022 17:45
@pchickey pchickey marked this pull request as ready for review October 5, 2022 17:45
@pchickey
Copy link
Contributor Author

pchickey commented Oct 5, 2022

31b737c cc @dicej, manually passing in the interfaces used by the TeaVM guests in test-helpers/build.rs is good enough for now, at some point it would be nice if the code generator put them in custom sections like we do for Rust and C, but its not urgent.

@dicej
Copy link
Collaborator

dicej commented Oct 5, 2022

31b737c cc @dicej, manually passing in the interfaces used by the TeaVM guests in test-helpers/build.rs is good enough for now, at some point it would be nice if the code generator put them in custom sections like we do for Rust and C, but its not urgent.

Thanks for the heads up. It shouldn't be hard to do in TeaVM -- I'll take a look when I have some time.

@pchickey pchickey merged commit 142b10f into bytecodealliance:main Oct 5, 2022
@pchickey pchickey deleted the guest_c_custom_sections branch October 5, 2022 23:43
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.

3 participants