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

[NativeAOT-LLVM] LLVM version synchronization and verification #2599

Open
SingleAccretion opened this issue May 29, 2024 · 0 comments
Open
Labels
area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly)

Comments

@SingleAccretion
Copy link

SingleAccretion commented May 29, 2024

We are using LLVM in three places:

  1. In the compiler, to produce bitcode. The LLVM version used here is defined by what llvm-project commit we fetch in CI. I'll call this version VP.
  2. In the runtime build, to compile the native runtime code. The LLVM version used here is defined by the [EM|WASI-]SDK version we download in CI. I'll call this version VR.
  3. In the build, we use the [EM|WASI-]SDK clang to compile this bitcode. The LLVM version used here is defined by the SDK version installed on the user's machine. I'll call this version VC.

The compatibility relationship between these versions, taking into account the fact that older LLVM bitcode can be consumed by newer LLVM versions (generally speaking), is VP <= VR == VC. VR must be equal to VC because VC is what defines the "toolchain version" of the overall static link.

We should add tests and diagnostics that verify this:

  1. Warn the user if the SDK version doesn't match one the runtime objects were compiled against.
  2. Fail the runtime build if llvm-project's LLVM version > SDK's LLVM version.
@jkotas jkotas added the area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly) label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly)
Projects
None yet
Development

No branches or pull requests

2 participants