搭建afl-qemu模块的时候,碰到了如下2个报错:
xxxxxxxx/qemu/linux-user/syscall.c:253:16: error: static declaration of ‘gettid’ follows non-static declaration
253 | _syscall0(int, gettid)
^~~~~~
xxxxxxxxx/qemu/linux-user/syscall.c:184:13: note: in definition of macro ‘_syscall0’
184 | static type name (void)
/xxxxxx/qemu_mode/qemu-2.10.0/linux-user/ioctls.h:174:9: error: ‘SIOCGSTAMPNS’ undeclared here (not in a function); did you mean ‘SIOCGSTAMP_OLD’?
174 | IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
| ^~~~~~~~~~~~
xxxxxxx/qemu_mode/qemu-2.10.0/linux-user/syscall.c:5597:23: note: in definition of macro ‘IOCTL’
5597 | { TARGET ## cmd, cmd, #cmd, access, 0, { VA_ARGS } },
| ^~~
make[1]: *** [/xxxxxxxx/AFL/qemu_mode/qemu-2.10.0/rules.mak:66: linux-user/syscall.o] Error 1
make: *** [Makefile:326: subdir-x86_64-linux-user] Error 2
根据错误提示可知,问题出在syscall.c这个c程序文件里,具体涉及到的位置应该就是‘gettid’和‘SIOCGSTAMPNS’这2块内容。
在网上找呀找呀找&#x