|
@@ -113,7 +113,11 @@ KBUILD_ARFLAGS += --target=elf$(BITS)-$(GNUTARGET)
|
|
|
endif
|
|
|
|
|
|
cflags-$(CONFIG_STACKPROTECTOR) += -mstack-protector-guard=tls
|
|
|
+ifdef CONFIG_PPC64
|
|
|
+cflags-$(CONFIG_STACKPROTECTOR) += -mstack-protector-guard-reg=r13
|
|
|
+else
|
|
|
cflags-$(CONFIG_STACKPROTECTOR) += -mstack-protector-guard-reg=r2
|
|
|
+endif
|
|
|
|
|
|
LDFLAGS_vmlinux-y := -Bstatic
|
|
|
LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie
|
|
@@ -411,8 +415,12 @@ ifdef CONFIG_STACKPROTECTOR
|
|
|
prepare: stack_protector_prepare
|
|
|
|
|
|
stack_protector_prepare: prepare0
|
|
|
+ifdef CONFIG_PPC64
|
|
|
+ $(eval KBUILD_CFLAGS += -mstack-protector-guard-offset=$(shell awk '{if ($$2 == "PACA_CANARY") print $$3;}' include/generated/asm-offsets.h))
|
|
|
+else
|
|
|
$(eval KBUILD_CFLAGS += -mstack-protector-guard-offset=$(shell awk '{if ($$2 == "TASK_CANARY") print $$3;}' include/generated/asm-offsets.h))
|
|
|
endif
|
|
|
+endif
|
|
|
|
|
|
# Use the file '.tmp_gas_check' for binutils tests, as gas won't output
|
|
|
# to stdout and these checks are run even on install targets.
|