[PATCH] firmware: Detect whether the toolchain supports pie and automatically disable the FW_PIC option

Jessica Clarke jrtc27 at jrtc27.com
Sat Jul 10 11:24:33 PDT 2021


On 10 Jul 2021, at 19:21, Xiang W <wxjstz at 126.com> wrote:
> 
> Signed-off-by: Xiang W <wxjstz at 126.com>
> ---
> firmware/objects.mk | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/firmware/objects.mk b/firmware/objects.mk
> index ce91c2f..96a8d7d 100644
> --- a/firmware/objects.mk
> +++ b/firmware/objects.mk
> @@ -17,6 +17,10 @@ ifndef FW_PIC
> FW_PIC := y
> endif
> 
> +ifeq ($(FW_PIC),y)
> +FW_PIC := $(shell $(CC) -nostdlib -fPIE -Wl,-pie /dev/null  -o /dev/null 2>/dev/null && echo y || echo n)
> +endif

/dev/null is not a valid object. This always gives n.

Jess




More information about the opensbi mailing list