• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package {
2    default_applicable_licenses: ["external_AFLplusplus_license"],
3}
4
5// Added automatically by a large-scale-change that took the approach of
6// 'apply every license found to every target'. While this makes sure we respect
7// every license restriction, it may not be entirely correct.
8//
9// e.g. GPL in an MIT project might only apply to the contrib/ directory.
10//
11// Please consider splitting the single license below into multiple licenses,
12// taking care not to lose any license_kind information, and overriding the
13// default license using the 'licenses: [...]' property on targets as needed.
14//
15// For unused files, consider creating a 'fileGroup' with "//visibility:private"
16// to attach the license to, and including a comment whether the files may be
17// used in the current project.
18// See: http://go/android-license-faq
19license {
20    name: "external_AFLplusplus_license",
21    visibility: [":__subpackages__"],
22    license_kinds: [
23        "legacy_unencumbered",
24        "SPDX-license-identifier-Apache-2.0",
25        "SPDX-license-identifier-BSD",
26        "SPDX-license-identifier-CC0-1.0",
27    ],
28    license_text: [
29        "LICENSE",
30    ],
31}
32
33cc_defaults {
34  name: "afl-defaults",
35  export_include_dirs: [
36    "include",
37    "instrumentation",
38  ],
39  local_include_dirs: [
40    "include",
41    "instrumentation",
42  ],
43  cflags: [
44    "-funroll-loops",
45    "-Wno-pointer-sign",
46    "-Wno-pointer-arith",
47    "-Wno-sign-compare",
48    "-Wno-unused-parameter",
49    "-Wno-unused-function",
50    "-Wno-format",
51    "-Wno-user-defined-warnings",
52    "-DAFL_LLVM_USE_TRACE_PC=1",
53    "-DBIN_PATH=\"out/host/linux-x86/bin\"",
54    "-DDOC_PATH=\"out/host/linux-x86/shared/doc/afl\"",
55    "-DDEBUG_BUILD",
56    "-U_FORTIFY_SOURCE",
57    "-ggdb3",
58    "-g",
59    "-O0",
60     "-fno-omit-frame-pointer",
61    "-fPIC",
62   ],
63
64  target: {
65    android_arm64: {
66      cflags: [
67        "-D__ANDROID__",
68      ],
69    },
70    android_arm: {
71      cflags: [
72        "-D__ANDROID__",
73      ],
74    },
75    android_x86_64: {
76      cflags: [
77        "-D__ANDROID__",
78      ],
79    },
80    android_x86: {
81      cflags: [
82        "-D__ANDROID__",
83      ],
84    },
85  },
86}
87
88cc_binary {
89  name: "afl-fuzz",
90  host_supported: true,
91
92  defaults: [
93    "afl-defaults",
94  ],
95
96  srcs: [
97    "src/afl-fuzz*.c",
98    "src/afl-common.c",
99    "src/afl-sharedmem.c",
100    "src/afl-forkserver.c",
101    "src/afl-performance.c",
102  ],
103}
104
105cc_binary {
106  name: "afl-showmap",
107  static_executable: true,
108  host_supported: true,
109
110  defaults: [
111    "afl-defaults",
112  ],
113
114  srcs: [
115    "src/afl-showmap.c",
116    "src/afl-common.c",
117    "src/afl-sharedmem.c",
118    "src/afl-forkserver.c",
119    "src/afl-performance.c",
120    "src/afl-fuzz-mutators.c",
121    "src/afl-fuzz-python.c",
122  ],
123}
124
125cc_binary {
126  name: "afl-gotcpu",
127  static_executable: true,
128  host_supported: true,
129
130  defaults: [
131    "afl-defaults",
132  ],
133
134  srcs: [
135    "src/afl-gotcpu.c",
136    "src/afl-common.c",
137    "src/afl-sharedmem.c",
138    "src/afl-forkserver.c",
139    "src/afl-performance.c",
140  ],
141}
142
143cc_binary {
144  name: "afl-tmin",
145  static_executable: true,
146  host_supported: true,
147
148  defaults: [
149    "afl-defaults",
150  ],
151
152  srcs: [
153    "src/afl-tmin.c",
154    "src/afl-common.c",
155    "src/afl-sharedmem.c",
156    "src/afl-forkserver.c",
157    "src/afl-performance.c",
158  ],
159}
160
161cc_object {
162  name: "aflpp_driver",
163  vendor_available: true,
164  host_supported: true,
165  srcs: [
166    "utils/aflpp_driver/aflpp_driver.c",
167  ],
168  defaults: ["afl-defaults"],
169}
170
171cc_object {
172  name: "afl-compiler-rt",
173  vendor_available: true,
174  host_supported: true,
175  cflags: [
176    "-fPIC",
177  ],
178  srcs: [
179    "instrumentation/afl-compiler-rt.o.c",
180  ],
181  defaults: ["afl-defaults"],
182}
183
184cc_library_headers {
185  name: "libafl_headers",
186  vendor_available: true,
187  host_supported: true,
188  export_include_dirs: [
189    "include",
190    "instrumentation",
191  ],
192}
193
194subdirs = [
195  "custom_mutators",
196]
197