mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-14 19:08:08 +00:00
m32/m64 support for LTO and code-format for test/
This commit is contained in:
@ -273,7 +273,8 @@ endif
|
|||||||
../afl-llvm-lto-instrumentation.so: afl-llvm-lto-instrumentation.so.cc
|
../afl-llvm-lto-instrumentation.so: afl-llvm-lto-instrumentation.so.cc
|
||||||
ifeq "$(LLVM_LTO)" "1"
|
ifeq "$(LLVM_LTO)" "1"
|
||||||
$(CXX) $(CLANG_CFL) -Wno-writable-strings -fno-rtti -fPIC -std=$(LLVM_STDCXX) -shared $< -o $@ $(CLANG_LFL)
|
$(CXX) $(CLANG_CFL) -Wno-writable-strings -fno-rtti -fPIC -std=$(LLVM_STDCXX) -shared $< -o $@ $(CLANG_LFL)
|
||||||
$(CC) $(CFLAGS) -O0 $(AFL_CLANG_FLTO) -fPIC -c afl-llvm-rt-lto.o.c -o ../afl-llvm-rt-lto.o
|
$(CC) $(CFLAGS) -Wno-unused-result -O0 $(AFL_CLANG_FLTO) -fPIC -c afl-llvm-rt-lto.o.c -o ../afl-llvm-rt-lto.o
|
||||||
|
@$(CC) $(CFLAGS) -Wno-unused-result -O0 $(AFL_CLANG_FLTO) -m64 -fPIC -c afl-llvm-rt-lto.o.c -o ../afl-llvm-rt-lto-64.o 2>/dev/null; if [ "$$?" = "0" ]; then : ; fi
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# laf
|
# laf
|
||||||
|
@ -479,18 +479,19 @@ static void edit_params(u32 argc, char **argv, char **envp) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (instrument_mode == INSTRUMENT_LTO)
|
|
||||||
cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-rt-lto.o", obj_path);
|
|
||||||
|
|
||||||
#ifndef __ANDROID__
|
#ifndef __ANDROID__
|
||||||
switch (bit_mode) {
|
switch (bit_mode) {
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-rt.o", obj_path);
|
cc_params[cc_par_cnt++] =
|
||||||
|
alloc_printf("%s/afl-llvm-rt%s.o", obj_path,
|
||||||
|
instrument_mode == INSTRUMENT_LTO ? "-lto" : "");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 32:
|
case 32:
|
||||||
cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-rt-32.o", obj_path);
|
cc_params[cc_par_cnt++] =
|
||||||
|
alloc_printf("%s/afl-llvm-rt%s-32.o", obj_path,
|
||||||
|
instrument_mode == INSTRUMENT_LTO ? "-lto" : "");
|
||||||
|
|
||||||
if (access(cc_params[cc_par_cnt - 1], R_OK))
|
if (access(cc_params[cc_par_cnt - 1], R_OK))
|
||||||
FATAL("-m32 is not supported by your compiler");
|
FATAL("-m32 is not supported by your compiler");
|
||||||
@ -498,7 +499,9 @@ static void edit_params(u32 argc, char **argv, char **envp) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 64:
|
case 64:
|
||||||
cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-rt-64.o", obj_path);
|
cc_params[cc_par_cnt++] =
|
||||||
|
alloc_printf("%s/afl-llvm-rt%s-64.o", obj_path,
|
||||||
|
instrument_mode == INSTRUMENT_LTO ? "-lto" : "");
|
||||||
|
|
||||||
if (access(cc_params[cc_par_cnt - 1], R_OK))
|
if (access(cc_params[cc_par_cnt - 1], R_OK))
|
||||||
FATAL("-m64 is not supported by your compiler");
|
FATAL("-m64 is not supported by your compiler");
|
||||||
|
Reference in New Issue
Block a user