-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
"LLVM ERROR: Broken module found, compilation aborted!" when compiling a sysimage with a ccallable function and a certain cpu target #34064
Comments
On the backport 1.3.1 branch I got
|
Here is an MWE without PackageCompilerX. It seems that the combination for this to occur is:
function get_julia_cmd()
julia_path = joinpath(Sys.BINDIR, Base.julia_exename())
cmd = `$julia_path --color=yes --startup-file=no`
end
sysimg_source_path = Base.find_source_file("sysimg.jl")
base_dir = dirname(sysimg_source_path)
tmp_corecompiler_ji = joinpath(@__DIR__, "corecompiler.ji")
tmp_sys_ji = joinpath(@__DIR__, "sys.ji")
compiler_source_path = joinpath(base_dir, "compiler", "compiler.jl")
cd(base_dir) do
# Create corecompiler.ji
cmd = `$(get_julia_cmd()) --output-ji $tmp_corecompiler_ji
-g0 -O0 $compiler_source_path`
run(cmd)
# Use that to create sys.ji
cmd = `$(get_julia_cmd()) --sysimage=$tmp_corecompiler_ji
-g1 -O0 --output-ji=$tmp_sys_ji $sysimg_source_path`
run(cmd)
end
app_content = """
Base.@ccallable function julia_main()::Cint
return 0
end
"""
# Create the sysimage
cmd = `$(get_julia_cmd()) --sysimage=$tmp_sys_ji --cpu-target='generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)'
--output-o=sys.o -e $app_content`
run(cmd) |
A workaround is to first create an empty dylib sysimage from |
Still failing, now with:
|
Possibly we might need https://github.com/JuliaLang/julia/tree/jn/localize-multiversioning for that (though it doesn't currently include the fix) |
Seeing this in #37510 in various forms:
and
|
Looks like the same thing since that PR also uses |
When trying to change the cpu target used when generating "apps" in PackageCompiler (JuliaLang/PackageCompilerX.jl#43) with the "app" at (https://github.com/KristofferC/PackageCompilerX.jl/blob/master/examples/MyApp/src/MyApp.jl) I hit the following CI error
Linux (https://travis-ci.com/KristofferC/PackageCompilerX.jl/jobs/265321335#L264-L267):
Mac (https://travis-ci.com/KristofferC/PackageCompilerX.jl/jobs/265321336#L197-L212);
It can be reprod on the linked branch above with pwd in the root git repo and running:
Note that
incremental=false
seems to be needed (which means that a new sysimage is bootstrapped from scratch (corecompiler.ji
->sys.ji
->sys.o
).I can reduce it to just a set of raw commands if that would be helpful.
The text was updated successfully, but these errors were encountered: