Skip to content

Commit

Permalink
gcc-plugins: arm_ssp_per_task_plugin: Fix for older GCC < 6
Browse files Browse the repository at this point in the history
Use gen_rtx_set instead of gen_rtx_SET. The former is a wrapper macro
that handles the difference between GCC versions implementing
the latter.

This fixes the following error on my system with g++ 5.4.0 as the host
compiler

   HOSTCXX -fPIC scripts/gcc-plugins/arm_ssp_per_task_plugin.o
 scripts/gcc-plugins/arm_ssp_per_task_plugin.c:42:14: error: macro "gen_rtx_SET" requires 3 arguments, but only 2 given
          mask)),
               ^
 scripts/gcc-plugins/arm_ssp_per_task_plugin.c: In function ‘unsigned int arm_pertask_ssp_rtl_execute()’:
 scripts/gcc-plugins/arm_ssp_per_task_plugin.c:39:20: error: ‘gen_rtx_SET’ was not declared in this scope
    emit_insn_before(gen_rtx_SET

Signed-off-by: Chris Packham <[email protected]>
Fixes: 189af46 ("ARM: smp: add support for per-task stack canaries")
Cc: [email protected]
Tested-by: Douglas Anderson <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
  • Loading branch information
cpackham-atlnz authored and kees committed May 10, 2019
1 parent e93c9c9 commit 259799e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/gcc-plugins/arm_ssp_per_task_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static unsigned int arm_pertask_ssp_rtl_execute(void)
mask = GEN_INT(sext_hwi(sp_mask, GET_MODE_PRECISION(Pmode)));
masked_sp = gen_reg_rtx(Pmode);

emit_insn_before(gen_rtx_SET(masked_sp,
emit_insn_before(gen_rtx_set(masked_sp,
gen_rtx_AND(Pmode,
stack_pointer_rtx,
mask)),
Expand Down

0 comments on commit 259799e

Please sign in to comment.