cloudlinux / libcare

libcare -- Patch Userspace Code in Live Processes
GNU General Public License v2.0
145 stars 57 forks source link

gcc __LINE__ make patch in mess by kpatch_gensrc #57

Open zhengchuan-salut opened 3 years ago

zhengchuan-salut commented 3 years ago

When I am going to make patch for QEMU, I found that a lot of unwanted assemble differences are generated by kpatch_gensrc due to gcc LINE; That is, if I add some code in func A, the funB which is belowed under funA in the file could be recongized as changed because LINE is used and changed in funB. There are a lot of LINE uses in qemu like error_setstage() which triggers a big patch while only a small part of it is truely needed.

Is there any good idea to solve this problem? Maybe we should undefine LINE or just filter the changed function we want by kpatch_gensrc?

Thanks, Chuan

zhengchuan-salut commented 3 years ago

kindly ping, anyone who has a good solution for that is welcomed to discuss:)