Skip to content

Commit ae8a499

Browse files
committed
Fix compilation error using afl-cc
1 parent 7e96a02 commit ae8a499

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/afl-cc.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static u32 cc_par_cnt = 1; /* Param count, including argv0 */
5151
static u8 clang_mode; /* Invoked as afl-clang*? */
5252
static u8 llvm_fullpath[PATH_MAX];
5353
static u8 instrument_mode, instrument_opt_mode, ngram_size, ctx_k, lto_mode;
54-
static u8 compiler_mode, plusplus_mode, have_instr_env = 0, need_aflpplib = 0, aflpplib_nomain = 0;
54+
static u8 compiler_mode, plusplus_mode, have_instr_env = 0, need_aflpplib = 0;
5555
static u8 have_gcc, have_llvm, have_gcc_plugin, have_lto, have_instr_list = 0;
5656
static u8 *lto_flag = AFL_CLANG_FLTO, *argvnull;
5757
static u8 debug;
@@ -899,10 +899,7 @@ static void edit_params(u32 argc, char **argv, char **envp) {
899899
strncmp(cur, "sanitize-coverage-deny",
900900
strlen("sanitize-coverage-deny")) &&
901901
instrument_mode != INSTRUMENT_LLVMNATIVE)) {
902-
if (extractor_mode) {
903-
need_aflpplib = 1;
904-
aflpplib_nomain = 1;
905-
}
902+
if (extractor_mode) { need_aflpplib = 1; }
906903

907904
if (!be_quiet) { WARNF("Found '%s' - stripping!", cur); }
908905
continue;
@@ -913,15 +910,11 @@ static void edit_params(u32 argc, char **argv, char **envp) {
913910

914911
if (extractor_mode) {
915912
u8 *afllib_ext = find_object("libAFLExtractor.a", argv[0]);
916-
if(!aflpplib_nomain){
917913
#ifdef __APPLE__
918-
cc_params_ext[cc_par_cnt_ext++] = "-dynamiclib";
914+
cc_params_ext[cc_par_cnt_ext++] = "-dynamiclib";
919915
#else
920-
cc_params_ext[cc_par_cnt_ext++] = "-shared";
916+
cc_params_ext[cc_par_cnt_ext++] = "-shared";
921917
#endif
922-
}
923-
924-
925918
if (!be_quiet) {
926919

927920
OKF("Found '-fsanitize=fuzzer', replacing with libAFLExtractor.a");
@@ -1266,6 +1259,10 @@ static void edit_params(u32 argc, char **argv, char **envp) {
12661259

12671260
}
12681261

1262+
if (extractor_mode) {
1263+
cc_params_ext[cc_par_cnt_ext++] = "-Wno-unused-command-line-argument";
1264+
}
1265+
12691266
if (preprocessor_only || have_c || !non_dash) {
12701267

12711268
/* In the preprocessor_only case (-E), we are not actually compiling at

0 commit comments

Comments
 (0)