diff options
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.mk | 41 |
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 | # |
51 | COMMON_FLAGS := -W -Wall | 54 | COMMON_FLAGS := -W -Wall |
@@ -54,7 +57,7 @@ COMMON_FLAGS := -W -Wall | |||
54 | # | 57 | # |
55 | COMMON_CFLAGS := $(COMMON_FLAGS) \ | 58 | COMMON_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 | # |
79 | COMMON_USER_FLAGS += -g $(ANDROID_FPGA_FORCE_32BIT) | 82 | COMMON_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 |
166 | KBUILD_FLAGS += -fno-pic | 169 | KBUILD_FLAGS += -fno-pic |
170 | KBUILD_FLAGS += -fstack-protector-strong | ||
167 | 171 | ||
168 | TESTED_KBUILD_FLAGS := \ | 172 | TESTED_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 | # |
236 | ALL_HOST_LDFLAGS := -L$(HOST_OUT) | 241 | ALL_HOST_LDFLAGS := |
237 | ALL_LDFLAGS := \ | 242 | ALL_LDFLAGS := -Wl,--warn-shared-textrel |
238 | -Wl,--warn-shared-textrel \ | ||
239 | -L$(TARGET_OUT) -Xlinker -rpath-link=$(TARGET_OUT) | ||
240 | |||
241 | ifneq ($(strip $(TOOLCHAIN)),) | ||
242 | ALL_LDFLAGS += -L$(TOOLCHAIN)/lib -Xlinker -rpath-link=$(TOOLCHAIN)/lib | ||
243 | endif | ||
244 | 243 | ||
245 | ifneq ($(strip $(TOOLCHAIN2)),) | 244 | ALL_LDFLAGS += $(SYS_LDFLAGS) |
246 | ALL_LDFLAGS += -L$(TOOLCHAIN2)/lib -Xlinker -rpath-link=$(TOOLCHAIN2)/lib | ||
247 | endif | ||
248 | 245 | ||
249 | ifneq ($(strip $(LINKER_RPATH)),) | 246 | # Optional security hardening features. |
250 | ALL_LDFLAGS += $(addprefix -Xlinker -rpath=,$(LINKER_RPATH)) | 247 | ifneq ($(FORTIFY),) |
248 | ALL_CFLAGS += -fstack-protector -Wa,--noexecstack -D_FORTIFY_SOURCE=2 | ||
249 | ALL_CXXFLAGS += -fstack-protector -Wa,--noexecstack -D_FORTIFY_SOURCE=2 | ||
250 | ALL_LDFLAGS += -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now | ||
251 | endif | 251 | endif |
252 | 252 | ||
253 | ALL_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 |
256 | ALL_KBUILD_MODULES := | 254 | ALL_KBUILD_MODULES := |
257 | 255 | ||
@@ -259,4 +257,11 @@ ALL_KBUILD_MODULES := | |||
259 | ALL_CXX_MODULES := | 257 | ALL_CXX_MODULES := |
260 | 258 | ||
261 | # Toolchain triple for cross environment | 259 | # Toolchain triple for cross environment |
262 | CROSS_TRIPLE := $(patsubst %-,%,$(CROSS_COMPILE)) | 260 | CROSS_TRIPLE := $(patsubst %-,%,$(notdir $(CROSS_COMPILE))) |
261 | |||
262 | ifneq ($(TOOLCHAIN),) | ||
263 | $(warning **********************************************) | ||
264 | $(warning The TOOLCHAIN option has been removed, but) | ||
265 | $(warning you have it set (via $(origin TOOLCHAIN))) | ||
266 | $(warning **********************************************) | ||
267 | endif | ||