AFLplusplus / unicornafl

AFL bindings for Unicorn-Engine
Apache License 2.0
66 stars 30 forks source link

Build fails due to some issue in unicorn_afl #24

Open nishant412 opened 11 months ago

nishant412 commented 11 months ago

I am trying to build AFLplusplus from source following the instructions on here - https://github.com/AFLplusplus/AFLplusplus/blob/stable/docs/INSTALL.md

When I run make distrib it seems to error out during unicorn_mode build stage. Here is what I observed:

[ 94%] Built target sample_x86 make[3]: Leaving directory '/home/nb-ap@THP.LOCAL/Tools/AFLplusplus/unicorn_mode/unicornafl/unicorn/build' make[2]: [Makefile:146: all] Error 2 make[2]: Leaving directory '/home/nb-ap@THP.LOCAL/Tools/AFLplusplus/unicorn_mode/unicornafl/unicorn/build' make[1]: [Makefile:11: unicorn/build/libunicorn-common.a] Error 2 make[1]: Leaving directory '/home/nb-ap@THP.LOCAL/Tools/AFLplusplus/unicorn_mode/unicornafl' make: [GNUmakefile:651: distrib] Error 1 (ignored)

Any suggestions on how to resolve this? I am running Ubuntu 22.04.1 LTS on a x86_64 machine

Edit : Looking at the output logs better, I realize this is where the errors start

[ 93%] Building C object CMakeFiles/sample_x86.dir/samples/sample_x86.c.o make[4]: Entering directory '/home/nb-ap@THP.LOCAL/Tools/AFLplusplus/unicorn_mode/unicornafl/unicorn/build' [ 93%] Building C object CMakeFiles/sample_x86_32_gdt_and_seg_regs.dir/samples/sample_x86_32_gdt_and_seg_regs.c.o make[4]: Entering directory '/home/nb-ap@THP.LOCAL/Tools/AFLplusplus/unicorn_mode/unicornafl/unicorn/build' [ 93%] Building C object CMakeFiles/sample_batch_reg.dir/samples/sample_batch_reg.c.o make[4]: Entering directory '/home/nb-ap@THP.LOCAL/Tools/AFLplusplus/unicorn_mode/unicornafl/unicorn/build' @Syntax error in archive script, line 1 /usr/bin/ar: /home/nb-ap: No such file or directory @make[4]: *** [CMakeFiles/bundling_target.dir/build.make:73: libunicorn.a] Error 9

I am guessing the arguments to the call to ar don't have quotes correctly, coz it seems to ignore my home directory name after the @ . Where should I edit to fix this?

vanhauser-thc commented 5 months ago

sorry I somehow never saw this issue. easy fix: build under a different user, e.g. root, and do sudo make install.

also the repo that would need the fix is this one: https://github.com/AFLplusplus/unicornafl