Skip to content

[jit] Add standalone C++ headers for AOT function entrypoints - #4824

Closed
tilir wants to merge 1 commit into
google:mainfrom
tilir:aot-compiler-header
Closed

tilir wants to merge 1 commit into
google:mainfrom
tilir:aot-compiler-header

Conversation

@tilir

@tilir tilir commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

This change adds optional generation of a self-contained C++20 header for AOT-compiled function entrypoints.

The generated header describes the packed ABI using standard C++ types and constants derived from the AOT entrypoint metadata. It also provides a C++ declaration for the generated packed function, allowing the AOT object to be consumed without parsing AotPackageEntrypointsProto at runtime or manually reproducing ABI details in the caller.

The header generation is exposed through a new aot_compiler_main option and is intended to complement the existing object and proto/textproto outputs.

Fixes #4823

This change adds optional generation of a self-contained C++20 header for AOT-compiled function entrypoints.

The generated header describes the packed ABI using standard C++ types and constants derived from the AOT entrypoint metadata. It also provides a C++ declaration for the generated packed function, allowing the AOT object to be consumed without parsing AotPackageEntrypointsProto at runtime or manually reproducing ABI details in the caller.

The header generation is exposed through a new aot_compiler_main option and is intended to complement the existing object and proto/textproto outputs.

Fixes google#4823
@allight

allight commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

See comment in #4823. This is not a feature we need. For functions the wrapper already provides access to the bit-packed entry points in a way that abstracts the internal details of how exactly our compiler works with essentially no overhead.

Furthermore, we absolutely should not be doing text templating like this in C++. We generally use python an Jinja to handle c++ code generation for things like this.

@tilir

tilir commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Closing this for now while I take a closer look at the existing JIT wrapper mechanism discussed in #4823.

Thanks for pointing me in the right direction. If I find that my use case still requires something not covered by the current mechanism, I'll come back with a more focused proposal.

@tilir tilir closed this Aug 24, 2026
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.

[enhancement] Generate C++ headers for AOT entrypoints

2 participants