This commit is contained in:
William Furr 2025-11-26 11:09:31 +01:00 committed by GitHub
commit ab82c047e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 35 additions and 2 deletions

View File

@ -37,6 +37,19 @@ jobs:
permissions:
contents: read
actions: write
uses: jlumbroso/free-disk-space@v1.3.1
with:
# Deletes Android, Haskell, and .NET runtimes from the runner, freeing
# about 15 GB.
android: true
dotnet: true
haskell: true
# Keeps the tool cache, some large packages, docker images, and swap.
# Some of these could also be removed if more space is needed.
tool-cache: false
large-packages: false
docker-images: false
swap-storage: false
uses: ./.github/workflows/build_llvm_libraries.yml
with:
os: "ubuntu-22.04"

View File

@ -294,7 +294,7 @@ def main():
"arc": {
"repo": "https://github.com/llvm/llvm-project.git",
"repo_ssh": "git@github.com:llvm/llvm-project.git",
"branch": "release/18.x",
"branch": "release/21.x",
},
"xtensa": {
"repo": "https://github.com/espressif/llvm-project.git",
@ -304,7 +304,7 @@ def main():
"default": {
"repo": "https://github.com/llvm/llvm-project.git",
"repo_ssh": "git@github.com:llvm/llvm-project.git",
"branch": "release/18.x",
"branch": "release/21.x",
},
}

View File

@ -2656,6 +2656,25 @@ aot_create_comp_context(const AOTCompData *comp_data, aot_comp_option_t option)
comp_ctx->comp_data = comp_data;
/* Create LLVM context, module and builder */
#if LLVM_VERSION_MAJOR >= 21
/* Construct an LLVMContext directly, note:
different from non LAZY JIT mode, no need to dispose this context, if
will be disposed when the thread safe context is disposed */
comp_ctx->context = LLVMContextCreate();
if (!comp_ctx->context) {
aot_set_last_error("create LLVM Context failed.");
goto fail;
}
/* Wrap the LLVM context in a thread safe context. */
comp_ctx->orc_thread_safe_context =
LLVMOrcCreateNewThreadSafeContextFromLLVMContext(comp_ctx->context);
if (!comp_ctx->orc_thread_safe_context) {
aot_set_last_error(
"Create LLVM ThreadSafeContext from LLVMContext failed.");
goto fail;
}
#else // LLVM_VERSION_MAJOR < 21
comp_ctx->orc_thread_safe_context = LLVMOrcCreateNewThreadSafeContext();
if (!comp_ctx->orc_thread_safe_context) {
aot_set_last_error("create LLVM ThreadSafeContext failed.");
@ -2670,6 +2689,7 @@ aot_create_comp_context(const AOTCompData *comp_data, aot_comp_option_t option)
aot_set_last_error("get context from LLVM ThreadSafeContext failed.");
goto fail;
}
#endif
if (!(comp_ctx->builder = LLVMCreateBuilderInContext(comp_ctx->context))) {
aot_set_last_error("create LLVM builder failed.");