-
Notifications
You must be signed in to change notification settings - Fork 3
group child modules to a full module——vmlinux.bc #5
Description
hello
When i use the compile tools of kubo to compile the kernel , I come across some problems.
I find built-in.ll of each module in the corresponding index, but it seems that you do not generate a full module for the whole linux project which like wllvm do , I want to generate a full module ——vmlinux.bc for kernel with built-in of each child module.
But for modules under the drivers/... , kubo may not generate the correct bitcode for them. When i look into these modules ,
i find drivers/staging/.... cause for it. As we all known, immature implenmentation which quality is unknown is stored here, so i just ignore them and link other modules with llvm-link to generate the vmlinux.bc.
However , this link operation adds some bitcast instructions to functions because suffix are added to structure types during the link, therefore when kubo execute these paths ,it will crash. How can I generate vmlinux and avoid this?
My kernel version is 5.4.1
the example:
%call51 = call i32 @unshare_nsproxy_namespaces(...) #8
which change to
%30 = bitcast i32 (i64, %struct.nsproxy.49395**, %struct.cred.49401*, %struct.fs_struct*)* @unshare_nsproxy_namespaces to i32 (i64, %struct.nsproxy.42579**, %struct.cred*, %struct.fs_struct.42465*)*
%call35 = call i32 %30(i64 %6, %struct.nsproxy.42579** nonnull %new_nsproxy, %struct.cred* null, %struct.fs_struct.42465* %29)
when kubo execute this node , it will crash.
Besides, is the clang in the llvm/kubo-bins-9.0/build/bin your modified frontend compiler?
I specify this compiler to wllvm to extract vmlinux.