diff options
author | hexcoder- <hexcoder-@github.com> | 2020-02-23 22:03:51 +0100 |
---|---|---|
committer | hexcoder- <hexcoder-@github.com> | 2020-02-23 22:03:51 +0100 |
commit | f240c5381a3c241cedc74b25f50dca2b40a17b10 (patch) | |
tree | 6b74f89f634eaba51571c3c0cb40b12c323f8110 /examples | |
parent | 32281ddcb0f1771b4f3ad6dc3599fa4c42555595 (diff) | |
download | afl++-f240c5381a3c241cedc74b25f50dca2b40a17b10.tar.gz |
fix -m32 on arm (-> -m32be), make 64 bit version explicit (do not assume 64 bit as default)
Diffstat (limited to 'examples')
-rw-r--r-- | examples/socket_fuzzing/Makefile | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/examples/socket_fuzzing/Makefile b/examples/socket_fuzzing/Makefile index 0191ba53..ad921664 100644 --- a/examples/socket_fuzzing/Makefile +++ b/examples/socket_fuzzing/Makefile @@ -22,18 +22,27 @@ ifneq "$(filter Linux GNU%,$(shell uname))" "" LDFLAGS += -ldl endif +# on gcc for arm there is no -m32, but -mbe32 +M32FLAG = -m32 +M64FLAG = -m64 +ifeq "$(findstring clang, $(shell $(CC) --version 2>/dev/null))" "" + ifneq (,$(findstring arm, "$(shell $(CC) -v 2>&1 >/dev/null)")) + M32FLAG = -mbe32 + endif +endif + all: socketfuzz32.so socketfuzz64.so socketfuzz32.so: socketfuzz.c - -$(CC) -m32 $(CFLAGS) $^ $(LDFLAGS) -o $@ || echo "socketfuzz32 build failure (that's fine)" + -$(CC) $(M32FLAG) $(CFLAGS) $^ $(LDFLAGS) -o $@ || echo "socketfuzz32 build failure (that's fine)" socketfuzz64.so: socketfuzz.c - -$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@ + -$(CC) $(M64FLAG) $(CFLAGS) $^ $(LDFLAGS) -o $@ || echo "socketfuzz64 build failure (that's fine)" install: socketfuzz32.so socketfuzz64.so install -d -m 755 $(DESTDIR)$(HELPER_PATH)/ if [ -f socketfuzz32.so ]; then set -e; install -m 755 socketfuzz32.so $(DESTDIR)$(HELPER_PATH)/; fi - install -m 755 socketfuzz64.so $(DESTDIR)$(HELPER_PATH)/ + if [ -f socketfuzz64.so ]; then set -e; install -m 755 socketfuzz64.so $(DESTDIR)$(HELPER_PATH)/; fi clean: rm -f socketfuzz32.so socketfuzz64.so |