summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2021-07-06 19:26:21 +0300
committerPalmer Dabbelt <palmerdabbelt@google.com>2021-08-04 07:24:48 +0300
commita18b14d8886614b3c7d290c4cfc33389822b0535 (patch)
tree0c89003076bb79ec85965fd5bae07dc024df86ac /arch
parentd09560435cb712c9ec1e62b8a43a79b0af69fe77 (diff)
downloadlinux-a18b14d8886614b3c7d290c4cfc33389822b0535.tar.xz
riscv: Disable STACKPROTECTOR_PER_TASK if GCC_PLUGIN_RANDSTRUCT is enabled
riscv uses the value of TSK_STACK_CANARY to set stack-protector-guard-offset. With GCC_PLUGIN_RANDSTRUCT enabled, that value is non-deterministic, and with riscv:allmodconfig often results in build errors such as cc1: error: '8120' is not a valid offset in '-mstack-protector-guard-offset=' Enable STACKPROTECTOR_PER_TASK only if GCC_PLUGIN_RANDSTRUCT is disabled to fix the problem. Fixes: fea2fed201ee5 ("riscv: Enable per-task stack canaries") Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/riscv/Kconfig1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 8fcceb8eda07..31f9e92f1402 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -492,6 +492,7 @@ config CC_HAVE_STACKPROTECTOR_TLS
config STACKPROTECTOR_PER_TASK
def_bool y
+ depends on !GCC_PLUGIN_RANDSTRUCT
depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_TLS
config PHYS_RAM_BASE