diff options
| author | van Hauser <vh@thc.org> | 2019-10-02 01:48:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-02 01:48:51 +0200 |
| commit | 5b45fc5921f25fd5bd2fe216e4c22d7f3988dfa9 (patch) | |
| tree | e7af070369eeaec0663e3efdc8193ae3b70aa021 /Makefile | |
| parent | 19afe50efab221282bfde5993d59c47f98f7c8f9 (diff) | |
| parent | c8d3d813ff0a6ec15b1951a90e0870f283e06ee8 (diff) | |
| download | afl++-5b45fc5921f25fd5bd2fe216e4c22d7f3988dfa9.tar.gz | |
Merge pull request #73 from mattz0rt/static_compilation
Build statically-linked binaries
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile index 3a056a73..802e7bc8 100644 --- a/Makefile +++ b/Makefile @@ -70,6 +70,15 @@ else PYFLAGS= endif +ifdef STATIC + $(info Compiling static version of binaries) + # Disable python for static compilation to simplify things + PYTHON_OK=0 + PYFLAGS= + + CFLAGS += -static + LDFLAGS += -lm -lrt -lpthread -lz -lutil +endif ifeq "$(shell echo '\#include <sys/ipc.h>@\#include <sys/shm.h>@int main() { int _id = shmget(IPC_PRIVATE, 65536, IPC_CREAT | IPC_EXCL | 0600); shmctl(_id, IPC_RMID, 0); return 0;}' | tr @ '\n' | $(CC) -x c - -o .test2 2>/dev/null && echo 1 || echo 0 )" "1" SHMAT_OK=1 @@ -175,7 +184,7 @@ src/afl-sharedmem.o : src/afl-sharedmem.c include/sharedmem.h $(CC) $(CFLAGS) -c src/afl-sharedmem.c -o src/afl-sharedmem.o afl-fuzz: include/afl-fuzz.h $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o $(COMM_HDR) | test_x86 - $(CC) $(CFLAGS) $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o -o $@ $(LDFLAGS) $(PYFLAGS) + $(CC) $(CFLAGS) $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o -o $@ $(PYFLAGS) $(LDFLAGS) afl-showmap: src/afl-showmap.c src/afl-common.o src/afl-sharedmem.o $(COMM_HDR) | test_x86 $(CC) $(CFLAGS) src/$@.c src/afl-common.o src/afl-sharedmem.o -o $@ $(LDFLAGS) |
