Skip to content

Tag kernel binaries with target and transformation stage and check if binary is appropriate when loading #61233

@alexmarkov

Description

@alexmarkov

Kernel binaries are very flexible and serve many different purposes: they can be used by different back-ends, certain tools and consumed by the front-end. However, kernel files are not universal: kernel binary generated for one back-end cannot be used by another; kernel binary after whole-program transformations can only be consumed by AOT compiler and cannot be used by the front-end etc.

It would be nice to add certain information about target/stage/purpose of the kernel binary into the Component header. The following would be useful:

  • name of the target (back-end);
  • whether kernel can be consumed by the front-end;
  • whether it is full (contains core libraries) or partial;
  • whether it was transformed with whole-program transformations.

After adding that information we can add user-friendly error messages when user attempts to use incorrect kernel binary, for example when feeding AOT kernel binary back to the front-end (happened recently).

@johnniwinther @jensjoha WDYT?

/cc @sigmundch

Metadata

Metadata

Assignees

Labels

area-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.cfe-encodingsEncoding related CFE issues.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions