Changeset View
Standalone View
stand/libsa/zfs/Makefile.inc
Context not available. | |||||
.PATH: ${ZFSSRC} | .PATH: ${ZFSSRC} | ||||
SRCS+= zfs.c nvlist.c skein.c skein_block.c list.c | SRCS+= zfs.c nvlist.c skein.c skein_block.c list.c | ||||
.PATH: ${SYSDIR}/crypto/skein | .PATH: ${SYSDIR}/crypto/skein | ||||
.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/os | .PATH: ${SYSDIR}/contrib/openzfs/module/os/freebsd/spl | ||||
.PATH: ${SYSDIR}/contrib/openzfs/module/zstd/lib | |||||
SRCS+= zstd.c zstd_shim.c | |||||
CFLAGS+= -I${LDRSRC} | CFLAGS+= -I${LDRSRC} | ||||
CFLAGS+= -I${SYSDIR}/cddl/boot/zfs | CFLAGS+= -I${SYSDIR}/cddl/boot/zfs | ||||
CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/common | |||||
CFLAGS+= -I${SYSDIR}/crypto/skein | CFLAGS+= -I${SYSDIR}/crypto/skein | ||||
ZFS_CFLAGS= -D_KERNEL -D__KERNEL__ -DIN_BASE -D_SYS_VMEM_H_ \ | |||||
-DZFS_CONTEXT_OS_H_ -DKLD_MODULE \ | |||||
-I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/ \ | |||||
imp: _KERNEL, __KERNEL and __KERNEL__? Does OpenZFS base use all of those for real? | |||||
Done Inline Actions
mmacy@anarchy [~/devel/ZoF|11:17|12] find . -name "*.[ch]" | xargs grep _KERNEL | grep -v __KERNEL | wc 535 1584 29073 mmacy@anarchy [~/devel/ZoF|11:17|13] find . -name "*.[ch]" | xargs grep KERNEL | wc 3 9 203 It looks like I can live without the _KERNEL mmacy: > _KERNEL, __KERNEL and __KERNEL__? Does OpenZFS base use all of those for real?
mmacy@anarchy… | |||||
Not Done Inline ActionsI should have communicated that no use of -DKERNEL is permitted in the boot loader. You're not allowed to compile with that defined at all. You need to condition things on -D_STANDALONE. It's a third environment to compile in. There are big issues defining KERNEL elsewhere in the boot loader (which is why the practice was banned and all other issues corrected). The number of places needing ifdef _STANDALONE is small here. imp: I should have communicated that no use of -DKERNEL is permitted in the boot loader. You're not… | |||||
-I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl \ | |||||
Not Done Inline ActionsKLD_MODULE? Why? imp: KLD_MODULE? Why? | |||||
Done Inline Actions
To avoid the need for offset.inc when including systm.h mmacy: > KLD_MODULE? Why?
To avoid the need for offset.inc when including systm.h | |||||
Not Done Inline ActionsOK. It too should be under -D_STANDALONE. Although it turns out not to be needed if you don't define KERNEL and make a small tweak to systm.h's confused use of KERNEL. imp: OK. It too should be under -D_STANDALONE. Although it turns out not to be needed if you don't… | |||||
-I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs \ | |||||
-I${SRCTOP}/sys/contrib/openzfs/include \ | |||||
-I${SRCTOP}/sys/contrib/ck/include \ | |||||
# Do not unroll skein loops, reduce code size | |||||
CFLAGS.skein_block.c+= -DSKEIN_LOOP=111 | CFLAGS.skein_block.c+= -DSKEIN_LOOP=111 | ||||
CFLAGS.zfs.c+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 | CFLAGS.zfs.c+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl | ||||
CFLAGS.nvlist.c+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl | |||||
CFLAGS.list.c= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h ${ZFS_CFLAGS} | |||||
CFLAGS.zstd_shim.c+= ${ZFS_CFLAGS} -D_SYS_RWLOCK_H_ -D_SYS_MALLOC_H_ -D_OPENSOLARIS_SYS_KMEM_H_ -D_SPL_KMEM_CACHE_H -D_SYS_SPA_H -Wno-include-next-absolute-path -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/types.h -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/param.h -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/debug.h -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/proc.h -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/time.h -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/mutex.h -I${SYSDIR}/contrib/openzfs/module/zstd | |||||
Done Inline ActionsNot my proudest hour. mmacy: Not my proudest hour. | |||||
Not Done Inline ActionsYea, this has to be done in a different way. This isn't acceptable. A simple include file would do that trick.... imp: Yea, this has to be done in a different way. This isn't acceptable. A simple include file would… | |||||
Done Inline Actions
Uh no it wouldn't. I didn't spend 8 hours beating my head against this because it was easy. I assume you're offering to write a patch to this effect since it's "simple" - thanks. mmacy: > Yea, this has to be done in a different way. This isn't acceptable. A simple include file… | |||||
Not Done Inline ActionsThe long list of includes isn't permitted. It's unmaintainable. Instead, you need to create a facility in defs.mk to allow you to create the proper stack of include files. It's one line there and lets you move these all to #include inside of zstd_shim.c. Most of the defines to 'turn off' include files go away too. I'll add that so there's a regular way to have early args in CFLAGS on a per-target basis. If you do that, you'll be able to #include these files in zstd_shim.c and have them work as intended. With these changes, list.c needs no special treatment other than the early include. nvlist.c runs into the bug in the zfs code where two different boolean_t definitions exist. This should be resolved separately, however. Just adding the freebsd spl directory to CFLAGS is enough to get by, though should be revisited. zfs.c has the same issue. It also doesn't need lz4 to compile. imp: The long list of includes isn't permitted. It's unmaintainable.
Instead, you need to create a… | |||||
CFLAGS+= -Wformat -Wall | CFLAGS+= -Wformat -Wall | ||||
Context not available. |
_KERNEL, KERNEL and KERNEL__? Does OpenZFS base use all of those for real?