diff --git a/stand/kboot/kboot/Makefile b/stand/kboot/kboot/Makefile index b571c3acada1..c6cb47fbbba2 100644 --- a/stand/kboot/kboot/Makefile +++ b/stand/kboot/kboot/Makefile @@ -1,70 +1,73 @@ 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 \ hostcons.c \ hostdisk.c \ hostfs.c \ init.c \ kbootfdt.c \ main.c \ seg.c \ util.c \ vers.c .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" +# Bring in our ldscript +LDFLAGS= -nostdlib -static -T ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}.ldscript + # Always add MI sources .include "${BOOTSRC}/loader.mk" CFLAGS+= -I${.CURDIR} -I${.CURDIR}/arch/${MACHINE_ARCH} CFLAGS+= -Wall DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA} ${LIBKBOOT} LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA} ${LIBKBOOT} # Add our own lua bindings until they are universal .if ${LOADER_INTERP} == "lua" SRCS+= \ lua_bindings.c CFLAGS.lua_bindings.c+= -I${FLUALIB}/libhash .endif .include diff --git a/stand/kboot/kboot/arch/aarch64/Makefile.inc b/stand/kboot/kboot/arch/aarch64/Makefile.inc index 744a15f363d3..3e856f5322b3 100644 --- a/stand/kboot/kboot/arch/aarch64/Makefile.inc +++ b/stand/kboot/kboot/arch/aarch64/Makefile.inc @@ -1,12 +1,10 @@ SRCS+= tramp.S exec.c load_addr.c fdt_arch.c .PATH: ${BOOTSRC}/arm64/libarm64 CFLAGS+=-I${BOOTSRC}/arm64/libarm64 SRCS+= cache.c CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include # load address. set in linker script RELOC?= 0x0 CFLAGS+= -DRELOC=${RELOC} - -LDFLAGS= -nostdlib -static -T ${.CURDIR}/arch/${MACHINE_ARCH}/ldscript.${MACHINE_ARCH} diff --git a/stand/kboot/kboot/arch/aarch64/ldscript.aarch64 b/stand/kboot/kboot/arch/aarch64/aarch64.ldscript similarity index 100% rename from stand/kboot/kboot/arch/aarch64/ldscript.aarch64 rename to stand/kboot/kboot/arch/aarch64/aarch64.ldscript diff --git a/stand/kboot/kboot/arch/amd64/Makefile.inc b/stand/kboot/kboot/arch/amd64/Makefile.inc index 55b1819ccdee..edb8a1de0bba 100644 --- a/stand/kboot/kboot/arch/amd64/Makefile.inc +++ b/stand/kboot/kboot/arch/amd64/Makefile.inc @@ -1,5 +1,3 @@ SRCS+= amd64_tramp.S elf64_freebsd.c load_addr.c fdt_arch.c CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include - -LDFLAGS= -nostdlib -static -T ${.CURDIR}/arch/${MACHINE_ARCH}/ldscript.amd64 diff --git a/stand/kboot/kboot/arch/amd64/ldscript.amd64 b/stand/kboot/kboot/arch/amd64/amd64.ldscript similarity index 100% rename from stand/kboot/kboot/arch/amd64/ldscript.amd64 rename to stand/kboot/kboot/arch/amd64/amd64.ldscript diff --git a/stand/kboot/kboot/arch/powerpc64/Makefile.inc b/stand/kboot/kboot/arch/powerpc64/Makefile.inc index 338d1222ab65..11a67a93d9e0 100644 --- a/stand/kboot/kboot/arch/powerpc64/Makefile.inc +++ b/stand/kboot/kboot/arch/powerpc64/Makefile.inc @@ -1,7 +1,5 @@ CFLAGS+= -mcpu=powerpc64 SRCS+= ppc64_elf_freebsd.c kerneltramp.S load_addr.c fdt_arch.c -LDFLAGS= -nostdlib -static -T ${.CURDIR}/arch/${MACHINE_ARCH}/ldscript.powerpc - MK_PIE= no diff --git a/stand/kboot/kboot/arch/powerpc64/ldscript.powerpc b/stand/kboot/kboot/arch/powerpc64/powerpc64.ldscript similarity index 100% rename from stand/kboot/kboot/arch/powerpc64/ldscript.powerpc rename to stand/kboot/kboot/arch/powerpc64/powerpc64.ldscript