Skip to content

Commit d131ee1

Browse files
authored
Update calling convention for jl_create_native (#397)
* Update calling convention for jl_create_native * Update CI to include 1.9
1 parent b9c269f commit d131ee1

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
version: ['1.6', '1.7', '^1.8.0-beta3']
16+
version: ['1.6', '1.7', '1.8', '^1.9.0-beta3']
1717
os: [ubuntu-latest, macOS-latest, windows-latest]
1818
arch: [x64]
1919
steps:
@@ -48,7 +48,7 @@ jobs:
4848
strategy:
4949
fail-fast: false
5050
matrix:
51-
branch: ['release-1.7', 'release-1.8', 'master']
51+
branch: ['release-1.7', 'release-1.8', 'release-1.9', 'master']
5252
os: [ubuntu-latest, macOS-latest]
5353
arch: [x64]
5454
steps:

src/jlgen.jl

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,21 @@ function compile_method_instance(@nospecialize(job::CompilerJob),
400400
Metadata(ConstantInt(DEBUG_METADATA_VERSION(); ctx=unwrap_context(ctx)))
401401

402402
ts_mod = ThreadSafeModule(mod; ctx)
403-
ccall(:jl_create_native, Ptr{Cvoid},
404-
(Vector{MethodInstance}, LLVM.API.LLVMOrcThreadSafeModuleRef, Ptr{Base.CodegenParams}, Cint),
405-
[method_instance], ts_mod, Ref(params), #=extern policy=# 1)
403+
# 1.9.0-alpha1.55 added external_linkage
404+
# 1.9.0-alpha1.33 added imaging_mode
405+
# 1.9.0-beta4.23 added world
406+
if VERSION >= v"1.9.0-beta4.23"
407+
ccall(:jl_create_native, Ptr{Cvoid},
408+
(Vector{MethodInstance}, LLVM.API.LLVMOrcThreadSafeModuleRef, Ptr{Base.CodegenParams},
409+
Cint, Cint, Cint, Csize_t),
410+
[method_instance], ts_mod, Ref(params),
411+
#=extern policy=# 1, #=imaging mode=# 0, #=external linkage=# 0,
412+
Base.get_world_counter()) # TODO: Fixme
413+
else
414+
ccall(:jl_create_native, Ptr{Cvoid},
415+
(Vector{MethodInstance}, LLVM.API.LLVMOrcThreadSafeModuleRef, Ptr{Base.CodegenParams}, Cint),
416+
[method_instance], ts_mod, Ref(params), #=extern policy=# 1)
417+
end
406418
elseif VERSION >= v"1.9.0-DEV.115"
407419
ccall(:jl_create_native, Ptr{Cvoid},
408420
(Vector{MethodInstance}, LLVM.API.LLVMContextRef, Ptr{Base.CodegenParams}, Cint),

0 commit comments

Comments
 (0)