1

Background information

I am trying to install AFL on MacOS X, and have been following the instructions on https://reverse.put.as/2017/07/10/compiling-afl-osx-llvm-mode/. When I type $make in terminal, the following error appears.
[*] Checking for working 'llvm-config'... [*] Checking for working '/opt/local/bin/clang'... [-] Oops, can't find '/opt/local/bin/clang'. Make sure that it's in your $PATH (or set $CC and $CXX). make: *** [test_deps] Error 1
I noticed that clang is located in /Library/Developer/CommandLineTools/usr/bin. Here is the details when I type clang -v in terminal:
Apple clang version 11.0.3 (clang-1103.0.32.62) Target: x86_64-apple-darwin19.4.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Question

How do I move clang to the following directory '/opt/local/bin/clang'? Or is there any other thing I can do to fix this problem?

  • Try using the `ln -s` command to create a symlink in `/opt/local/bin/` that points to the clang binary in `/Library/Developer/CommandLineTools/usr/bin` – droptop May 25 '20 at 09:38
  • I have tried using `ln -s` and it said Permission denied. – user13610933 May 25 '20 at 10:24
  • Are you sure the order of your arguments was right?? Because I think even root can't in general create symlinks in /usr/bin because of **SIP**. Make sure it's `sudo ln -s /Library/Developer/CommandLineTools/usr/bin/your_clang_binary /opt/local/bin/clang` – droptop May 25 '20 at 15:27
  • Thanks for your help. I have created opt/local/bin/clang. However, LLVM is still not detecting `opt/local/bin/clang`. – user13610933 May 26 '20 at 02:51
  • This is what I get when I make sure clang file is created: `ln: /opt/local/bin/clang: File exists`. And here's the error I have after `make`: `[*] Checking for working 'llvm-config'... [*] Checking for working '/opt/local/bin/clang'... [-] Oops, can't find '/opt/local/bin/clang'. Make sure that it's in your $PATH (or set $CC and $CXX). make: *** [test_deps] Error 1`. – user13610933 May 26 '20 at 02:56
  • What does executing the `clang` command in your terminal give?? I suspect your clang binary name is in the form`clang-version`. If it is then delete the symlink and recreate it with the correct name of the clang binary – droptop May 26 '20 at 10:54

0 Answers0