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 C++ inside enclaves #492

Merged
merged 1 commit into from
Oct 11, 2021
Merged

Use C++ inside enclaves #492

merged 1 commit into from
Oct 11, 2021

Conversation

csegarragonz
Copy link
Collaborator

@csegarragonz csegarragonz commented Oct 11, 2021

At the moment, we were using C code (or C language linkage) for anything under the src/sgx directory. This is not really needed.

According to the SGX reference, enclave code can be written in both C and C++. However, special rules apply for ECalls and OCalls. Citing the developer reference:

  • Enclave interface functions are limited to C (no C++). (p.26, table)
  • OCALL functions must be C functions, or C++ functions with C linkage. (p.31)

The diff is very large, but mostly due to indentation issues.

@csegarragonz csegarragonz self-assigned this Oct 11, 2021
@csegarragonz csegarragonz marked this pull request as ready for review October 11, 2021 09:38
@csegarragonz csegarragonz marked this pull request as draft October 11, 2021 09:46
@csegarragonz csegarragonz changed the title Use C++ inside enclaves Use C++ inside enclaves + Update native symbol registration Oct 11, 2021
@csegarragonz csegarragonz changed the title Use C++ inside enclaves + Update native symbol registration Use C++ inside enclaves Oct 11, 2021
@csegarragonz csegarragonz marked this pull request as ready for review October 11, 2021 10:30
@csegarragonz csegarragonz added the wasm/wamr-sgx SGX related stuff. label Oct 11, 2021
Copy link
Collaborator

@Shillaker Shillaker left a comment

Choose a reason for hiding this comment

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

Cool, makes sense 👍

@csegarragonz csegarragonz merged commit 43ff9a6 into master Oct 11, 2021
@csegarragonz csegarragonz deleted the move-to-cpp branch October 11, 2021 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasm/wamr-sgx SGX related stuff.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants