Skip to content

Conversation

@xdoardo
Copy link
Collaborator

@xdoardo xdoardo commented Jun 5, 2025

This PR introduces a new __builtin_cheriot_sealing_type built-in command in clang, that should replace the CHERIOT_EMIT_STATIC_SEALING_TYPE macro, as referenced in #6. Its syntax resembles that of a call to a C++ template function:

__builtin_cheriot_sealing_type<MySealingType>()

Of course, it can be used in plain C as well, with the same syntax.

The side effects of this call is that two new entries,

__import.sealing_type.<current_compartment>.MySealingType

and

__export.sealing_type.<current_compartment>.MySealingType

are generated, respectively in the .compartment_imports and .compartment_exports sections. The value of the import is a sequence of two words, the address of the export and 0; the value of the export reproduces the value generated in the original macro.

@davidchisnall
Copy link

I am a bit confused by this. This builtin needs to take an identifier not a type. The same type can be used for two kinds of sealed value.

@xdoardo xdoardo closed this Jun 5, 2025
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