Skip to content
This repository was archived by the owner on Mar 22, 2024. It is now read-only.

Commit 3ef34c1

Browse files
Remove maybe_linking check from afl-clang-fast (#80)
Some targets needs to include afl-llvm-rt.o not only when linking, see google/fuzzbench#110. This change seems to not break nothing in AFL++.
1 parent f10d601 commit 3ef34c1

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

llvm_mode/afl-clang-fast.c

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -281,40 +281,36 @@ static void edit_params(u32 argc, char** argv) {
281281
#endif /* ^__APPLE__ */
282282
"_I(); } while (0)";
283283

284-
if (maybe_linking) {
285-
286-
if (x_set) {
287-
cc_params[cc_par_cnt++] = "-x";
288-
cc_params[cc_par_cnt++] = "none";
289-
}
284+
if (x_set) {
285+
cc_params[cc_par_cnt++] = "-x";
286+
cc_params[cc_par_cnt++] = "none";
287+
}
290288

291289
#ifndef __ANDROID__
292-
switch (bit_mode) {
290+
switch (bit_mode) {
293291

294-
case 0:
295-
cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-rt.o", obj_path);
296-
break;
292+
case 0:
293+
cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-rt.o", obj_path);
294+
break;
297295

298-
case 32:
299-
cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-rt-32.o", obj_path);
296+
case 32:
297+
cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-rt-32.o", obj_path);
300298

301-
if (access(cc_params[cc_par_cnt - 1], R_OK))
302-
FATAL("-m32 is not supported by your compiler");
299+
if (access(cc_params[cc_par_cnt - 1], R_OK))
300+
FATAL("-m32 is not supported by your compiler");
303301

304-
break;
302+
break;
305303

306-
case 64:
307-
cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-rt-64.o", obj_path);
304+
case 64:
305+
cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-rt-64.o", obj_path);
308306

309-
if (access(cc_params[cc_par_cnt - 1], R_OK))
310-
FATAL("-m64 is not supported by your compiler");
307+
if (access(cc_params[cc_par_cnt - 1], R_OK))
308+
FATAL("-m64 is not supported by your compiler");
311309

312-
break;
313-
314-
}
315-
#endif
310+
break;
316311

317312
}
313+
#endif
318314

319315
cc_params[cc_par_cnt] = NULL;
320316

0 commit comments

Comments
 (0)