Index: head/stand/arm/Makefile =================================================================== --- head/stand/arm/Makefile (revision 330003) +++ head/stand/arm/Makefile (revision 330004) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + SUBDIR= uboot .include Index: head/stand/defs.mk =================================================================== --- head/stand/defs.mk (revision 330003) +++ head/stand/defs.mk (revision 330004) @@ -1,194 +1,195 @@ # $FreeBSD$ .include WARNS?=1 .if !defined(__BOOT_DEFS_MK__) __BOOT_DEFS_MK__=${MFILE} MK_CTF= no MK_SSP= no MK_PROFILE= no MAN= .if !defined(PIC) NO_PIC= INTERNALLIB= .endif BOOTSRC= ${SRCTOP}/stand EFISRC= ${BOOTSRC}/efi EFIINC= ${EFISRC}/include EFIINCMD= ${EFIINC}/${MACHINE} FDTSRC= ${BOOTSRC}/fdt FICLSRC= ${BOOTSRC}/ficl LDRSRC= ${BOOTSRC}/common LIBLUASRC= ${BOOTSRC}/liblua LUASRC= ${SRCTOP}/contrib/lua/src SASRC= ${BOOTSRC}/libsa SYSDIR= ${SRCTOP}/sys UBOOTSRC= ${BOOTSRC}/uboot ZFSSRC= ${BOOTSRC}/zfs BOOTOBJ= ${OBJTOP}/stand # BINDIR is where we install BINDIR?= /boot LIBSA= ${BOOTOBJ}/libsa/libsa.a .if ${MACHINE} == "i386" LIBSA32= ${LIBSA} .else LIBSA32= ${BOOTOBJ}/libsa32/libsa32.a .endif # Standard options: CFLAGS+= -nostdinc .if ${MACHINE_ARCH} == "amd64" && ${DO32:U0} == 1 CFLAGS+= -I${BOOTOBJ}/libsa32 .else CFLAGS+= -I${BOOTOBJ}/libsa .endif CFLAGS+= -I${SASRC} -D_STANDALONE CFLAGS+= -I${SYSDIR} # Spike the floating point interfaces CFLAGS+= -Ddouble=jagged-little-pill -Dfloat=floaty-mcfloatface # GELI Support, with backward compat hooks (mostly) .if defined(HAVE_GELI) .if defined(LOADER_NO_GELI_SUPPORT) MK_LOADER_GELI=no .warning "Please move from LOADER_NO_GELI_SUPPORT to WITHOUT_LOADER_GELI" .endif .if defined(LOADER_GELI_SUPPORT) MK_LOADER_GELI=yes .warning "Please move from LOADER_GELI_SUPPORT to WITH_LOADER_GELI" .endif .if ${MK_LOADER_GELI} == "yes" CFLAGS+= -DLOADER_GELI_SUPPORT CFLAGS+= -I${BOOTSRC}/geli LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a .endif # MK_LOADER_GELI .endif # HAVE_GELI # These should be confined to loader.mk, but can't because uboot/lib # also uses it. It's part of loader, but isn't a loader so we can't # just include loader.mk .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" CFLAGS+= -DLOADER_DISK_SUPPORT .endif # Machine specific flags for all builds here # All PowerPC builds are 32 bit. We have no 64-bit loaders on powerpc # or powerpc64. .if ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -m32 -mcpu=powerpc .endif # For amd64, there's a bit of mixed bag. Some of the tree (i386, lib*32) is # build 32-bit and some 64-bit (lib*, efi). Centralize all the 32-bit magic here # and activate it when DO32 is explicitly defined to be 1. .if ${MACHINE_ARCH} == "amd64" && ${DO32:U0} == 1 CFLAGS+= -m32 -mcpu=i386 # LD_FLAGS is passed directly to ${LD}, not via ${CC}: LD_FLAGS+= -m elf_i386_fbsd AFLAGS+= --32 .endif SSP_CFLAGS= # Add in the no float / no SIMD stuff and announce we're freestanding # aarch64 and riscv don't have -msoft-float, but all others do. riscv # currently has no /boot/loader, but may soon. CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD} .if ${MACHINE_CPUARCH} == "aarch64" CFLAGS+= -mgeneral-regs-only -fPIC .elif ${MACHINE_CPUARCH} == "riscv" CFLAGS+= -march=rv64imac -mabi=lp64 .else CFLAGS+= -msoft-float .endif .if ${MACHINE_CPUARCH} == "i386" || (${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1) CFLAGS+= -march=i386 CFLAGS.gcc+= -mpreferred-stack-boundary=2 .endif .if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0 CFLAGS+= -fPIC -mno-red-zone .endif .if ${MACHINE_CPUARCH} == "arm" # Do not generate movt/movw, because the relocation fixup for them does not # translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). # Also, the fpu is not available in a standalone environment. .if ${COMPILER_VERSION} < 30800 CFLAGS.clang+= -mllvm -arm-use-movt=0 .else CFLAGS.clang+= -mno-movt .endif CFLAGS.clang+= -mfpu=none CFLAGS+= -fPIC .endif # The boot loader build uses dd status=none, where possible, for reproducible # build output (since performance varies from run to run). Trouble is that # option was recently (10.3) added to FreeBSD and is non-standard. Only use it # when this test succeeds rather than require dd to be a bootstrap tool. DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true DD=dd ${DD_NOSTATUS} .if ${MACHINE_CPUARCH} == "mips" CFLAGS+= -G0 -fno-pic -mno-abicalls .endif .if ${MK_LOADER_FORCE_LE} != "no" .if ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -mlittle-endian .endif .endif # Make sure we use the machine link we're about to create CFLAGS+=-I. _ILINKS=machine .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" _ILINKS+=${MACHINE_CPUARCH} .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" _ILINKS+=x86 .endif CLEANFILES+=${_ILINKS} all: ${PROG} +.if !defined(NO_OBJ) beforedepend: ${_ILINKS} beforebuild: ${_ILINKS} # Ensure that the links exist without depending on it when it exists which # causes all the modules to be rebuilt when the directory pointed to changes. .for _link in ${_ILINKS} .if !exists(${.OBJDIR}/${_link}) ${OBJS}: ${_link} .endif .endfor .NOPATH: ${_ILINKS} ${_ILINKS}: @case ${.TARGET} in \ machine) \ if [ ${DO32:U0} -eq 0 ]; then \ path=${SYSDIR}/${MACHINE}/include ; \ else \ path=${SYSDIR}/${MACHINE:C/amd64/i386/}/include ; \ fi ;; \ *) \ path=${SYSDIR}/${.TARGET:T}/include ;; \ esac ; \ path=`(cd $$path && /bin/pwd)` ; \ ${ECHO} ${.TARGET:T} "->" $$path ; \ ln -fhs $$path ${.TARGET:T} - +.endif .endif # __BOOT_DEFS_MK__ Index: head/stand/efi/Makefile =================================================================== --- head/stand/efi/Makefile (revision 330003) +++ head/stand/efi/Makefile (revision 330004) @@ -1,23 +1,25 @@ # $FreeBSD$ +NO_OBJ=t + .include # In-tree GCC does not support __attribute__((ms_abi)), but gcc newer # than 4.5 supports it. .if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" .if ${MK_FDT} != "no" SUBDIR+= fdt .endif .endif .if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "arm" SUBDIR+= libefi loader boot1 .endif .endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 .include Index: head/stand/forth/Makefile =================================================================== --- head/stand/forth/Makefile (revision 330003) +++ head/stand/forth/Makefile (revision 330004) @@ -1,47 +1,49 @@ # $FreeBSD$ +NO_OBJ=t + .include MAN+= beastie.4th.8 \ brand.4th.8 \ check-password.4th.8 \ color.4th.8 \ delay.4th.8 \ loader.conf.5 \ loader.4th.8 \ menu.4th.8 \ menusets.4th.8 \ version.4th.8 FILES+= beastie.4th FILES+= brand.4th FILES+= brand-fbsd.4th FILES+= check-password.4th FILES+= color.4th FILES+= delay.4th FILES+= frames.4th FILES+= loader.4th FILES+= logo-beastie.4th FILES+= logo-beastiebw.4th FILES+= logo-fbsdbw.4th FILES+= logo-orb.4th FILES+= logo-orbbw.4th FILES+= menu.4th FILES+= menu-commands.4th FILES+= menusets.4th FILES+= screen.4th FILES+= shortcuts.4th FILES+= support.4th FILES+= version.4th FILESDIR_loader.conf= /boot/defaults # Allow machine specific loader.rc to be installed. .for f in loader.rc menu.rc loader.conf .if exists(${BOOTSRC}/${MACHINE:C/amd64/i386/}/loader/${f}) FILES+= ${BOOTSRC}/${MACHINE:C/amd64/i386/}/loader/${f} .else FILES+= ${f} .endif .endfor .include Index: head/stand/i386/Makefile =================================================================== --- head/stand/i386/Makefile (revision 330003) +++ head/stand/i386/Makefile (revision 330004) @@ -1,25 +1,27 @@ # $FreeBSD$ +NO_OBJ=t + .include SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ libi386 .if ${MK_LOADER_FIREWIRE} == "yes" SUBDIR+= libfirewire .endif SUBDIR+= loader # special boot programs, 'self-extracting boot2+loader' SUBDIR+= pxeldr .if ${MACHINE_CPUARCH} == "i386" SUBDIR+= kgzldr .endif .if ${MK_ZFS} != "no" SUBDIR+= zfsboot gptzfsboot zfsloader .endif .include Index: head/stand/mips/Makefile =================================================================== --- head/stand/mips/Makefile (revision 330003) +++ head/stand/mips/Makefile (revision 330004) @@ -1,14 +1,16 @@ # $FreeBSD$ +NO_OBJ=t + SUBDIR= uboot # # The BERI boot loader port works only on 64-bit MIPS; not a hard port to # 32-bit if someone is interested. Build on all 64-bit MIPS platforms to # ensure it gets adequate build-test coverage. # .if ${MACHINE_ARCH} == "mips64" SUBDIR+= beri .endif .include Index: head/stand/powerpc/Makefile =================================================================== --- head/stand/powerpc/Makefile (revision 330003) +++ head/stand/powerpc/Makefile (revision 330004) @@ -1,10 +1,12 @@ # $FreeBSD$ +NO_OBJ=t + .include SUBDIR= boot1.chrp ofw uboot .if ${MK_FDT} == "yes" SUBDIR+= kboot .endif .include Index: head/stand/sparc64/Makefile =================================================================== --- head/stand/sparc64/Makefile (revision 330003) +++ head/stand/sparc64/Makefile (revision 330004) @@ -1,10 +1,12 @@ # $FreeBSD$ +NO_OBJ=t + .include SUBDIR= boot1 loader .if ${MK_ZFS} != "no" SUBDIR+=zfsboot zfsloader .endif .include