diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile index 3ce9ac169bd1..5a755c1d329f 100644 --- a/stand/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -1,128 +1,128 @@ LOADER_NET_SUPPORT?= yes LOADER_MSDOS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no .include LOADER?= loader_${LOADER_INTERP} PROG= ${LOADER}.sym INTERNALPROG= WARNS?= 3 # architecture-specific loader code SRCS= autoload.c \ bootinfo.c \ conf.c \ copy.c \ efi_main.c \ framebuffer.c \ main.c \ self_reloc.c \ vers.c \ gfx_fb.c \ 8x16.c CFLAGS+= -I${.CURDIR}/../loader .if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} CFLAGS+= -I${SYSDIR}/contrib/openzfs/include CFLAGS+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs CFLAGS+= -DEFI_ZFS_BOOT HAVE_ZFS= yes .endif CFLAGS.bootinfo.c += -I$(SRCTOP)/sys/teken CFLAGS.bootinfo.c += -I${SRCTOP}/contrib/pnglite CFLAGS.framebuffer.c += -I$(SRCTOP)/sys/teken CFLAGS.framebuffer.c += -I${SRCTOP}/contrib/pnglite CFLAGS.main.c += -I$(SRCTOP)/sys/teken CFLAGS.main.c += -I${SRCTOP}/contrib/pnglite CFLAGS.gfx_fb.c += -I$(SRCTOP)/sys/teken CFLAGS.gfx_fb.c += -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 CFLAGS.gfx_fb.c += -I${SRCTOP}/contrib/pnglite CFLAGS.gfx_fb.c += -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead # of a short. There's no good cast to use here so just ignore the # warnings for now. CWARNFLAGS.main.c+= -Wno-format .PATH: ${.CURDIR}/../loader .PATH: ${.CURDIR}/../loader/arch/${MACHINE} .include "${.CURDIR}/../loader/arch/${MACHINE}/Makefile.inc" CFLAGS+= -I${.CURDIR} CFLAGS+= -I${.CURDIR}/arch/${MACHINE} CFLAGS+= -I${EFISRC}/include CFLAGS+= -I${EFISRC}/include/${MACHINE} CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include CFLAGS+= -I${BOOTSRC}/i386/libi386 CFLAGS+= -DEFI .if defined(HAVE_FDT) && ${MK_FDT} != "no" .include "${BOOTSRC}/fdt.mk" LIBEFI_FDT= ${BOOTOBJ}/efi/fdt/libefi_fdt.a HELP_FILES+= ${FDTSRC}/help.fdt .endif # Include bcache code. HAVE_BCACHE= yes .if defined(EFI_STAGING_SIZE) CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE} .endif .if ${MK_LOADER_EFI_SECUREBOOT} != "no" CFLAGS+= -DEFI_SECUREBOOT .endif NEWVERSWHAT= "EFI loader" ${MACHINE} VERSION_FILE= ${.CURDIR}/../loader/version HELP_FILENAME= loader.help.efi # Always add MI sources .include "${BOOTSRC}/loader.mk" CLEANFILES+= 8x16.c 8x16.c: ${SRCTOP}/contrib/terminus/ter-u16b.bdf vtfontcvt -f compressed-source -o ${.TARGET} ${.ALLSRC} FILES+= ${LOADER}.efi FILESMODE_${LOADER}.efi= ${BINMODE} .if ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} LINKS+= ${BINDIR}/${LOADER}.efi ${BINDIR}/loader.efi .endif LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -pie .if ${LINKER_TYPE} == "bfd" && ${LINKER_VERSION} >= 23400 LDFLAGS+= -Wl,--no-dynamic-linker .endif CLEANFILES+= ${LOADER}.efi ${LOADER}.efi: ${PROG} @if ${NM} ${.ALLSRC} | grep ' U '; then \ echo "Undefined symbols in ${.ALLSRC}"; \ exit 1; \ fi SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ ${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ -j set_Xficl_compile_set \ --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} LIBEFI= ${BOOTOBJ}/efi/libefi/libefi.a -DPADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} ${LDSCRIPT} -LDADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} +DPADD= ${LDR_INTERP} ${LIBEFI} ${LIBSAFDT} ${LIBEFI_FDT} ${LIBSA} ${LDSCRIPT} +LDADD= ${LDR_INTERP} ${LIBEFI} ${LIBSAFDT} ${LIBEFI_FDT} ${LIBSA} .include diff --git a/stand/fdt.mk b/stand/fdt.mk index 56c9ff95b5ad..1b3df587d0db 100644 --- a/stand/fdt.mk +++ b/stand/fdt.mk @@ -1,8 +1,8 @@ .if ${MK_FDT} == "yes" CFLAGS+= -I${FDTSRC} CFLAGS+= -I${BOOTOBJ}/fdt CFLAGS+= -I${SYSDIR}/contrib/libfdt CFLAGS+= -DLOADER_FDT_SUPPORT -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a +LIBSAFDT= ${BOOTOBJ}/fdt/libfdt.a .endif diff --git a/stand/kboot/Makefile b/stand/kboot/Makefile index f5049a1c19c0..b9d68cddf97d 100644 --- a/stand/kboot/Makefile +++ b/stand/kboot/Makefile @@ -1,69 +1,69 @@ LOADER_DISK_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes LOADER_MSDOS_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_ZFS_SUPPORT?= yes LOADER_NET_SUPPORT?= no LOADER_NFS_SUPPORT?= no LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no .include PROG= loader.kboot NEWVERSWHAT= "kboot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code SRCS= \ bootinfo.c \ conf.c \ crt1.c \ gfx_fb_stub.c \ host_syscalls.c \ hostcons.c \ hostdisk.c \ hostfs.c \ init.c \ kbootfdt.c \ main.c \ seg.c \ termios.c \ util.c \ vers.c CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken .if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} CFLAGS+= -I${SYSDIR}/contrib/openzfs/include CFLAGS+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs HAVE_ZFS=yes .endif HELP_FILENAME= loader.help.kboot .include "${BOOTSRC}/fdt.mk" # We share bootinfo.c with efi .PATH: ${BOOTSRC}/efi/loader # Note: Since we're producing a userland binary, we key off of MACHINE_ARCH # instead of the more normal MACHINE since the changes between different flavors # of MACHINE_ARCH are large enough in Linux that it's easier that way. .PATH: ${.CURDIR}/arch/${MACHINE_ARCH} .include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc" # Always add MI sources .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern CFLAGS+= -I${.CURDIR} -I${.CURDIR}/arch/${MACHINE_ARCH} CFLAGS+= -Wall -DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} -LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} +DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA} +LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA} .include diff --git a/stand/powerpc/ofw/Makefile b/stand/powerpc/ofw/Makefile index 2beb315a4d41..3e4c92220fac 100644 --- a/stand/powerpc/ofw/Makefile +++ b/stand/powerpc/ofw/Makefile @@ -1,67 +1,67 @@ LOADER_CD9660_SUPPORT?= yes LOADER_EXT2FS_SUPPORT?= no LOADER_MSDOS_SUPPORT?= no LOADER_UFS_SUPPORT?= yes LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= no .include PROG= loader NEWVERSWHAT= "Open Firmware loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code SRCS= conf.c vers.c main.c elf_freebsd.c ppc64_elf_freebsd.c start.c SRCS+= ucmpdi2.c gfx_fb_stub.c CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken .include "${BOOTSRC}/fdt.mk" .if ${MK_FDT} == "yes" SRCS+= ofwfdt.c .endif .if ${MACHINE_ARCH:Mpowerpc64*} != "" SRCS+= cas.c CFLAGS+= -DCAS .endif .if ${MACHINE_ARCH} == "powerpc64le" SRCS+= trampolineLE.S .endif HELP_FILES= ${FDTSRC}/help.fdt HELP_FILENAME= loader.help.ofw # Always add MI sources .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern # load address. set in linker script RELOC?= 0x1C00000 CFLAGS+= -DRELOC=${RELOC} -g LDFLAGS= -nostdlib -static .if ${MACHINE_ARCH} == "powerpc64le" LDFLAGS+= -T ${.CURDIR}/ldscript.powerpcle .else LDFLAGS+= -T ${.CURDIR}/ldscript.powerpc .endif # Open Firmware standalone support library LIBOFW= ${BOOTOBJ}/libofw/libofw.a CFLAGS+= -I${BOOTSRC}/libofw -DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} -LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} +DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA} +LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA} MK_PIE= no .include diff --git a/stand/uboot/Makefile b/stand/uboot/Makefile index 1cc4abe86d9b..83ac5949cbb3 100644 --- a/stand/uboot/Makefile +++ b/stand/uboot/Makefile @@ -1,84 +1,84 @@ LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_MSDOS_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no LOADER_DISK_SUPPORT?= yes .include .include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc" LOADER_UBLDR_BIN?= yes .if ${LOADER_UBLDR_BIN} != "no" FILES+= ubldr ubldr.bin .else PROG= ubldr .endif NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} BINDIR= /boot/uboot INSTALLFLAGS= -b WARNS?= 1 .PATH: ${BOOTSRC}/common .PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH} .if ${COMPILER_TYPE} == "gcc" CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif HELP_FILES= ${.CURDIR}/help.uboot ${BOOTSRC}/fdt/help.fdt HELP_FILENAME= loader.help.uboot # Always add MI sources .include "${BOOTSRC}/loader.mk" LDSCRIPT= ${.CURDIR}/arch/${MACHINE_CPUARCH}/ldscript.${MACHINE_CPUARCH} LDFLAGS= -nostdlib -static -T ${LDSCRIPT} LDFLAGS+= -Wl,-znotext SRCS+= main.c vers.c SRCS+= copy.c devicename.c elf_freebsd.c glue.c SRCS+= net.c reboot.c time.c gfx_fb_stub.c SRCS+= uboot_console.c uboot_disk.c uboot_fdt.c uboot_module.c CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken CFLAGS.glue.c+= -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib CFLAGS+= -I${BOOTSRC}/common CFLAGS+= -I${.CURDIR} CFLAGS+= -I${.OBJDIR} .if ${MACHINE_CPUARCH} == "arm" SRCS+= metadata.c .endif .include "${BOOTSRC}/fdt.mk" # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} # libfdt headers CFLAGS+= -I${FDTSRC} .ifdef(BOOT_DISK_DEBUG) # Make the disk code more talkative CFLAGS+= -DDISK_DEBUG .endif .if ${LOADER_UBLDR_BIN} != "no" OBJS+= ${SRCS:N*.h:R:S/$/.o/g} ubldr ubldr.bin ubldr.pie: ${OBJS} .endif -DPADD= ${LDR_INTERP} ${LIBFDT} ${LIBSA} -LDADD= ${LDR_INTERP} ${LIBFDT} ${LIBSA} +DPADD= ${LDR_INTERP} ${LIBSAFDT} ${LIBSA} +LDADD= ${LDR_INTERP} ${LIBSAFDT} ${LIBSA} .include