Makefile.compile: generate PIE for native
* In this way, OS will load native programs to high virtual address. This makes it possible for native AM to use low virtual address.
This commit is contained in:
parent
8ed9b31dd8
commit
7e5e45afd0
|
@ -30,6 +30,13 @@ CFLAGS += -std=gnu99 -O2 -MMD -Wall -Werror -ggdb $(INCLUDES) -D$(ISA_DEF) -fn
|
||||||
CXXFLAGS += -std=c++11 -O2 -MMD -Wall -Werror -ggdb $(INCLUDES) -D$(ISA_DEF) -fno-builtin
|
CXXFLAGS += -std=c++11 -O2 -MMD -Wall -Werror -ggdb $(INCLUDES) -D$(ISA_DEF) -fno-builtin
|
||||||
ASFLAGS += -MMD $(INCLUDES) -D$(ISA_DEF)
|
ASFLAGS += -MMD $(INCLUDES) -D$(ISA_DEF)
|
||||||
|
|
||||||
|
ifeq ($(ISA), native)
|
||||||
|
CFLAGS_COMMON = -fpie
|
||||||
|
CFLAGS += $(CFLAGS_COMMON)
|
||||||
|
CXXFLAGS += $(CFLAGS_COMMON)
|
||||||
|
ASFLAGS += -fpie -pie
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(ISA), mips32)
|
ifeq ($(ISA), mips32)
|
||||||
CFLAGS_COMMON = -fno-pic -static -fno-strict-aliasing -fno-builtin -fno-stack-protector -fno-delayed-branch -mno-abicalls -march=mips32 -mno-check-zero-division -EL -mno-llsc -mno-imadd -mno-mad
|
CFLAGS_COMMON = -fno-pic -static -fno-strict-aliasing -fno-builtin -fno-stack-protector -fno-delayed-branch -mno-abicalls -march=mips32 -mno-check-zero-division -EL -mno-llsc -mno-imadd -mno-mad
|
||||||
CFLAGS += $(CFLAGS_COMMON)
|
CFLAGS += $(CFLAGS_COMMON)
|
||||||
|
|
|
@ -3,4 +3,4 @@
|
||||||
DEST=$1
|
DEST=$1
|
||||||
shift
|
shift
|
||||||
|
|
||||||
g++ -o "$DEST" -Wl,--start-group $@ -Wl,--end-group -lSDL2 -lGL
|
g++ -pie -o "$DEST" -Wl,--start-group $@ -Wl,--end-group -lSDL2 -lGL -lrt
|
||||||
|
|
Loading…
Reference in New Issue