Index: stable/11/stand/Makefile.inc =================================================================== --- stable/11/stand/Makefile.inc (revision 329145) +++ stable/11/stand/Makefile.inc (revision 329146) @@ -1,37 +1,53 @@ # $FreeBSD$ .include "defs.mk" .if !defined(__BOOT_MAKEFILE_INC__) __BOOT_MAKEFILE_INC__=${MFILE} CFLAGS+=-I${SASRC} 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 +.elif ${MACHINE_CPUARCH} != "riscv" +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} == "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 .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 ${MK_LOADER_FORCE_LE} != "no" .if ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -mlittle-endian .endif .endif .endif Index: stable/11/stand/arm/uboot/Makefile =================================================================== --- stable/11/stand/arm/uboot/Makefile (revision 329145) +++ stable/11/stand/arm/uboot/Makefile (revision 329146) @@ -1,70 +1,68 @@ # $FreeBSD$ 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 .include FILES+= ubldr ubldr.bin NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b WARNS?= 1 # Address at which ubldr will be loaded. # This varies for different boards and SOCs. UBLDR_LOADADDR?= 0x1000000 # Architecture-specific loader code SRCS= start.S conf.c self_reloc.c vers.c .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -ffreestanding -msoft-float - LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} LDFLAGS+= -Wl,-znotext # Pull in common loader code .include "${BOOTSRC}/uboot.mk" CFLAGS+= -fPIC DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} ldscript.abs: echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} ldscript.pie: echo "UBLDR_LOADADDR = 0;" >${.TARGET} ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} ${CC} ${CFLAGS} -T ldscript.abs ${LDFLAGS} \ -o ${.TARGET} ${OBJS} ${LDADD} ubldr.pie: ${OBJS} ldscript.pie ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} ${CC} ${CFLAGS} -T ldscript.pie ${LDFLAGS} -pie -Wl,-Bsymbolic \ -o ${.TARGET} ${OBJS} ${LDADD} ubldr.bin: ubldr.pie ${OBJCOPY} -S -O binary ubldr.pie ${.TARGET} CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin .include Index: stable/11/stand/efi/Makefile.inc =================================================================== --- stable/11/stand/efi/Makefile.inc (revision 329145) +++ stable/11/stand/efi/Makefile.inc (revision 329146) @@ -1,32 +1,22 @@ # $FreeBSD$ -.if ${MACHINE_CPUARCH} == "i386" -CFLAGS+= -march=i386 -CFLAGS+= -mno-aes -.endif - # Options used when building app-specific efi components # See conf/kern.mk for the correct set of these -CFLAGS+= -ffreestanding -Wformat ${CFLAGS_NO_SIMD} +CFLAGS+= -Wformat LDFLAGS+= -nostdlib -.if ${MACHINE_CPUARCH} != "aarch64" -CFLAGS+= -msoft-float -.endif - .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -fshort-wchar CFLAGS+= -mno-red-zone -CFLAGS+= -mno-aes .endif .if ${MACHINE_CPUARCH} == "aarch64" CFLAGS+= -fshort-wchar CFLAGS+= -fPIC .endif .if ${MACHINE_CPUARCH} == "arm" CFLAGS+= -fPIC .endif .include "../Makefile.inc" Index: stable/11/stand/efi/fdt/Makefile =================================================================== --- stable/11/stand/efi/fdt/Makefile (revision 329145) +++ stable/11/stand/efi/fdt/Makefile (revision 329146) @@ -1,30 +1,23 @@ # $FreeBSD$ .include .PATH: ${LDRSRC} LIB= efi_fdt INTERNALLIB= WARNS?= 6 SRCS= efi_fdt.c -CFLAGS+= -ffreestanding -.if ${MACHINE_CPUARCH} == "aarch64" -CFLAGS+= -mgeneral-regs-only -.else -CFLAGS+= -msoft-float -.endif - # EFI library headers CFLAGS+= -I${EFISRC}/include CFLAGS+= -I${EFISRC}/include/${MACHINE} # libfdt headers CFLAGS+= -I${FDTSRC} # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} .include Index: stable/11/stand/fdt/Makefile =================================================================== --- stable/11/stand/fdt/Makefile (revision 329145) +++ stable/11/stand/fdt/Makefile (revision 329146) @@ -1,28 +1,22 @@ # $FreeBSD$ .include .PATH: ${SYSDIR}/contrib/libfdt/ LIB= fdt INTERNALLIB= # Vendor sources of libfdt. SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c \ fdt_empty_tree.c fdt_addresses.c fdt_overlay.c # Loader's fdt commands extension sources. SRCS+= fdt_loader_cmd.c CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC} -CFLAGS+= -ffreestanding - -.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" -CFLAGS+= -msoft-float -.endif - CFLAGS+= -Wformat -Wall .include .include Index: stable/11/stand/i386/Makefile.inc =================================================================== --- stable/11/stand/i386/Makefile.inc (revision 329145) +++ stable/11/stand/i386/Makefile.inc (revision 329146) @@ -1,36 +1,33 @@ # Common defines for all of /stand/i386/ # # $FreeBSD$ LOADER_ADDRESS?=0x200000 -CFLAGS+= -march=i386 -ffreestanding -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float LDFLAGS+= -nostdlib # BTX components BTXDIR= ${BOOTOBJ}/i386/btx BTXLDR= ${BTXDIR}/btxldr/btxldr BTXKERN= ${BTXDIR}/btx/btx BTXCRT= ${BTXDIR}/lib/crt0.o BTXSRC= ${BOOTSRC}/i386/btx BTXLIB= ${BTXSRC}/lib # compact binary with no padding between text, data, bss LDSCRIPT= ${BOOTSRC}/i386/boot.ldscript # LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary # LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary LD_FLAGS_BIN=-static -N --gc-sections .if ${MACHINE_CPUARCH} == "amd64" DO32=1 .endif .if defined(LOADER_FIREWIRE_SUPPORT) MK_LOADER_FIREWIRE=yes .warning "LOADER_FIREWIRE_SUPPORT deprecated, please move to WITH_LOADER_FIREWIRE" .endif .include "../Makefile.inc" Index: stable/11/stand/i386/gptzfsboot/Makefile =================================================================== --- stable/11/stand/i386/gptzfsboot/Makefile (revision 329145) +++ stable/11/stand/i386/gptzfsboot/Makefile (revision 329146) @@ -1,87 +1,87 @@ # $FreeBSD$ -HAVE_GPT= yes +HAVE_GELI= yes .include .PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \ ${BOOTSRC}/i386/zfsboot ${BOOTSRC}/i386/common \ ${SASRC} FILES= gptzfsboot MAN= gptzfsboot.8 NM?= nm BOOT_COMCONSOLE_PORT?= 0x3f8 BOOT_COMCONSOLE_SPEED?= 9600 B2SIOFMT?= 0x3 REL1= 0x700 ORG1= 0x7c00 ORG2= 0x0 CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \ -O1 \ -DGPT -DZFS -DBOOT2 \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${LDRSRC} \ -I${BOOTSRC}/i386/common \ -I${ZFSSRC} \ -I${SYSDIR}/cddl/boot/zfs \ -I${BOOTSRC}/i386/btx/lib \ -I${BOOTSRC}/i386/boot2 \ -Wall -Waggregate-return -Wbad-function-cast \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline -Wno-pointer-sign NO_WCAST_ALIGN= .if ${COMPILER_TYPE} == "clang" || \ (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201) CFLAGS+= -Wno-tentative-definition-incomplete-type .endif .if ${MACHINE} == "amd64" LIBZFSBOOT=${BOOTOBJ}/zfs32/libzfsboot.a .else LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a .endif CFLAGS.gcc+= --param max-inline-insns-single=100 LD_FLAGS+=${LD_FLAGS_BIN} CLEANFILES+= gptzfsboot gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \ -o ${.TARGET} gptzfsboot.bin CLEANFILES+= gptldr.bin gptldr.out gptldr.o gptldr.bin: gptldr.out ${OBJCOPY} -S -O binary gptldr.out ${.TARGET} gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \ - drv.o gpt.o util.o ${OPENCRYPTO_XTS} + drv.o gpt.o ${OPENCRYPTO_XTS} gptzfsboot.bin: gptzfsboot.out ${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET} -gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o \ +gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o \ ${OPENCRYPTO_XTS} ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBZFSBOOT} ${LIBSA32} zfsboot.o: ${ZFSSRC}/zfsimpl.c .include # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.gptldr.S= ${CLANG_NO_IAS} Index: stable/11/stand/i386/libi386/Makefile =================================================================== --- stable/11/stand/i386/libi386/Makefile (revision 329145) +++ stable/11/stand/i386/libi386/Makefile (revision 329146) @@ -1,61 +1,60 @@ # $FreeBSD$ -HAVE_GPT= yes HAVE_GELI= yes .include LIB= i386 INTERNALLIB= SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp.c \ biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \ comconsole.c devicename.c elf32_freebsd.c \ elf64_freebsd.c multiboot.c multiboot_tramp.S relocater_tramp.S \ i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c .PATH: ${ZFSSRC} SRCS+= devicename_stubs.c BOOT_COMCONSOLE_PORT?= 0x3f8 CFLAGS+= -DCOMPORT=${BOOT_COMCONSOLE_PORT} BOOT_COMCONSOLE_SPEED?= 9600 CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} .ifdef(BOOT_BIOSDISK_DEBUG) # Make the disk code more talkative CFLAGS+= -DDISK_DEBUG .endif .if !defined(BOOT_HIDE_SERIAL_NUMBERS) # Export serial numbers, UUID, and asset tag from loader. CFLAGS+= -DSMBIOS_SERIAL_NUMBERS .if defined(BOOT_LITTLE_ENDIAN_UUID) # Use little-endian UUID format as defined in SMBIOS 2.6. CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID .elif defined(BOOT_NETWORK_ENDIAN_UUID) # Use network-endian UUID format for backward compatibility. CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID .endif .endif # Include simple terminal emulation (cons25-compatible) CFLAGS+= -DTERM_EMU # XXX: make alloca() useable CFLAGS+= -Dalloca=__builtin_alloca CFLAGS+= -I${BOOTSRC}/ficl -I${BOOTSRC}/ficl/i386 \ -I${LDRSRC} -I${BOOTSRC}/i386/common \ -I${BTXLIB} \ -I${SYSDIR}/contrib/dev/acpica/include # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} .include # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.amd64_tramp.S= ${CLANG_NO_IAS} CFLAGS.multiboot_tramp.S= ${CLANG_NO_IAS} Index: stable/11/stand/mips/beri/Makefile.inc =================================================================== --- stable/11/stand/mips/beri/Makefile.inc (revision 329145) +++ stable/11/stand/mips/beri/Makefile.inc (revision 329146) @@ -1,6 +1,5 @@ # $FreeBSD$ -CFLAGS+= -ffreestanding LDFLAGS+= -nostdlib .include "../Makefile.inc" Index: stable/11/stand/mips/beri/boot2/Makefile =================================================================== --- stable/11/stand/mips/beri/boot2/Makefile (revision 329145) +++ stable/11/stand/mips/beri/boot2/Makefile (revision 329146) @@ -1,86 +1,84 @@ #- # Copyright (c) 2013-2014 Robert N. M. Watson # All rights reserved. # # This software was developed by SRI International and the University of # Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) # ("CTSRD"), as part of the DARPA CRASH research programme. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ .include INSTALLFLAGS= -b LOADERS= flashboot jtagboot FILES= ${LOADERS} ${LOADERS:S/$/.md5/} SRCS= relocate.S \ start.S \ boot2.c \ altera_jtag_uart.c \ cfi.c \ sdcard.c MAN= AFLAGS= -G0 -CFLAGS= -ffreestanding \ - -I${.CURDIR} \ +CFLAGS+= -I${.CURDIR} \ -I${SASRC} \ -I${LDRSRC} \ -D_KERNEL \ -Wall \ -G0 \ -fno-pic -mno-abicalls \ - -msoft-float \ -g LDFLAGS= -nostdlib \ -static \ -Wl,-N \ -G0 \ -L${.CURDIR} .PATH: ${BOOTSRC}/mips/beri/common CFLAGS+= -I${BOOTSRC}/mips/beri/common flashboot.elf: relocate.o start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o ${CC} ${LDFLAGS} -T ${.CURDIR}/flashboot.ldscript -o ${.TARGET} \ ${.ALLSRC} ${LIBSA} flashboot: flashboot.elf ${OBJCOPY} -S -O binary ${.TARGET}.elf ${.TARGET} flashboot.md5: flashboot md5 flashboot > flashboot.md5 jtagboot: start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o ${CC} ${LDFLAGS} -T ${.CURDIR}/jtagboot.ldscript -o ${.TARGET} \ ${.ALLSRC} ${LIBSA} jtagboot.md5: jtagboot md5 jtagboot > jtagboot.md5 CLEANFILES+= flashboot.elf .include Index: stable/11/stand/mips/beri/loader/Makefile =================================================================== --- stable/11/stand/mips/beri/loader/Makefile (revision 329145) +++ stable/11/stand/mips/beri/loader/Makefile (revision 329146) @@ -1,111 +1,110 @@ #- # Copyright (c) 2013-2014 Robert N. M. Watson # All rights reserved. # # This software was developed by SRI International and the University of # Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) # ("CTSRD"), as part of the DARPA CRASH research programme. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ LOADER_MSDOS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= yes .include MK_SSP= no MAN= PROG?= loader NEWVERSWHAT= "BERI loader" ${MACHINE_CPUARCH} INSTALLFLAGS= -b # Architecture-specific loader code SRCS= start.S \ main.c \ devicename.c \ exec.c \ metadata.c \ vers.c \ arch.c # libstand front-ends for shared driver code SRCS+= beri_console.c \ beri_disk_cfi.c \ beri_disk_sdcard.c # Common code with boot2 SRCS+= altera_jtag_uart.c \ cfi.c \ sdcard.c # Since we don't have a backward compatibility issue, default to this on BERI. CFLAGS+= -DBOOT_PROMPT_123 HELP_FILES+= help.mips # Always add MI sources .include "${BOOTSRC}/loader.mk" # BERI files common to boot2 and loader .PATH: ${BOOTSRC}/mips/beri/common CFLAGS+= -I${BOOTSRC}/mips/beri/common # Loader-specific MD headers CFLAGS+= -I${.CURDIR} # Generate code appropriate for the loader environment CFLAGS+= -G0 \ -fno-pic \ -mno-abicalls \ - -msoft-float \ -g LDFLAGS= -nostdlib \ -static \ -T ${.CURDIR}/loader.ldscript \ -L${.CURDIR} \ -e __start DPADD= ${LIBFICL} ${LIBSA} LDADD= ${LIBFICL} ${LIBSA} .if defined(LOADER_USB_SUPPORT) # Do garbage collection CFLAGS+= -ffunction-sections -fdata-sections CFLAGS+= -Wl,--gc-sections # Link USB BOOT library LDADD+= ${BOOTOBJ}/usb/libusbboot.a CFLAGS+= -I${BOOTSRC}/usb # Define USB SUPPORT CFLAGS+= -DLOADER_USB_SUPPORT .endif all: loader .include Index: stable/11/stand/mips/uboot/Makefile =================================================================== --- stable/11/stand/mips/uboot/Makefile (revision 329145) +++ stable/11/stand/mips/uboot/Makefile (revision 329146) @@ -1,57 +1,57 @@ # $FreeBSD$ LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no LOADER_MSDOS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no .include FILES+= ubldr NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b WARNS?= 1 # Address at which ubldr will be loaded. # This varies for different boards and SOCs. UBLDR_LOADADDR?= 0xffffffff80800000 # Architecture-specific loader code SRCS= start.S conf.c vers.c HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -ffreestanding -msoft-float -g +CFLAGS+= -g LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} .include "${BOOTSRC}/uboot.mk" DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} ldscript.abs: echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} ldscript.pie: echo "UBLDR_LOADADDR = 0;" >${.TARGET} ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} ${CC} ${CFLAGS} -T ldscript.abs ${LDFLAGS} \ -o ${.TARGET} ${OBJS} ${LDADD} ${OBJCOPY} -S -O binary ubldr ubldr.bin CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin .include .include Index: stable/11/stand/ofw/libofw/Makefile =================================================================== --- stable/11/stand/ofw/libofw/Makefile (revision 329145) +++ stable/11/stand/ofw/libofw/Makefile (revision 329146) @@ -1,28 +1,26 @@ # $FreeBSD$ .include LIB= ofw INTERNALLIB= SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_copy.c ofw_disk.c \ ofw_memory.c ofw_module.c ofw_net.c ofw_reboot.c \ ofw_time.c openfirm.c .PATH: ${ZFSSRC} SRCS+= devicename_stubs.c # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} -CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "powerpc" -CFLAGS+= -msoft-float SRCS+= ppc64_elf_freebsd.c .endif .ifdef(BOOT_DISK_DEBUG) # Make the disk code more talkative CFLAGS+= -DDISK_DEBUG .endif .include Index: stable/11/stand/powerpc/boot1.chrp/Makefile =================================================================== --- stable/11/stand/powerpc/boot1.chrp/Makefile (revision 329145) +++ stable/11/stand/powerpc/boot1.chrp/Makefile (revision 329146) @@ -1,42 +1,40 @@ # $FreeBSD$ .include SSP_CFLAGS= PROG= boot1.elf NEWVERSWHAT= "Open Firmware boot block" ${MACHINE_ARCH} INSTALLFLAGS= -b FILES= boot1.hfs SRCS= boot1.c ashldi3.c syncicache.c MAN= -CFLAGS= -ffreestanding -msoft-float \ - -I${LDRSRC} -I${SYSDIR} -I${SASRC} \ - -D_STANDALONE +CFLAGS= -I${LDRSRC} -I${SYSDIR} -I${SASRC} -D_STANDALONE LDFLAGS=-nostdlib -static -Wl,-N .PATH: ${SYSDIR}/libkern ${SRCTOP}/lib/libc/powerpc/gen ${.CURDIR} # The following inserts out objects into a template HFS # created by generate-hfs.sh .include "${.CURDIR}/Makefile.hfs" boot1.hfs: boot1.elf bootinfo.txt echo ${.OBJDIR} uudecode ${.CURDIR}/hfs.tmpl.bz2.uu mv hfs.tmpl.bz2 ${.TARGET}.bz2 bzip2 -f -d ${.TARGET}.bz2 ${DD} if=boot1.elf of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc ${DD} if=${.CURDIR}/bootinfo.txt of=${.TARGET} seek=${BOOTINFO_OFFSET} \ conv=notrunc CLEANFILES+= boot1.hfs boot1.o: ${SASRC}/ufsread.c .include Index: stable/11/stand/powerpc/kboot/Makefile =================================================================== --- stable/11/stand/powerpc/kboot/Makefile (revision 329145) +++ stable/11/stand/powerpc/kboot/Makefile (revision 329146) @@ -1,50 +1,50 @@ # $FreeBSD$ LOADER_CD9660_SUPPORT?= yes LOADER_MSDOS_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= yes 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 MK_SSP= no MAN= PROG= loader.kboot NEWVERSWHAT= "kboot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code SRCS= conf.c metadata.c vers.c main.c ppc64_elf_freebsd.c SRCS+= host_syscall.S hostcons.c hostdisk.c kerneltramp.S kbootfdt.c SRCS+= ucmpdi2.c .include "${BOOTSRC}/fdt.mk" CFLAGS+= -mcpu=powerpc64 # Always add MI sources HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM +CFLAGS+= -Wall -DAIM # load address. set in linker script RELOC?= 0x0 CFLAGS+= -DRELOC=${RELOC} LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc # 64-bit bridge extensions CFLAGS+= -Wa,-mppc64bridge DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} HELP_FILES+= ${FDTSRC}/help.fdt .include Index: stable/11/stand/powerpc/ofw/Makefile =================================================================== --- stable/11/stand/powerpc/ofw/Makefile (revision 329145) +++ stable/11/stand/powerpc/ofw/Makefile (revision 329146) @@ -1,55 +1,54 @@ # $FreeBSD$ 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 MK_SSP= no MAN= PROG= loader NEWVERSWHAT= "Open Firmware loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code SRCS= conf.c metadata.c vers.c start.c SRCS+= ucmpdi2.c .include "${BOOTSRC}/fdt.mk" .if ${MK_FDT} == "yes" SRCS+= ofwfdt.c .endif HELP_FILES+= ${FDTSRC}/help.fdt # Always add MI sources .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -ffreestanding -msoft-float # load address. set in linker script RELOC?= 0x1C00000 CFLAGS+= -DRELOC=${RELOC} LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc # Pull in common loader code .PATH: ${BOOTSRC}/ofw/common .include "${BOOTSRC}/ofw/common/Makefile.inc" # Open Firmware standalone support library LIBOFW= ${BOOTOBJ}/ofw/libofw/libofw.a CFLAGS+= -I${BOOTSRC}/ofw/libofw DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} .include Index: stable/11/stand/powerpc/ps3/Makefile =================================================================== --- stable/11/stand/powerpc/ps3/Makefile (revision 329145) +++ stable/11/stand/powerpc/ps3/Makefile (revision 329146) @@ -1,48 +1,48 @@ # $FreeBSD$ LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes LOADER_EXT2FS_SUPPORT?= yes LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= no .include MK_SSP= no MAN= PROG= loader.ps3 NEWVERSWHAT= "Playstation 3 loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code SRCS= start.S conf.c metadata.c vers.c main.c devicename.c ppc64_elf_freebsd.c SRCS+= lv1call.S ps3cons.c font.h ps3mmu.c ps3net.c ps3repo.c \ ps3stor.c ps3disk.c ps3cdrom.c SRCS+= ucmpdi2.c CFLAGS+= -mcpu=powerpc64 # Always add MI sources HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM +CFLAGS+= -Wall -DAIM # load address. set in linker script RELOC?= 0x0 CFLAGS+= -DRELOC=${RELOC} LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc DPADD= ${LIBFICL} ${LIBOFW} ${LIBSA} LDADD= ${LIBFICL} ${LIBOFW} ${LIBSA} SC_DFLT_FONT=cp437 font.h: uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h .include Index: stable/11/stand/powerpc/uboot/Makefile =================================================================== --- stable/11/stand/powerpc/uboot/Makefile (revision 329145) +++ stable/11/stand/powerpc/uboot/Makefile (revision 329146) @@ -1,37 +1,35 @@ # $FreeBSD$ LOADER_UFS_SUPPORT?= yes LOADER_CD9660_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 .include PROG= ubldr NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b MAN= # Architecture-specific loader code SRCS= start.S conf.c vers.c SRCS+= ucmpdi2.c # Always add MI sources HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -ffreestanding - LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc .include "${BOOTSRC}/uboot.mk" DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} .include Index: stable/11/stand/sparc64/Makefile.inc =================================================================== --- stable/11/stand/sparc64/Makefile.inc (revision 329145) +++ stable/11/stand/sparc64/Makefile.inc (revision 329146) @@ -1,6 +1,5 @@ # $FreeBSD$ -CFLAGS+= -ffreestanding LDFLAGS+= -nostdlib .include "../Makefile.inc" Index: stable/11/stand/uboot/fdt/Makefile =================================================================== --- stable/11/stand/uboot/fdt/Makefile (revision 329145) +++ stable/11/stand/uboot/fdt/Makefile (revision 329146) @@ -1,25 +1,23 @@ # $FreeBSD$ .include .PATH: ${LDRSRC} LIB= uboot_fdt INTERNALLIB= WARNS?= 2 SRCS= uboot_fdt.c -CFLAGS+= -ffreestanding -msoft-float - # U-Boot library headers CFLAGS+= -I${UBOOTSRC}/lib # libfdt headers CFLAGS+= -I${FDTSRC} # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} .include .include Index: stable/11/stand/uboot/lib/Makefile =================================================================== --- stable/11/stand/uboot/lib/Makefile (revision 329145) +++ stable/11/stand/uboot/lib/Makefile (revision 329146) @@ -1,31 +1,29 @@ # $FreeBSD$ .include .PATH: ${LDRSRC} LIB= uboot INTERNALLIB= WARNS?= 2 SRCS= console.c copy.c devicename.c elf_freebsd.c glue.c SRCS+= module.c net.c reboot.c time.c -CFLAGS+= -ffreestanding -msoft-float - .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" SRCS+= disk.c .endif .include "${BOOTSRC}/fdt.mk" # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} .ifdef(BOOT_DISK_DEBUG) # Make the disk code more talkative CFLAGS+= -DDISK_DEBUG .endif .include .include Index: stable/11/stand/usb/Makefile =================================================================== --- stable/11/stand/usb/Makefile (revision 329145) +++ stable/11/stand/usb/Makefile (revision 329146) @@ -1,58 +1,53 @@ # # $FreeBSD$ # # Copyright (c) 2013 Hans Petter Selasky. # Copyright (c) 2014 SRI International # All rights reserved. # # This software was developed by SRI International and the University of # Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 # ("CTSRD"), as part of the DARPA CRASH research programme. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # LIB= usbboot INTERNALLIB= CFLAGS+= -DBOOTPROG=\"usbloader\" CFLAGS+= -ffunction-sections -fdata-sections -CFLAGS+= -ffreestanding CFLAGS+= -Wformat -Wall CFLAGS+= -g CFLAGS+= -fno-pic -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -march=i386 -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -.endif .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 .endif .if ${MACHINE_CPUARCH} == "mips" CFLAGS+= -mno-abicalls .endif .include "usbcore.mk" .include "../kshim/kshim.mk" .include Index: stable/11/stand/usb/Makefile.test =================================================================== --- stable/11/stand/usb/Makefile.test (revision 329145) +++ stable/11/stand/usb/Makefile.test (revision 329146) @@ -1,61 +1,57 @@ # # $FreeBSD$ # # Copyright (c) 2013 Hans Petter Selasky. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # # USB test application # .PATH: ${.CURDIR} PROG= usbloader MAN= SRCS= CFLAGS+= -Wall CFLAGS+= -g -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -march=i386 -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -.endif .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 .endif LDFLAGS+= -Wl,--gc-sections SRCS+= bsd_usbloader_test.c LDADD+= libusbboot.a DPADD+= libusbboot.a .include ${PROG}: libusbboot.a libusbboot.a: make -f Makefile Index: stable/11/stand/userboot/userboot/Makefile =================================================================== --- stable/11/stand/userboot/userboot/Makefile (revision 329145) +++ stable/11/stand/userboot/userboot/Makefile (revision 329146) @@ -1,59 +1,58 @@ # $FreeBSD$ MAN= LOADER_MSDOS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no .include MK_SSP= no SHLIB_NAME= userboot.so MK_CTF= no STRIP= LIBDIR= /boot SRCS= autoload.c SRCS+= bcache.c SRCS+= biossmap.c SRCS+= bootinfo.c SRCS+= bootinfo32.c SRCS+= bootinfo64.c SRCS+= conf.c SRCS+= console.c SRCS+= copy.c SRCS+= devicename.c SRCS+= elf32_freebsd.c SRCS+= elf64_freebsd.c SRCS+= host.c SRCS+= main.c SRCS+= userboot_cons.c SRCS+= userboot_disk.c SRCS+= vers.c CFLAGS+= -Wall CFLAGS+= -I${BOOTSRC}/userboot -CFLAGS+= -ffreestanding CWARNFLAGS.main.c += -Wno-implicit-function-declaration LDFLAGS+= -nostdlib -Wl,-Bsymbolic NEWVERSWHAT= "User boot" ${MACHINE_CPUARCH} .if ${MK_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a .endif # Always add MI sources HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" CFLAGS+= -I. DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSA} LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSA} .include Index: stable/11 =================================================================== --- stable/11 (revision 329145) +++ stable/11 (revision 329146) Property changes on: stable/11 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r326038,326069,326072