Changeset View
Changeset View
Standalone View
Standalone View
sys/boot/efi/boot1/Makefile
# $FreeBSD$ | # $FreeBSD$ | ||||
MAN= | MAN= | ||||
.include <src.opts.mk> | .include <src.opts.mk> | ||||
MK_SSP= no | MK_SSP= no | ||||
PROG= boot1.sym | PROG= boot1.sym | ||||
INTERNALPROG= | INTERNALPROG= | ||||
WARNS?= 6 | WARNS?= 3 | ||||
# Include bcache code. | |||||
HAVE_BCACHE= yes | |||||
.if ${MK_ZFS} != "no" | .if ${MK_ZFS} != "no" | ||||
# Disable warnings that are currently incompatible with the zfs boot code | # Disable warnings that are currently incompatible with the zfs boot code | ||||
CWARNFLAGS.zfs_module.c += -Wno-array-bounds | CWARNFLAGS.boot1.c += -Wno-missing-variable-declarations | ||||
CWARNFLAGS.zfs_module.c += -Wno-cast-align | CWARNFLAGS.zfs.c += -Wno-incompatible-pointer-types-discards-qualifiers | ||||
CWARNFLAGS.zfs_module.c += -Wno-cast-qual | CWARNFLAGS.zfs.c += -Wno-missing-variable-declarations | ||||
CWARNFLAGS.zfs_module.c += -Wno-missing-prototypes | CWARNFLAGS.zfs.c += -Wno-array-bounds | ||||
CWARNFLAGS.zfs_module.c += -Wno-sign-compare | CWARNFLAGS.zfs.c += -Wno-cast-align | ||||
CWARNFLAGS.zfs_module.c += -Wno-unused-parameter | CWARNFLAGS.zfs.c += -Wno-cast-qual | ||||
CWARNFLAGS.zfs_module.c += -Wno-unused-function | CWARNFLAGS.zfs.c += -Wno-missing-prototypes | ||||
CWARNFLAGS.zfs.c += -Wno-sign-compare | |||||
CWARNFLAGS.zfs.c += -Wno-unused-parameter | |||||
CWARNFLAGS.zfs.c += -Wno-unused-function | |||||
imp: What triggers this?
| |||||
Done Inline ActionsLikely remnant of older changes. Removed in my repo eric_metricspace.net: Likely remnant of older changes. Removed in my repo | |||||
CWARNFLAGS.skein.c += -Wno-cast-align | CWARNFLAGS.skein.c += -Wno-cast-align | ||||
.if ${COMPILER_TYPE} == "clang" | .if ${COMPILER_TYPE} == "clang" | ||||
CWARNFLAGS.skein.c += -Wno-missing-variable-declarations | CWARNFLAGS.skein.c += -Wno-missing-variable-declarations | ||||
.else if ${COMPILER_TYPE} == "gcc" | .else if ${COMPILER_TYPE} == "gcc" | ||||
CWARNFLAGS.skein.c += -Wno-missing-declarations | CWARNFLAGS.skein.c += -Wno-missing-declarations | ||||
.endif | .endif | ||||
.endif | .endif | ||||
Done Inline Actionsexcess newline allanjude: excess newline | |||||
# architecture-specific loader code | # architecture-specific loader code | ||||
SRCS= boot1.c self_reloc.c start.S ufs_module.c | SRCS= boot1.c self_reloc.c start.S | ||||
.if ${MK_ZFS} != "no" | .if ${MK_ZFS} != "no" | ||||
SRCS+= zfs_module.c | .PATH: ${.CURDIR}/../../../crypto/skein | ||||
SRCS+= skein.c skein_block.c | SRCS+= skein.c skein_block.c | ||||
# Do not unroll skein loops, reduce code size | # Do not unroll skein loops, reduce code size | ||||
CFLAGS+= -DSKEIN_LOOP=111 | CFLAGS+= -DSKEIN_LOOP=111 | ||||
.PATH: ${.CURDIR}/../../../crypto/skein | .PATH: ${.CURDIR}/../../zfs | ||||
SRCS+= zfs.c | |||||
.endif | .endif | ||||
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 | .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 | ||||
CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized | CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized | ||||
.endif | .endif | ||||
# Always add MI sources | |||||
.PATH: ${.CURDIR}/../../common | |||||
.include "${.CURDIR}/../../common/Makefile.inc" | |||||
CFLAGS+= -I${.CURDIR}/../../common | |||||
.PATH: ${.CURDIR}/arch/${MACHINE} | |||||
CFLAGS+= -I. | CFLAGS+= -I. | ||||
CFLAGS+= -I${.CURDIR}/../include | CFLAGS+= -I${.CURDIR}/../include | ||||
CFLAGS+= -I${.CURDIR}/../include/${MACHINE} | CFLAGS+= -I${.CURDIR}/../include/${MACHINE} | ||||
CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include | CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include | ||||
CFLAGS+= -I${.CURDIR}/../../.. | CFLAGS+= -I${.CURDIR}/../../.. | ||||
CFLAGS+= -DEFI_UFS_BOOT | CFLAGS+= -DEFI_UFS_BOOT | ||||
.ifdef(EFI_DEBUG) | .ifdef(EFI_DEBUG) | ||||
CFLAGS+= -DEFI_DEBUG | CFLAGS+= -DEFI_DEBUG | ||||
.endif | .endif | ||||
.if ${MK_ZFS} != "no" | .if ${MK_ZFS} != "no" | ||||
CFLAGS+= -I${.CURDIR}/../../zfs/ | CFLAGS+= -I${.CURDIR}/../../zfs/ | ||||
CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs/ | CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs/ | ||||
CFLAGS+= -I${.CURDIR}/../../../crypto/skein | CFLAGS+= -I${.CURDIR}/../../../crypto/skein | ||||
CFLAGS+= -DEFI_ZFS_BOOT | CFLAGS+= -DEFI_ZFS_BOOT | ||||
.endif | .endif | ||||
# Always add MI sources and REGULAR efi loader bits | # Always add MI sources and REGULAR efi loader bits | ||||
.PATH: ${.CURDIR}/../loader/arch/${MACHINE} | .PATH: ${.CURDIR}/../loader/arch/${MACHINE} | ||||
.PATH: ${.CURDIR}/../loader | .PATH: ${.CURDIR}/../loader | ||||
.PATH: ${.CURDIR}/../../common | .PATH: ${.CURDIR}/../../common | ||||
CFLAGS+= -I${.CURDIR}/../../common | CFLAGS+= -I${.CURDIR}/../../common | ||||
# make buildenv doesn't set DESTDIR, this means LIBSTAND | |||||
# will be wrong when crossbuilding. | |||||
.if exists(${.OBJDIR}/../../../../lib/libstand/libstand.a) | |||||
Done Inline ActionsCan you you use SRCTOP/OBJTOP instead here? imp: Can you you use SRCTOP/OBJTOP instead here? | |||||
LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a | |||||
.endif | |||||
# Add libefi | |||||
.PATH: ${.CURDIR}/../libefi | |||||
LIBEFI= ${.OBJDIR}/../libefi/libefi.a | |||||
Done Inline ActionsNone of these changes are needed. imp: None of these changes are needed.
| |||||
FILES= boot1.efi boot1.efifat | FILES= boot1.efi boot1.efifat | ||||
FILESMODE_boot1.efi= ${BINMODE} | FILESMODE_boot1.efi= ${BINMODE} | ||||
LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} | LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} | ||||
LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared | LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared | ||||
.if ${MACHINE_CPUARCH} == "aarch64" | .if ${MACHINE_CPUARCH} == "aarch64" | ||||
CFLAGS+= -mgeneral-regs-only | CFLAGS+= -mgeneral-regs-only | ||||
.endif | .endif | ||||
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" | .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" | ||||
CFLAGS+= -fPIC | CFLAGS+= -fPIC | ||||
LDFLAGS+= -Wl,-znocombreloc | LDFLAGS+= -Wl,-znocombreloc | ||||
.endif | .endif | ||||
# | # | ||||
Done Inline Actionsbecause this is already here, LIBSTAND is already properly defined, and we don't need to add the .PATH statements. imp: because this is already here, LIBSTAND is already properly defined, and we don't need to add… | |||||
# Add libstand for the runtime functions used by the compiler - for example | # Add libstand for the runtime functions used by the compiler - for example | ||||
# __aeabi_* (arm) or __divdi3 (i386). | # __aeabi_* (arm) or __divdi3 (i386). | ||||
# as well as required string and memory functions for all platforms. | # as well as required string and memory functions for all platforms. | ||||
# | # | ||||
DPADD+= ${LIBSTAND} | DPADD+= ${LIBEFI} ${LIBSTAND} | ||||
LDADD+= -lstand | LDADD+= ${LIBEFI} ${LIBSTAND} | ||||
Done Inline ActionsThis is good, however. imp: This is good, however. | |||||
DPADD+= ${LDSCRIPT} | DPADD+= ${LDSCRIPT} | ||||
NM?= nm | NM?= nm | ||||
OBJCOPY?= objcopy | OBJCOPY?= objcopy | ||||
.if ${MACHINE_CPUARCH} == "amd64" | .if ${MACHINE_CPUARCH} == "amd64" | ||||
EFI_TARGET= efi-app-x86_64 | EFI_TARGET= efi-app-x86_64 | ||||
Show All 9 Lines | |||||
boot1.efi: ${PROG} | boot1.efi: ${PROG} | ||||
if ${NM} ${.ALLSRC} | grep ' U '; then \ | if ${NM} ${.ALLSRC} | grep ' U '; then \ | ||||
echo "Undefined symbols in ${.ALLSRC}"; \ | echo "Undefined symbols in ${.ALLSRC}"; \ | ||||
exit 1; \ | exit 1; \ | ||||
fi | fi | ||||
SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ | SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ | ||||
${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \ | ${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \ | ||||
-j .dynamic -j .dynsym -j .rel.dyn \ | -j .dynamic -j .dynsym -j .rel.dyn \ | ||||
-j .rela.dyn -j .reloc -j .eh_frame \ | -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ | ||||
Not Done Inline ActionsI have another change that hoists this up into Makefile.inc imp: I have another change that hoists this up into Makefile.inc | |||||
--output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} | --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} | ||||
boot1.o: ${.CURDIR}/../../common/ufsread.c | boot1.o: ${.CURDIR}/../../common/ufsread.c | ||||
# The following inserts our objects into a template FAT file system | # The following inserts our objects into a template FAT file system | ||||
# created by generate-fat.sh | # created by generate-fat.sh | ||||
.include "${.CURDIR}/Makefile.fat" | .include "${.CURDIR}/Makefile.fat" | ||||
BOOT1_MAXSIZE?= 131072 | BOOT1_MAXSIZE?= 524288 | ||||
boot1.efifat: boot1.efi | boot1.efifat: boot1.efi | ||||
@set -- `ls -l ${.ALLSRC}`; \ | @set -- `ls -l ${.ALLSRC}`; \ | ||||
x=$$(($$5-${BOOT1_MAXSIZE})); \ | x=$$(($$5-${BOOT1_MAXSIZE})); \ | ||||
if [ $$x -ge 0 ]; then \ | if [ $$x -ge 0 ]; then \ | ||||
echo "boot1 $$x bytes too large; regenerate FAT templates?" >&2 ;\ | echo "boot1 $$x bytes too large; regenerate FAT templates?" >&2 ;\ | ||||
exit 1; \ | exit 1; \ | ||||
fi | fi | ||||
Show All 24 Lines |
What triggers this?