Skip to content

Commit

Permalink
Move ZFS files into libsa
Browse files Browse the repository at this point in the history
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@
  • Loading branch information
bsdimp committed Jul 8, 2018
1 parent 9d6c74a commit b8902de
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 75 deletions.
3 changes: 1 addition & 2 deletions stand/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion stand/defs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 2 additions & 3 deletions stand/efi/boot1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}

Expand Down
6 changes: 2 additions & 4 deletions stand/efi/loader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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>
8 changes: 1 addition & 7 deletions stand/i386/gptzfsboot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions stand/i386/loader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 1 addition & 6 deletions stand/i386/zfsboot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions stand/i386/zfsloader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
LOADER= zfsloader
NEWVERSWHAT= "ZFS enabled bootstrap loader" x86
HAVE_ZFS= yes
CFLAGS+= -DBOOTPROG=\"zfsloader\"

.include "${.CURDIR}/../loader/Makefile"
5 changes: 5 additions & 0 deletions stand/libsa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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>
7 changes: 0 additions & 7 deletions stand/zfs/Makefile → stand/libsa/zfs/Makefile.inc
Original file line number Diff line number Diff line change
@@ -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>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 0 additions & 7 deletions stand/loader.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions stand/sparc64/loader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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>
1 change: 1 addition & 0 deletions stand/sparc64/zfsloader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
PROG= zfsloader
NEWVERSWHAT= "ZFS enabled bootstrap loader" sparc64
HAVE_ZFS= yes
CFLAGS+= -DBOOTPROG=\"zfsloader\"

.include "${.CURDIR}/../loader/Makefile"
5 changes: 2 additions & 3 deletions stand/userboot/userboot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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>
13 changes: 0 additions & 13 deletions stand/zfs/Makefile.depend

This file was deleted.

5 changes: 0 additions & 5 deletions stand/zfs32/Makefile

This file was deleted.

13 changes: 0 additions & 13 deletions stand/zfs32/Makefile.depend

This file was deleted.

0 comments on commit b8902de

Please sign in to comment.