[PATCH v8 1/3] riscv: Introduce CONFIG_RELOCATABLE

Andreas Schwab schwab at linux-m68k.org
Fri May 19 14:48:59 PDT 2023


On Mai 19 2023, Alexandre Ghiti wrote:

> I have tested the following patch successfully, can you give it a try
> while I make sure this is the only place I forgot to add the -fno-pie
> flag?
>
> diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile
> index fbdccc21418a..153864e4f399 100644
> --- a/arch/riscv/kernel/Makefile
> +++ b/arch/riscv/kernel/Makefile
> @@ -23,6 +23,10 @@ ifdef CONFIG_FTRACE
>  CFLAGS_REMOVE_alternative.o = $(CC_FLAGS_FTRACE)
>  CFLAGS_REMOVE_cpufeature.o = $(CC_FLAGS_FTRACE)
>  endif
> +ifdef CONFIG_RELOCATABLE
> +CFLAGS_alternative.o += -fno-pie
> +CFLAGS_cpufeature.o += -fno-pie
> +endif
>  ifdef CONFIG_KASAN
>  KASAN_SANITIZE_alternative.o := n
>  KASAN_SANITIZE_cpufeature.o := n

I can confirm that this fixes the crash.

-- 
Andreas Schwab, schwab at linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



More information about the linux-riscv mailing list