diff options
author | van Hauser <vh@thc.org> | 2020-10-14 17:37:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-14 17:37:21 +0200 |
commit | 7ca5524e55aa0cdfae6839b12e9a472fed1a69ad (patch) | |
tree | 976f344c0a18e34044b58a8531215b83610a1165 | |
parent | 735e8c39561d3d4d8bae01251e025e52e05472e2 (diff) | |
parent | 638bf19b651864bdc6ec801f87123d08f92af04e (diff) | |
download | afl++-7ca5524e55aa0cdfae6839b12e9a472fed1a69ad.tar.gz |
Merge pull request #584 from devnexen/dfbsd_build_fix
DragonFlyBSD build fix proposal.
-rw-r--r-- | GNUmakefile.gcc_plugin | 7 | ||||
-rw-r--r-- | include/afl-fuzz.h | 1 | ||||
-rw-r--r-- | src/afl-fuzz-init.c | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/GNUmakefile.gcc_plugin b/GNUmakefile.gcc_plugin index d139387a..bf3a3288 100644 --- a/GNUmakefile.gcc_plugin +++ b/GNUmakefile.gcc_plugin @@ -56,7 +56,8 @@ ifeq "$(findstring Foundation,$(shell $(CC) --version))" "" CXX = g++ endif -PLUGIN_FLAGS = -fPIC -fno-rtti -I"$(shell $(CC) -print-file-name=plugin)/include" +PLUGIN_BASE = "$(shell $(CC) -print-file-name=plugin)" +PLUGIN_FLAGS = -fPIC -fno-rtti -I$(PLUGIN_BASE)/include -I$(PLUGIN_BASE) HASH=\# GCCVER = $(shell $(CC) --version 2>/dev/null | awk 'NR == 1 {print $$NF}') @@ -88,6 +89,10 @@ ifeq "$(shell uname -s)" "OpenBSD" PLUGIN_FLAGS += -I/usr/local/include endif +ifeq "$(shell uname -s)" "DragonFly" + PLUGIN_FLAGS += -I/usr/local/include +endif + ifeq "$(shell uname -s)" "SunOS" PLUGIN_FLAGS += -I/usr/include/gmp endif diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h index 8bac1457..acded98f 100644 --- a/include/afl-fuzz.h +++ b/include/afl-fuzz.h @@ -66,6 +66,7 @@ #include <sched.h> #include <netdb.h> +#include <netinet/in.h> #include <sys/wait.h> #include <sys/time.h> diff --git a/src/afl-fuzz-init.c b/src/afl-fuzz-init.c index 607b652f..13e42e03 100644 --- a/src/afl-fuzz-init.c +++ b/src/afl-fuzz-init.c @@ -272,7 +272,7 @@ void bind_to_free_cpu(afl_state_t *afl) { #elif defined(__DragonFly__) - if (procs[i].kp_lwp.kl_cpuid < sizeof(cpu_used) && + if (procs[i].kp_lwp.kl_cpuid < (s32)sizeof(cpu_used) && procs[i].kp_lwp.kl_pctcpu > 10) cpu_used[procs[i].kp_lwp.kl_cpuid] = 1; |