Bug 1769178 - Update to current AFL++ stable. r=firefox-build-system-reviewers,glandium

Differential Revision: https://phabricator.services.mozilla.com/D146910
This commit is contained in:
Jesse Schwartzentruber 2022-05-24 21:07:40 +00:00
parent 65ad73ba3d
commit 95dae14bf9
3 changed files with 1 additions and 111 deletions

View File

@ -653,4 +653,4 @@ aflplusplus-4.0:
fetch:
type: git
repo: https://github.com/AFLplusplus/AFLplusplus
revision: ac80678592ea4a790ab2eedccfec4e3bc9f96447
revision: ba3c7bfe40f9b17a691958e3525828385127ad25

View File

@ -1,109 +0,0 @@
diff --git a/src/afl-cc.c b/src/afl-cc.c
index ffdda386..6ee0e2d4 100644
--- a/src/afl-cc.c
+++ b/src/afl-cc.c
@@ -58,6 +58,7 @@ static u8 debug;
static u8 cwd[4096];
static u8 cmplog_mode;
u8 use_stdin; /* dummy */
+static int passthrough;
// static u8 *march_opt = CFLAGS_OPT;
enum {
@@ -315,7 +316,7 @@ static void edit_params(u32 argc, char **argv, char **envp) {
u8 fortify_set = 0, asan_set = 0, x_set = 0, bit_mode = 0, shared_linking = 0,
preprocessor_only = 0, have_unroll = 0, have_o = 0, have_pic = 0,
- have_c = 0, partial_linking = 0, wasm_linking = 0;
+ have_c = 0, partial_linking = 0;
cc_params = ck_alloc((argc + 128) * sizeof(u8 *));
@@ -825,8 +826,14 @@ static void edit_params(u32 argc, char **argv, char **envp) {
if (!strcmp(cur, "-x")) x_set = 1;
if (!strcmp(cur, "-E")) preprocessor_only = 1;
if (!strcmp(cur, "-shared")) shared_linking = 1;
+ if (!strcmp(cur, "--target=wasm32-wasi")) {
+
+ if (!be_quiet) { WARNF("Found '%s'!", cur); }
+ passthrough = 1;
+
+ }
+
if (!strcmp(cur, "-dynamiclib")) shared_linking = 1;
- if (!strcmp(cur, "--target=wasm32-wasi")) wasm_linking = 1;
if (!strcmp(cur, "-Wl,-r")) partial_linking = 1;
if (!strcmp(cur, "-Wl,-i")) partial_linking = 1;
if (!strcmp(cur, "-Wl,--relocatable")) partial_linking = 1;
@@ -845,7 +852,7 @@ static void edit_params(u32 argc, char **argv, char **envp) {
// e.g. compiled download or compiled from github then its ./lib directory
// might not be in the search path. Add it if so.
u8 *libdir = strdup(LLVM_LIBDIR);
- if (plusplus_mode && !wasm_linking && strlen(libdir) &&
+ if (plusplus_mode && strlen(libdir) &&
strncmp(libdir, "/usr", 4) && strncmp(libdir, "/lib", 4)) {
cc_params[cc_par_cnt++] = "-rpath";
@@ -1034,7 +1041,7 @@ static void edit_params(u32 argc, char **argv, char **envp) {
cc_params[cc_par_cnt++] =
"-D__AFL_LOOP(_A)="
- "({ static volatile char *_B __attribute__((used)); "
+ "({ static volatile char *_B __attribute__((used,unused)); "
" _B = (char*)\"" PERSIST_SIG
"\"; "
#ifdef __APPLE__
@@ -1048,7 +1055,7 @@ static void edit_params(u32 argc, char **argv, char **envp) {
cc_params[cc_par_cnt++] =
"-D__AFL_INIT()="
- "do { static volatile char *_A __attribute__((used)); "
+ "do { static volatile char *_A __attribute__((used,unused)); "
" _A = (char*)\"" DEFER_SIG
"\"; "
#ifdef __APPLE__
@@ -1093,7 +1100,7 @@ static void edit_params(u32 argc, char **argv, char **envp) {
switch (bit_mode) {
case 0:
- if (!shared_linking && !partial_linking && !wasm_linking)
+ if (!shared_linking && !partial_linking)
cc_params[cc_par_cnt++] =
alloc_printf("%s/afl-compiler-rt.o", obj_path);
if (lto_mode)
@@ -1102,7 +1109,7 @@ static void edit_params(u32 argc, char **argv, char **envp) {
break;
case 32:
- if (!shared_linking && !partial_linking && !wasm_linking) {
+ if (!shared_linking && !partial_linking) {
cc_params[cc_par_cnt++] =
alloc_printf("%s/afl-compiler-rt-32.o", obj_path);
@@ -1123,7 +1130,7 @@ static void edit_params(u32 argc, char **argv, char **envp) {
break;
case 64:
- if (!shared_linking && !partial_linking && !wasm_linking) {
+ if (!shared_linking && !partial_linking) {
cc_params[cc_par_cnt++] =
alloc_printf("%s/afl-compiler-rt-64.o", obj_path);
@@ -1146,7 +1153,7 @@ static void edit_params(u32 argc, char **argv, char **envp) {
}
#if !defined(__APPLE__) && !defined(__sun)
- if (!shared_linking && !partial_linking && !wasm_linking)
+ if (!shared_linking && !partial_linking)
cc_params[cc_par_cnt++] =
alloc_printf("-Wl,--dynamic-list=%s/dynamic_list.txt", obj_path);
#endif
@@ -1179,7 +1186,7 @@ static void edit_params(u32 argc, char **argv, char **envp) {
int main(int argc, char **argv, char **envp) {
- int i, passthrough = 0;
+ int i;
char *callname = argv[0], *ptr = NULL;
if (getenv("AFL_DEBUG")) {

View File

@ -7,7 +7,6 @@ dir=${artifact%.tar.*}
scripts="$(realpath "${0%/*}")"
cd "$MOZ_FETCHES_DIR/AFLplusplus"
patch -p1 -i "$scripts/afl-wasm.patch"
make -f GNUmakefile afl-showmap \
CC="$MOZ_FETCHES_DIR/clang/bin/clang"
make -f GNUmakefile.llvm install \