From 520a85ca8d7efd3b84dccb191c2b7056df0c8d64 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 24 Aug 2015 02:27:11 +0200 Subject: [PATCH] Build with SSP and PIE by default --- src/arch/project.conf | 4 ++-- src/format/project.conf | 4 ++-- src/project.conf | 4 +++- tools/project.conf | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/arch/project.conf b/src/arch/project.conf index fa3b296..57b14bf 100644 --- a/src/arch/project.conf +++ b/src/arch/project.conf @@ -1,7 +1,7 @@ targets=amd64,arm,armeb,armel,dalvik,i386,i386_real,i486,i586,i686,java,mips,mipseb,mipsel,sparc,sparc64,template,yasep,yasep16,yasep32 cppflags_force=-I ../../include -cflags_force=-W `pkg-config --cflags libSystem` -cflags=-Wall -g -O2 -fPIC -pedantic +cflags_force=`pkg-config --cflags libSystem` -fPIC +cflags=-W -Wall -g -O2 -pedantic -D_FORTIFY_SOURCE=2 -fstack-protector-all ldflags_force=-W `pkg-config --libs libSystem` dist=Makefile,amd64.ins,amd64.reg,arm.h,arm.ins,arm.reg,common.ins,dalvik.ins,dalvik.reg,i386.h,i386.ins,i386.reg,i486.ins,i586.ins,i686.ins,i686.reg,mips.h,mips.ins,mips.reg,null.ins,null.reg,sparc.h,sparc.ins,sparc.reg,yasep.h,yasep.ins,yasep.reg diff --git a/src/format/project.conf b/src/format/project.conf index 687c511..737c0ac 100644 --- a/src/format/project.conf +++ b/src/format/project.conf @@ -1,7 +1,7 @@ targets=dex,elf,flat,java,pe cppflags_force=-I ../../include -cflags_force=-W `pkg-config --cflags libSystem` -cflags=-Wall -g -O2 -fPIC -pedantic +cflags_force=`pkg-config --cflags libSystem` -fPIC +cflags=-W -Wall -g -O2 -pedantic -D_FORTIFY_SOURCE=2 -fstack-protector-all ldflags_force=-W `pkg-config --libs libSystem` dist=Makefile,elf/common.h,elf/elf.h,elf/elf.c diff --git a/src/project.conf b/src/project.conf index 570f48b..b353f10 100644 --- a/src/project.conf +++ b/src/project.conf @@ -3,7 +3,7 @@ targets=libAsm,asm,deasm cppflags_force=-I ../include cppflags= cflags_force=-W `pkg-config --cflags cpp` -cflags=-Wall -g -O2 -pedantic +cflags=-Wall -g -O2 -pedantic -D_FORTIFY_SOURCE=2 -fstack-protector ldflags_force=`pkg-config --libs cpp` ldflags=-ldl dist=Makefile,arch.h,code.h,common.h,format.h,parser.h,token.h,python/project.conf,python/Makefile,python/libasm.c,python/libasm.py @@ -18,6 +18,7 @@ install=$(LIBDIR) type=binary sources=main.c depends=$(OBJDIR)libAsm.so +cflags=-fPIE ldflags=-L$(OBJDIR). -Wl,-rpath,$(LIBDIR) -lAsm install=$(BINDIR) @@ -25,6 +26,7 @@ install=$(BINDIR) type=binary sources=deasm.c depends=$(OBJDIR)libAsm.so +cflags=-fPIE ldflags=-L$(OBJDIR). -Wl,-rpath,$(LIBDIR) -lAsm install=$(BINDIR) diff --git a/tools/project.conf b/tools/project.conf index f1a02d8..86c471b 100644 --- a/tools/project.conf +++ b/tools/project.conf @@ -1,7 +1,7 @@ targets=libAsm,asm-static,deasm-static cppflags_force=-I ../include -DSTANDALONE -cflags_force=-W `pkg-config --cflags cpp` -cflags=-Wall -g -O2 -pedantic +cflags_force=`pkg-config --cflags cpp` +cflags=-W -Wall -g -O2 -pedantic -D_FORTIFY_SOURCE=2 -fstack-protector-all ldflags_force=`pkg-config --libs cpp` dist=Makefile