Move ZFS files into libsa

Move the libzfs stuff into libsa. There's no need for it to be a
separate library. The separate library adds to the issues of build
ordering that we see from time to time. Move the filesystem support
into libsa, like all the other filesystem support rather than making
zfs the odd-duck out.

Discussed with: allanjude@
This commit is contained in:
Warner Losh 2018-07-08 07:42:49 +00:00
parent 9d6c74a0d9
commit b8902de147
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336084
21 changed files with 21 additions and 75 deletions

View file

@ -6,7 +6,7 @@
# others we don't. LIB32LIST is a list of libraries, which if
# included, need to be built 32-bit as well.
.if ${MACHINE_ARCH} == "amd64"
LIB32LIST=libsa ficl liblua zfs
LIB32LIST=libsa ficl liblua
.endif
S.yes+= libsa
@ -17,7 +17,6 @@ S.${MK_LOADER_LUA}+= liblua
S.${MK_LOADER_LUA}+= lua
S.${MK_FDT}+= fdt
S.${MK_LOADER_OFW}+= ofw
S.${MK_ZFS}+= zfs
S.yes+= defaults
S.yes+= man

View file

@ -28,7 +28,7 @@ LUASRC= ${SRCTOP}/contrib/lua/src
SASRC= ${BOOTSRC}/libsa
SYSDIR= ${SRCTOP}/sys
UBOOTSRC= ${BOOTSRC}/uboot
ZFSSRC= ${BOOTSRC}/zfs
ZFSSRC= ${SASRC}/zfs
BOOTOBJ= ${OBJTOP}/stand

View file

@ -30,7 +30,6 @@ CFLAGS.zfs_module.c+= -I${ZFSSRC}
CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/boot/zfs
CFLAGS.zfs_module.c+= -I${SYSDIR}/crypto/skein
CFLAGS+= -DEFI_ZFS_BOOT
LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a
.endif
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201
@ -72,8 +71,8 @@ LIBEFI= ${BOOTOBJ}/efi/libefi/libefi.a
# __aeabi_* (arm) or __divdi3 (i386).
# as well as required string and memory functions for all platforms.
#
DPADD+= ${LIBEFI} ${LIBZFSBOOT} ${LIBSA}
LDADD+= ${LIBEFI} ${LIBZFSBOOT} ${LIBSA}
DPADD+= ${LIBEFI} ${LIBSA}
LDADD+= ${LIBEFI} ${LIBSA}
DPADD+= ${LDSCRIPT}

View file

@ -25,7 +25,6 @@ SRCS= autoload.c \
vers.c
.if ${MK_ZFS} != "no"
LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a
CFLAGS+= -I${ZFSSRC}
CFLAGS+= -DEFI_ZFS_BOOT
HAVE_ZFS= yes
@ -120,8 +119,7 @@ loader.efi: ${PROG}
LIBEFI= ${BOOTOBJ}/efi/libefi/libefi.a
DPADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBZFSBOOT} ${LIBSA} \
${LDSCRIPT}
LDADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBZFSBOOT} ${LIBSA}
DPADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} ${LDSCRIPT}
LDADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA}
.include <bsd.prog.mk>

View file

@ -43,12 +43,6 @@ CFLAGS.clang+= -Wno-tentative-definition-incomplete-type
NO_WCAST_ALIGN=
.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}
@ -75,7 +69,7 @@ gptzfsboot.bin: gptzfsboot.out
gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o \
${OPENCRYPTO_XTS}
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBSA32}
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32}
zfsboot.o: ${ZFSSRC}/zfsimpl.c

View file

@ -71,8 +71,8 @@ FILESMODE_${LOADER}= ${BINMODE} -b
# XXX crt0.o needs to be first for pxeboot(8) to work
OBJS= ${BTXCRT}
DPADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBSA32}
LDADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBSA32}
DPADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBI386} ${LIBSA32}
LDADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBI386} ${LIBSA32}
.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -DLOADER_PREFER_AMD64

View file

