s3team / Polyglot

MIT License
104 stars 18 forks source link

Failed to instrument gcc. #8

Closed alexs-repos closed 1 year ago

alexs-repos commented 1 year ago

I encountered an issue while compiling gcc using afl-gcc/afl-g++. During the compilation process, it printed that instrumentation was being performed. However, when I tried running fuzzing, it aborts and saying that No instumentation detected.

test target: gcc-10.2.0 the configure parameters: configure --prefix=/gcc_build/gcc_binary --enable-checking=release --enable-languages=c,c++ --disable-multilib

while compiling, it shows that it has been instrumented: image

when I run fuzzing: image

Did I miss any settings or something else somewhere?

Changochen commented 1 year ago

We had this problem before. It is related to how GCC compilation works. If I remember correctly, building GCC will first compile a small working compiler, and then use that compiler to compile the rest of GCC. So you might need to figure out how to avoid that. (We chose to use the QEMU mode instead :) )

Changochen commented 1 year ago

If you prefer using AFLpp, you can take a look at our new version. (https://github.com/OMH4ck/PolyGlot)

alexs-repos commented 1 year ago

We had this problem before. It is related to how GCC compilation works. If I remember correctly, building GCC will first compile a small working compiler, and then use that compiler to compile the rest of GCC. So you might need to figure out how to avoid that. (We chose to use the QEMU mode instead :) )

During the compilation configuration, I added the parameter --disable-bootstrap to solve this problem. Thank you for your reply.