mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-10 12:32:45 +00:00
security: Enable '-fpie, -pie' options
To be sure hypervisor and DM are position independent and executable. Tracked-On: #1122 Signed-off-by: wenshelx <wenshengx.wang@intel.com> Acked-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
This commit is contained in:
parent
10c64a5fca
commit
25dacc5c19
@ -18,6 +18,7 @@ CFLAGS += -Wall -ffunction-sections
|
|||||||
CFLAGS += -Werror
|
CFLAGS += -Werror
|
||||||
CFLAGS += -O2 -D_FORTIFY_SOURCE=2
|
CFLAGS += -O2 -D_FORTIFY_SOURCE=2
|
||||||
CFLAGS += -Wformat -Wformat-security -fno-strict-aliasing
|
CFLAGS += -Wformat -Wformat-security -fno-strict-aliasing
|
||||||
|
CFLAGS += -fpie
|
||||||
|
|
||||||
CFLAGS += -I$(BASEDIR)/include
|
CFLAGS += -I$(BASEDIR)/include
|
||||||
CFLAGS += -I$(BASEDIR)/include/public
|
CFLAGS += -I$(BASEDIR)/include/public
|
||||||
@ -43,6 +44,7 @@ endif
|
|||||||
|
|
||||||
LDFLAGS += -Wl,-z,noexecstack
|
LDFLAGS += -Wl,-z,noexecstack
|
||||||
LDFLAGS += -Wl,-z,relro,-z,now
|
LDFLAGS += -Wl,-z,relro,-z,now
|
||||||
|
LDFLAGS += -pie
|
||||||
LDFLAGS += -L$(TOOLS_OUT)
|
LDFLAGS += -L$(TOOLS_OUT)
|
||||||
|
|
||||||
LIBS = -lrt
|
LIBS = -lrt
|
||||||
|
@ -142,4 +142,4 @@ config MTRR_ENABLED
|
|||||||
|
|
||||||
config RELOC
|
config RELOC
|
||||||
bool "Enable relocation"
|
bool "Enable relocation"
|
||||||
default n
|
default y
|
||||||
|
@ -5,6 +5,7 @@ CFLAGS := -Wall
|
|||||||
CFLAGS += -I../../devicemodel/include
|
CFLAGS += -I../../devicemodel/include
|
||||||
CFLAGS += -I../../devicemodel/include/public
|
CFLAGS += -I../../devicemodel/include/public
|
||||||
CFLAGS += -I../../hypervisor/include
|
CFLAGS += -I../../hypervisor/include
|
||||||
|
CFLAGS += -fpie
|
||||||
|
|
||||||
ifeq ($(RELEASE),0)
|
ifeq ($(RELEASE),0)
|
||||||
CFLAGS += -g -DMNGR_DEBUG
|
CFLAGS += -g -DMNGR_DEBUG
|
||||||
@ -13,6 +14,7 @@ endif
|
|||||||
LDFLAGS := -L$(OUT_DIR)
|
LDFLAGS := -L$(OUT_DIR)
|
||||||
LDFLAGS += -lacrn-mngr
|
LDFLAGS += -lacrn-mngr
|
||||||
LDFLAGS += -lpthread
|
LDFLAGS += -lpthread
|
||||||
|
LDFLAGS += -pie
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: $(OUT_DIR)/libacrn-mngr.a $(OUT_DIR)/acrn_mngr.h $(OUT_DIR)/acrnctl $(OUT_DIR)/acrnd
|
all: $(OUT_DIR)/libacrn-mngr.a $(OUT_DIR)/acrn_mngr.h $(OUT_DIR)/acrnctl $(OUT_DIR)/acrnd
|
||||||
|
Loading…
Reference in New Issue
Block a user