about summary refs log tree commit diff
path: root/gcc_plugin
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-03-28 09:31:30 +0100
committerhexcoder- <heiko@hexco.de>2020-03-28 09:31:30 +0100
commit4ad885001a0d05657562e2d89a6bbe60dae45fe0 (patch)
tree5ec002b1390c85d60e9c581cd5be8ca0cb4df7bd /gcc_plugin
parenta0dec909e76f492a7958050f101eebef1a998a44 (diff)
downloadafl++-4ad885001a0d05657562e2d89a6bbe60dae45fe0.tar.gz
making 'CFLAGS="-m32" make source-only tests' work
Diffstat (limited to 'gcc_plugin')
-rw-r--r--gcc_plugin/Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc_plugin/Makefile b/gcc_plugin/Makefile
index 506d690d..df8bd9cb 100644
--- a/gcc_plugin/Makefile
+++ b/gcc_plugin/Makefile
@@ -29,7 +29,7 @@ MAN_PATH    ?= $(PREFIX)/man/man8
 VERSION     = $(shell grep '^$(HASH)define VERSION ' ../config.h | cut -d '"' -f2)
 
 CFLAGS      ?= -O3 -g -funroll-loops
-CFLAGS      += -Wall -I../include -D_FORTIFY_SOURCE=2 -Wno-pointer-sign \
+override CFLAGS = -Wall -I../include -D_FORTIFY_SOURCE=2 -Wno-pointer-sign \
                -DAFL_PATH=\"$(HELPER_PATH)\" -DBIN_PATH=\"$(BIN_PATH)\" \
                -DGCC_VERSION=\"$(GCCVER)\" -DGCC_BINDIR=\"$(GCCBINDIR)\" \
                -Wno-unused-function
@@ -40,6 +40,16 @@ CXXEFLAGS   := $(CXXFLAGS) -Wall -D_FORTIFY_SOURCE=2
 CC          ?= gcc
 CXX         ?= g++
 
+ifeq "clang" "$(CC)"
+        CC  = gcc
+        CXX = g++
+endif
+
+ifeq "clang++" "$(CXX)"
+        CC  = gcc
+        CXX = g++
+endif
+
 PLUGIN_FLAGS = -fPIC -fno-rtti -I"$(shell $(CC) -print-file-name=plugin)/include"
 HASH=\#