From c77cf3a18f094bb37322b6efcf8de4a58a5734ec Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Fri, 7 Mar 2014 22:06:51 +0800 Subject: [PATCH] only turn off some string check functions with _FORTIFY_SOURCE=0 for OSX when USE_SYS_DYN_MEM=yes --- Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 9b6650a1..f5143c21 100644 --- a/Makefile +++ b/Makefile @@ -16,12 +16,6 @@ RANLIB = $(CROSS)ranlib STRIP = $(CROSS)strip endif -ifeq ($(CAPSTONE_DIET),yes) -# remove string check & stack protector functions -CFLAGS += -D_FORTIFY_SOURCE=0 -CFLAGS += -fno-stack-protector -endif - CFLAGS += -fPIC -O3 -Wall -Iinclude ifeq ($(USE_SYS_DYN_MEM),yes) @@ -151,6 +145,10 @@ PKGCFCGDIR = $(LIBDIR)/pkgconfig ifeq ($(UNAME_S),Darwin) EXT = dylib AR_EXT = a +ifneq ($(USE_SYS_DYN_MEM),yes) +# remove string check because OSX kernel complains about missing symbols +CFLAGS += -D_FORTIFY_SOURCE=0 +endif # By default, suppose that Brew is installed & use Brew path for pkgconfig file PKGCFCGDIR = /usr/local/lib/pkgconfig # is Macport installed instead?