'Error while Compiling AFL LLVM_MODE

I'm trying to compile afl llvm_mode for the last few hours with no luck.

I downloaded many clang+llvm version from 6.0 to 3.6 and made sure bin is in my path. I then compiled afl, cded to llvm_mode and executed make

I'm always receiving the same error:

root@ubuntu:~/Desktop/Challenges/afl/llvm_mode# make
[*] Checking for working 'llvm-config'...
[*] Checking for working 'clang'...
[*] Checking for '../afl-showmap'...
[+] All set and ready to build.
clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DBIN_PATH=\"/usr/local/bin\" -DVERSION=\"2.52b\"  afl-clang-fast.c -o ../afl-clang-fast 
/root/Desktop/Challenges/clang/bin/clang: 1: /root/Desktop/Challenges/clang/bin/clang: Syntax error: ")" unexpected
make: *** [../afl-clang-fast] Error 2

This is Ubuntu 14.04, I also tried it with the latest Kali...

Any help would be great



Solution 1:[1]

It seems like /root/Desktop/Challenges/clang/bin/clang is a shell script. Also llvm support in that old afl version is not good.

Use AFLplusplus from https://github.com/vanhauser-thc/AFLplusplus which supports llvm up to version 11 and has a much better Makefile heuristic to detect the right versions.

If compilation still fails then set LLVM_CONFIG=llvm-config-6.0 (or a new version, e.g. llvm-config-9). I would also recommend to use a current Kali.

Solution 2:[2]

You can Install llvm-dev package Here is the command

sudo apt-get update -y
sudo apt-get install -y llvm-dev

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vhthc
Solution 2 yupe