Hey everyone,
Am currently trying to compile a bunch of packages with PackageCompiler.jl into bitcode, using Gen.jl as a placeholder package from hereon out.
After looking at a bunch of the documentation, and the doctoring of the create_sysimage
function in PackageCompiler.jl, i.e.
function create_sysimage(packages::Union{Symbol, Vector{String}, Vector{Symbol}}=String[];
sysimage_path::Union{String,Nothing}=nothing,
project::String=dirname(active_project()),
precompile_execution_file::Union{String, Vector{String}}=String[],
precompile_statements_file::Union{String, Vector{String}}=String[],
incremental::Bool=true,
filter_stdlibs=false,
replace_default::Bool=false,
cpu_target::String=NATIVE_CPU_TARGET,
script::Union{Nothing, String}=nothing,
sysimage_build_args::Cmd=``,
include_transitive_dependencies::Bool=true,
...
)
and looking through a number of documentation pages in the Julia docs: Debugging LLVM Transformations in Isolation, as well as a number of past discourse posts 1 & 2, I arrived at
create_sysimage(["Gen"]; sysimage_path="GenSysImage.so", sysimage_build_args=`--output-bc opt.bc`)
after which I tried to verify the bitcode akin to what’s done in Debugging LLVM Transformations in Isolation with llc
, i.e.
llc -o sys.o opt.bc
at which I hit the following error:
Error: expected integer
!<arch>
(I hit the same error when I tell PackageCompiler to emit unoptimized bc, and start earlier in the steps when calling opt
and invoking the new pass manager)
This leaves me with multiple questions:
- What am I missing to be able to apply
llc
as outlined above? Oropt
for that matter? - Is there a better way to get PackageCompiler.jl to emit bitcode?
Thank you for your time reading this long question