afl-cc - Man Page

afl-cc++3.12c by Michal Zalewski, Laszlo Szekeres, Marc Heuse afl-cc


afl-cc/afl-c++ [options]


This is a helper application for afl-fuzz. It serves as a drop-in replacement
for gcc and clang, letting you recompile third-party code with the required
runtime instrumentation. A common use pattern would be one of the following:

  CC=afl-cc CXX=afl-c++ ./configure --disable-shared
  CC=afl-cc CXX=afl-c++ meson

                                       |------------- FEATURES -------------|
MODES:                                  NCC PERSIST DICT   LAF CMPLOG SELECT
  [LTO] llvm LTO:          unavailable!
      PCGUARD              DEFAULT      yes yes     yes    yes yes    yes
      CLASSIC                           yes yes     yes    yes yes    yes
  [LLVM] llvm:             AVAILABLE [SELECTED]
      PCGUARD              DEFAULT      yes yes     module yes yes    extern
      CLASSIC                           no  yes     module yes yes    yes
        - NORMAL
        - CALLER
        - CTX
        - NGRAM-{2-16}
      INSTRIM                           no  yes     module yes yes    yes
        - NORMAL
        - CALLER
        - NGRAM-{2-16}
  [GCC_PLUGIN] gcc plugin: unavailable!
      CLASSIC              DEFAULT      no  yes     no     no  no     yes
  [GCC/CLANG] simple gcc/clang: AVAILABLE
      CLASSIC              DEFAULT      no  no      no     no  no     no

  To select the compiler mode use a symlink version (e.g. afl-clang-fast), set
  the environment variable AFL_CC_COMPILER to a mode (e.g. LLVM) or use the
  command line parameter --afl-MODE (e.g. --afl-llvm). If none is selected,
  afl-cc will select the best available (LLVM -> GCC_PLUGIN -> GCC).
  The best is LTO but it often needs RANLIB and AR settings outside of afl-cc.

Sub-Modes: (set via env AFL_LLVM_INSTRUMENT, afl-cc selects the best available)
  PCGUARD: Dominator tree instrumentation (best!) (
  LLVM-NATIVE:  use llvm's native PCGUARD instrumentation (less performant)
  CLASSIC: decision target instrumentation (
  CALLER:  CLASSIC + single callee context (instrumentation/
  CTX:     CLASSIC + full callee context (instrumentation/
  NGRAM-x: CLASSIC + previous path ((instrumentation/
  INSTRIM: Dominator tree (for LLVM <= 6.0) (instrumentation/

Features: (see documentation links)
  NCC:    non-colliding coverage [automatic] (that is an amazing thing!)
  PERSIST: persistent mode support [code] (huge speed increase!)
  DICT:   dictionary in the target [yes=automatic or llvm module pass]
          (instrumentation/ + instrumentation/
  LAF:    comparison splitting [env] (instrumentation/
  CMPLOG: input2state exploration [env] (instrumentation/
  SELECT: selective instrumentation (allow/deny) on filename or function [env]

To see all environment variables for the configuration of afl-cc use "-hh".

For any information on the available instrumentations and options please 
consult the, especially section 3.1 about instrumenting targets.

afl-cc LLVM version 12 using the binary path "/usr/bin".
Compiled with shmat support.

Do not be overwhelmed :) afl-cc uses good defaults if no options are selected.
Read the documentation for FEATURES though, all are good but few are defaults.
Recommended is afl-clang-lto with AFL_LLVM_CMPLOG or afl-clang-fast with


afl++ was written by Michal "lcamtuf" Zalewski and is maintained by Marc "van Hauser" Heuse <>, Heiko "hexcoder-" Eissfeldt <>, Andrea Fioraldi <> and Dominik Maier <> The homepage of afl++ is:


Apache License Version 2.0, January 2004

Referenced By

The man pages afl-c++(8), afl-clang-fast(8) and afl-clang-fast++(8) are aliases of afl-cc(8).

2021-03-24 afl++