Skip to content

Commit a18b14d

Browse files
groeckpalmer-dabbelt
authored andcommitted
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: fea2fed ("riscv: Enable per-task stack canaries") Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent d095604 commit a18b14d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/riscv/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ config CC_HAVE_STACKPROTECTOR_TLS
492492

493493
config STACKPROTECTOR_PER_TASK
494494
def_bool y
495+
depends on !GCC_PLUGIN_RANDSTRUCT
495496
depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_TLS
496497

497498
config PHYS_RAM_BASE

0 commit comments

Comments
 (0)