When BR2_SHARED_LIBS=y (shared libraries only) and BR2_PIC_PIE=y
(Build code with PIC/PIE), the toolchain-wrapper will try to enable
position-independent code/executables. See [1]. This configuration
is a common default.
Xvisor was likely tested only with RISC-V gcc from [2], which will
not enable PIE by default. Since Xvisor is a Type 1 hypervisor, it
needs the same kind of special treatment as U-Boot or Kernel.
This commit adds a patch to explicitly force static linking and
disable PIE for RISC-V architecture.
[1] https://git.buildroot.org/buildroot/tree/toolchain/toolchain-wrapper.c?h=2023.05.1#n392
[2] https://github.com/riscv-collab/riscv-gnu-toolchain
Signed-off-by: Julien Olivain <ju.o@free.fr>
[Arnout: renumber patch]
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>