@ -37,11 +37,6 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \
-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings
CFLAGS.gcc+= --param max-inline-insns-single=100
.if ${MACHINE} == "amd64"
LIBZFSBOOT=${BOOTOBJ}/zfs32/libzfsboot.a
.else
LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a
.endif
LD_FLAGS+=${LD_FLAGS_BIN}
@ -82,7 +77,7 @@ zfsboot.bin: zfsboot.out
${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBSA32}
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32}
SRCS= zfsboot.c

View file

@ -3,5 +3,6 @@
LOADER= zfsloader
NEWVERSWHAT= "ZFS enabled bootstrap loader" x86
HAVE_ZFS= yes
CFLAGS+= -DBOOTPROG=\"zfsloader\"
.include "${.CURDIR}/../loader/Makefile"

View file

@ -155,4 +155,9 @@ SRCS+= explicit_bzero.c
.include "${SASRC}/geli/Makefile.inc"
.endif
# Maybe ZFS
.if ${MK_ZFS} == "yes"
.include "${SASRC}/zfs/Makefile.inc"
.endif
.include <bsd.lib.mk>

View file

@ -1,20 +1,13 @@
# $FreeBSD$
.include <bsd.init.mk>
LIB= zfsboot
.PATH: ${ZFSSRC}
SRCS+= zfs.c skein.c skein_block.c
# Do not unroll skein loops, reduce code size
CFLAGS+= -DSKEIN_LOOP=111
.PATH: ${SYSDIR}/crypto/skein
CFLAGS+= -DBOOTPROG=\"zfsloader\"
CFLAGS+= -I${LDRSRC}
CFLAGS+= -I${SYSDIR}/cddl/boot/zfs
CFLAGS+= -I${SYSDIR}/crypto/skein
CFLAGS+= -Wformat -Wall
.include <bsd.lib.mk>

View file

@ -129,13 +129,6 @@ CFLAGS+= -DLOADER_ZFS_SUPPORT
CFLAGS+= -I${ZFSSRC}
CFLAGS+= -I${SYSDIR}/cddl/boot/zfs
SRCS+= zfs_cmd.c
.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1
# Have to override to use 32-bit version of zfs library...
# kinda lame to select that there XXX
LIBZFSBOOT= ${BOOTOBJ}/zfs32/libzfsboot.a
.else
LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a
.endif
.endif
LIBFICL= ${BOOTOBJ}/ficl/libficl.a

View file

@ -44,7 +44,7 @@ LDFLAGS+= -static
LIBOFW= ${BOOTOBJ}/ofw/libofw/libofw.a
CFLAGS+= -I${BOOTSRC}/ofw/libofw/
DPADD= ${LDR_INTERP} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA}
LDADD= ${LDR_INTERP} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA}
DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBSA}
LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBSA}
.include <bsd.prog.mk>

View file

@ -3,5 +3,6 @@
PROG= zfsloader
NEWVERSWHAT= "ZFS enabled bootstrap loader" sparc64
HAVE_ZFS= yes
CFLAGS+= -DBOOTPROG=\"zfsloader\"
.include "${.CURDIR}/../loader/Makefile"

View file

@ -41,14 +41,13 @@ NEWVERSWHAT= "User boot" ${MACHINE_CPUARCH}
.if ${MK_ZFS} != "no"
CFLAGS+= -DUSERBOOT_ZFS_SUPPORT
LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a
HAVE_ZFS=yes
.endif
# Always add MI sources
.include "${BOOTSRC}/loader.mk"
CFLAGS+= -I.
DPADD+= ${LDR_INTERP} ${LIBZFSBOOT} ${LIBSA}
LDADD+= ${LDR_INTERP} ${LIBZFSBOOT} ${LIBSA}
DPADD+= ${LDR_INTERP} ${LIBSA}
LDADD+= ${LDR_INTERP} ${LIBSA}
.include <bsd.lib.mk>

View file

@ -1,13 +0,0 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
include \
include/xlocale \
.include <dirdeps.mk>
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
.endif

View file

@ -1,5 +0,0 @@
# $FreeBSD$
DO32=1
.include "${.CURDIR}/../zfs/Makefile"

View file

@ -1,13 +0,0 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
include \
include/xlocale \
.include <dirdeps.mk>
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
.endif