Disable PIE for powerpc bootloaders.

Bootloaders for powerpc are not built as position independent
code. Since bsd.prog.mk is used for building, when PIE is enabled,
the PIE flags are added and that causes the build to fail.
Adding MK_PIE=no stops bsd.prog.mk from adding PIE specific flags.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Reviewed by: emaste
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D28893
This commit is contained in:
Marcin Wojtas 2021-02-23 13:42:26 +01:00
parent cd992885bc
commit 3aa023643e
4 changed files with 8 additions and 0 deletions

View File

@ -43,5 +43,7 @@ boot1.hfs: boot1.elf bootinfo.txt
CLEANFILES+= boot1.hfs CLEANFILES+= boot1.hfs
MK_PIE= no
.include <bsd.prog.mk> .include <bsd.prog.mk>

View File

@ -42,4 +42,6 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc
DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA}
LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA}
MK_PIE= no
.include <bsd.prog.mk> .include <bsd.prog.mk>

View File

@ -53,4 +53,6 @@ CFLAGS+= -I${BOOTSRC}/libofw
DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA}
LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA}
MK_PIE= no
.include <bsd.prog.mk> .include <bsd.prog.mk>

View File

@ -31,4 +31,6 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc
DPADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} DPADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA}
LDADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} LDADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA}
MK_PIE= no
.include <bsd.prog.mk> .include <bsd.prog.mk>