In Linux kernel, I need to analyze the source code files, I choose intermediate .i
files (preprocessed files) to analyze because of the macro definitions (preprocessed files have the macro definitions expanded to make it easier to analyze). I tried to use “make” to generate the .i file, my command is “make net/core/skbuff.i
”, this will generate net/core/skbuff.c corresponding to net/core/skbuff.i file, this command works fine. But when I try to analyze other files, I get an error: make net/core/sock_map.i
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool
make[3]: *** No rule to make target 'net/core/sock_map.i'. Stop.
make[2]: *** [scripts/Makefile.build:471: __build] Error 2
make[1]: *** [scripts/Makefile.build:496: net/core] Error 2
make: *** [Makefile:1805: net] Error 2.
I would like to know why this is, not all files can generate .i
files? I also tried other files with the same error: make drivers/infiniband/hw/hfi1/iowait.i
with the same error. My Linux source code is linux-5.10 and architecture is x86. what is my problem?I can be sure that all these source files exist.
I downloaded the source files from the official website, unzipped them, ran the make menuconfig
command directly, and saved the .config
file without making any changes, then ran the command make file/location/file_preprocess.i
. It’s worth noting that I’m using the kernel source code linux-6.1-rc4. when running the command make net/core/sock_map.i
C
ALL scripts/checksyscalls.sh
DESCEND objtool
CPP net/core/sock_map.i,
the .i
file was successfully generated. Running the command make drivers/infiniband/hw/hfi1/iowait.i
was also successful, with no changes made to either version of the source code, and the .config
file was also generated by default. Since I need to analyze the source files of a specific version, I can’t use the intermediate files of linux-6.1-rc4 directly, and I’d like to know the reason why I can’t compile the .i file!
XI HUANG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.