mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-16 11:58:08 +00:00
fix gnumakefile for non-gcc
This commit is contained in:
11
GNUmakefile
11
GNUmakefile
@ -100,8 +100,13 @@ else
|
|||||||
LDFLAGS += $(SDK_LD)
|
LDFLAGS += $(SDK_LD)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
COMPILER_TYPE=$(shell $(CC) --version|grep "Free Software Foundation")
|
||||||
|
ifneq ($(COMPILER_TYPE), "")
|
||||||
|
# $(info gcc is being used)
|
||||||
|
CFLAGS_OPT += -Wno-error=format-truncation -Wno-format-truncation
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq "$(SYS)" "SunOS"
|
ifeq "$(SYS)" "SunOS"
|
||||||
CFLAGS_OPT += -Wno-format-truncation
|
|
||||||
LDFLAGS = -lkstat -lrt -lsocket -lnsl
|
LDFLAGS = -lkstat -lrt -lsocket -lnsl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -139,13 +144,13 @@ endif
|
|||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
$(info Compiling DEBUG version of binaries)
|
$(info Compiling DEBUG version of binaries)
|
||||||
override CFLAGS += -ggdb3 -O0 -Wall -Wextra -Werror -Wno-error=format-truncation= $(CFLAGS_OPT)
|
override CFLAGS += -ggdb3 -O0 -Wall -Wextra -Werror $(CFLAGS_OPT)
|
||||||
else
|
else
|
||||||
CFLAGS ?= -O2 $(CFLAGS_OPT) # -funroll-loops is slower on modern compilers
|
CFLAGS ?= -O2 $(CFLAGS_OPT) # -funroll-loops is slower on modern compilers
|
||||||
endif
|
endif
|
||||||
|
|
||||||
override CFLAGS += -g -Wno-pointer-sign -Wno-variadic-macros -Wall -Wextra -Wno-pointer-arith \
|
override CFLAGS += -g -Wno-pointer-sign -Wno-variadic-macros -Wall -Wextra -Wno-pointer-arith \
|
||||||
-fPIC -I include/ -DAFL_PATH=\"$(HELPER_PATH)\" -Wno-format-truncation \
|
-fPIC -I include/ -DAFL_PATH=\"$(HELPER_PATH)\" \
|
||||||
-DBIN_PATH=\"$(BIN_PATH)\" -DDOC_PATH=\"$(DOC_PATH)\"
|
-DBIN_PATH=\"$(BIN_PATH)\" -DDOC_PATH=\"$(DOC_PATH)\"
|
||||||
# -fstack-protector
|
# -fstack-protector
|
||||||
|
|
||||||
|
@ -379,7 +379,7 @@ static u8 colorization(afl_state_t *afl, u8 *buf, u32 len,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (++afl->stage_cur % screen_update == 0) { show_stats(afl); };
|
if (unlikely(++afl->stage_cur % screen_update == 0)) { show_stats(afl); };
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -790,7 +790,7 @@ static u8 cmp_extend_encoding(afl_state_t *afl, struct cmp_header *h,
|
|||||||
|
|
||||||
u32 its_len = MIN(len - idx, taint_len);
|
u32 its_len = MIN(len - idx, taint_len);
|
||||||
|
|
||||||
if (afl->fsrv.total_execs - last_update > screen_update) {
|
if (unlikely(afl->fsrv.total_execs - last_update > screen_update)) {
|
||||||
|
|
||||||
show_stats(afl);
|
show_stats(afl);
|
||||||
last_update = afl->fsrv.total_execs;
|
last_update = afl->fsrv.total_execs;
|
||||||
@ -1455,7 +1455,7 @@ static u8 cmp_extend_encodingN(afl_state_t *afl, struct cmp_header *h,
|
|||||||
u32 taint_len, u8 *orig_buf, u8 *buf, u8 *cbuf,
|
u32 taint_len, u8 *orig_buf, u8 *buf, u8 *cbuf,
|
||||||
u32 len, u8 do_reverse, u8 lvl, u8 *status) {
|
u32 len, u8 do_reverse, u8 lvl, u8 *status) {
|
||||||
|
|
||||||
if (afl->fsrv.total_execs - last_update > screen_update) {
|
if (unlikely(afl->fsrv.total_execs - last_update > screen_update)) {
|
||||||
|
|
||||||
show_stats(afl);
|
show_stats(afl);
|
||||||
last_update = afl->fsrv.total_execs;
|
last_update = afl->fsrv.total_execs;
|
||||||
@ -1952,7 +1952,7 @@ static u8 rtn_extend_encoding(afl_state_t *afl, u8 entry,
|
|||||||
// (void)(changed_val);
|
// (void)(changed_val);
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
if (afl->fsrv.total_execs - last_update > screen_update) {
|
if (unlikely(afl->fsrv.total_execs - last_update > screen_update)) {
|
||||||
|
|
||||||
show_stats(afl);
|
show_stats(afl);
|
||||||
last_update = afl->fsrv.total_execs;
|
last_update = afl->fsrv.total_execs;
|
||||||
@ -2002,10 +2002,10 @@ static u8 rtn_extend_encoding(afl_state_t *afl, u8 entry,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 lmax = MAX(l0, ol0);
|
u8 lmin = MIN(l0, ol0);
|
||||||
u8 save[40];
|
u8 save[40];
|
||||||
u32 saved_idx = idx, pre, from = 0, to = 0, i, j;
|
u32 saved_idx = idx, pre, from = 0, to = 0, i, j;
|
||||||
u32 its_len = MIN(MIN(lmax, hshape), len - idx);
|
u32 its_len = MIN(MIN(lmin, hshape), len - idx);
|
||||||
its_len = MIN(its_len, taint_len);
|
its_len = MIN(its_len, taint_len);
|
||||||
u32 saved_its_len = its_len;
|
u32 saved_its_len = its_len;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user