Closed MasonProtter closed 3 years ago
This code different but macOS has some problems with StaticCompiler. Is the error the same as the one in this issue? : https://github.com/tshort/StaticCompiler.jl/issues/13
The error is:
julia> LLVM.verify(m) #barfs a big error
ERROR: LLVM error: Global is referenced in a different module!
Out of curiosity, if the goal is to write this to a file (like in the README), is code_llvm
(with dump_module=true
) insufficient? Is the problem that code_llvm
produces more references to Julia, like @jl_gc_pool_alloc
?
For context, this problem was raised because I was trying to statically compile a function which included a StepRange
in an intermediate computation, and I was able to trim it down to just the pure case of returning a step-range.
I can reproduce. It also fails with irgen(bar, Tuple{}, overdub = false)
. I'll try to dig into this over the weekend.
@chriselrod, code_llvm
is insufficient for the reason you state, and for me, I need to cross compile, and code_llvm
doesn't allow you to set the target.
This is a tough type of bug. I can only reproduce it on 1 out of 4 of my systems. bar()
compiles and verifies fine on all but one.
Processor | OS | Julia binary | Fails (Y/N) |
---|---|---|---|
SkyLake | Windows 10 1809 | Windows | N |
SkyLake | Ubuntu 19.04 under Hyper-V | Linux | N |
Haswell | Windows 10 1809 | Windows | Y |
Haswell | Windows subsystem for Linux | Linux | N |
The one failure is with verify
with the same error message that @chriselrod reported. All these are with Julia v1.3.1 with the latest master of StaticCompiler.
I don't have access to macOS.
Curious issue here: