summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk')
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk41
1 files changed, 23 insertions, 18 deletions
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk
index f20ee5b..4d4afa6 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk
@@ -46,6 +46,9 @@
46# COMMON_CFLAGS or COMMON_USER_FLAGS. These flags are shared between 46# COMMON_CFLAGS or COMMON_USER_FLAGS. These flags are shared between
47# host and target, which might use compilers with different capabilities. 47# host and target, which might use compilers with different capabilities.
48 48
49# ANOTHER NOTE: All flags here must be architecture-independent (i.e. no
50# -march or toolchain include paths)
51
49# These flags are used for kernel, User C and User C++ 52# These flags are used for kernel, User C and User C++
50# 53#
51COMMON_FLAGS := -W -Wall 54COMMON_FLAGS := -W -Wall
@@ -54,7 +57,7 @@ COMMON_FLAGS := -W -Wall
54# 57#
55COMMON_CFLAGS := $(COMMON_FLAGS) \ 58COMMON_CFLAGS := $(COMMON_FLAGS) \
56 -Wdeclaration-after-statement -Wno-format-zero-length \ 59 -Wdeclaration-after-statement -Wno-format-zero-length \
57 -Wstrict-prototypes 60 -Wmissing-prototypes -Wstrict-prototypes
58 61
59# User C and User C++ optimization control. Does not affect kernel. 62# User C and User C++ optimization control. Does not affect kernel.
60# 63#
@@ -76,7 +79,7 @@ COMMON_USER_FLAGS += -fno-strict-aliasing
76# We always enable debugging. Either the release binaries are stripped 79# We always enable debugging. Either the release binaries are stripped
77# and the symbols put in the symbolpackage, or we're building debug. 80# and the symbols put in the symbolpackage, or we're building debug.
78# 81#
79COMMON_USER_FLAGS += -g $(ANDROID_FPGA_FORCE_32BIT) 82COMMON_USER_FLAGS += -g
80 83
81# User C and User C++ warning flags 84# User C and User C++ warning flags
82# 85#
@@ -164,6 +167,7 @@ KBUILD_FLAGS := \
164# androideabi toolchain adds `pic` by default, disable it 167# androideabi toolchain adds `pic` by default, disable it
165# for kernel module build 168# for kernel module build
166KBUILD_FLAGS += -fno-pic 169KBUILD_FLAGS += -fno-pic
170KBUILD_FLAGS += -fstack-protector-strong
167 171
168TESTED_KBUILD_FLAGS := \ 172TESTED_KBUILD_FLAGS := \
169 $(call kernel-cc-option,-Wmissing-include-dirs) \ 173 $(call kernel-cc-option,-Wmissing-include-dirs) \
@@ -171,6 +175,7 @@ TESTED_KBUILD_FLAGS := \
171 $(call kernel-cc-option,-Wno-pointer-arith) \ 175 $(call kernel-cc-option,-Wno-pointer-arith) \
172 $(call kernel-cc-option,-Wno-aggregate-return) \ 176 $(call kernel-cc-option,-Wno-aggregate-return) \
173 $(call kernel-cc-option,-Wno-unused-but-set-variable) \ 177 $(call kernel-cc-option,-Wno-unused-but-set-variable) \
178 $(call kernel-cc-option,-Wno-ignored-qualifiers) \
174 $(call kernel-cc-option,-Wno-old-style-declaration) \ 179 $(call kernel-cc-option,-Wno-old-style-declaration) \
175 $(call kernel-cc-optional-warning,-Wbad-function-cast) \ 180 $(call kernel-cc-optional-warning,-Wbad-function-cast) \
176 $(call kernel-cc-optional-warning,-Wcast-qual) \ 181 $(call kernel-cc-optional-warning,-Wcast-qual) \
@@ -233,25 +238,18 @@ ALL_KBUILD_CFLAGS := $(COMMON_CFLAGS) $(KBUILD_FLAGS) $(TESTED_KBUILD_FLAGS)
233# For the same reason (Darwin 'ld') don't bother checking for text 238# For the same reason (Darwin 'ld') don't bother checking for text
234# relocations in host binaries. 239# relocations in host binaries.
235# 240#
236ALL_HOST_LDFLAGS := -L$(HOST_OUT) 241ALL_HOST_LDFLAGS :=
237ALL_LDFLAGS := \ 242ALL_LDFLAGS := -Wl,--warn-shared-textrel
238 -Wl,--warn-shared-textrel \
239 -L$(TARGET_OUT) -Xlinker -rpath-link=$(TARGET_OUT)
240
241ifneq ($(strip $(TOOLCHAIN)),)
242ALL_LDFLAGS += -L$(TOOLCHAIN)/lib -Xlinker -rpath-link=$(TOOLCHAIN)/lib
243endif
244 243
245ifneq ($(strip $(TOOLCHAIN2)),) 244ALL_LDFLAGS += $(SYS_LDFLAGS)
246ALL_LDFLAGS += -L$(TOOLCHAIN2)/lib -Xlinker -rpath-link=$(TOOLCHAIN2)/lib
247endif
248 245
249ifneq ($(strip $(LINKER_RPATH)),) 246# Optional security hardening features.
250ALL_LDFLAGS += $(addprefix -Xlinker -rpath=,$(LINKER_RPATH)) 247ifneq ($(FORTIFY),)
248ALL_CFLAGS += -fstack-protector -Wa,--noexecstack -D_FORTIFY_SOURCE=2
249ALL_CXXFLAGS += -fstack-protector -Wa,--noexecstack -D_FORTIFY_SOURCE=2
250ALL_LDFLAGS += -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now
251endif 251endif
252 252
253ALL_LDFLAGS += $(SYS_LDFLAGS)
254
255# This variable contains a list of all modules built by kbuild 253# This variable contains a list of all modules built by kbuild
256ALL_KBUILD_MODULES := 254ALL_KBUILD_MODULES :=
257 255
@@ -259,4 +257,11 @@ ALL_KBUILD_MODULES :=
259ALL_CXX_MODULES := 257ALL_CXX_MODULES :=
260 258
261# Toolchain triple for cross environment 259# Toolchain triple for cross environment
262CROSS_TRIPLE := $(patsubst %-,%,$(CROSS_COMPILE)) 260CROSS_TRIPLE := $(patsubst %-,%,$(notdir $(CROSS_COMPILE)))
261
262ifneq ($(TOOLCHAIN),)
263$(warning **********************************************)
264$(warning The TOOLCHAIN option has been removed, but)
265$(warning you have it set (via $(origin TOOLCHAIN)))
266$(warning **********************************************)
267endif