1b8902de1SWarner Losh.PATH: ${ZFSSRC} 2b8902de1SWarner Losh.PATH: ${SYSDIR}/crypto/skein 32fec3ae8SWarner Losh.PATH: ${ZFSOSSRC}/spl 4119c786fSWarner Losh.PATH: ${OZFS}/module/zstd 5c03c5b1cSMartin Matuska.PATH: ${OZFS}/module/zstd/lib/common 6c03c5b1cSMartin Matuska.PATH: ${OZFS}/module/zstd/lib/compress 7c03c5b1cSMartin Matuska.PATH: ${OZFS}/module/zstd/lib/decompress 82a58b312SMartin Matuska.PATH: ${OZFS}/module/icp/asm-aarch64/blake3 975ad2477SWarner Losh.PATH: ${OZFS}/module/icp/algs/blake3 10f424b167SWarner LoshZFS_SRC= zfs.c nvlist.c skein.c skein_block.c list.c 11119c786fSWarner LoshZFS_SRC+= zfs_zstd.c 12b53ec4e4SWarner LoshZFS_SRC+= blake3.c blake3_generic.c blake3_impl.c 13285f6ab6SWarner LoshZSTD_SRC+= entropy_common.c error_private.c 144f0c9b76SWarner LoshZSTD_SRC+= fse_decompress.c hist.c 154f0c9b76SWarner LoshZSTD_SRC+= huf_decompress.c pool.c xxhash.c 164f0c9b76SWarner LoshZSTD_SRC+= zstd_common.c 17285f6ab6SWarner LoshZSTD_SRC+= zstd_ddict.c zstd_decompress.c zstd_decompress_block.c 18285f6ab6SWarner LoshZSTD_SRC+= zstd_double_fast.c zstd_fast.c zstd_lazy.c zstd_ldm.c 19c03c5b1cSMartin Matuska 202a58b312SMartin MatuskaSRCS+= ${ZFS_SRC} ${ZSTD_SRC} ${ZFS_SRC_AS} 21b8902de1SWarner Losh 224773d342SWarner Losh# 234773d342SWarner Losh# Any file that needs the FreeBSD overrides that are in 244773d342SWarner Losh# include/os/freebssd/spl/XXX needs to have these added to 254773d342SWarner Losh# CFLAGS_EARLY.file.c. In general, we try to build out of the OpenZFS tree 264773d342SWarner Losh# unaltered. There's a problem, though, that since we're building for a 274773d342SWarner Losh# standalone environment that's neither userland nor kernel, we sometimes need 284773d342SWarner Losh# special code and that's handled by the 'nested' includes where we either setup 294773d342SWarner Losh# something just-so before we include the include/XXX file, or if we need to 304773d342SWarner Losh# tweak something defined in that file. 314773d342SWarner Losh# 324773d342SWarner Losh 3387d3aa53SWarner LoshZFS_EARLY= -I${ZFSSRC}/spl \ 3487d3aa53SWarner Losh -I${ZFSOSINC} \ 352fec3ae8SWarner Losh -I${ZFSOSINC}/spl \ 362fec3ae8SWarner Losh -I${ZFSOSINC}/zfs 372fec3ae8SWarner Losh 384773d342SWarner Losh# 394773d342SWarner Losh# For all files, though, we prepend the sys/ccompile.h file to the build which 404773d342SWarner Losh# has a bunch of defines that are present in OpenSolaris / Illumos, but missing 414773d342SWarner Losh# from FreeBSD. 424773d342SWarner Losh# 43285f6ab6SWarner Losh.for i in ${ZFS_SRC} ${ZSTD_SRC} 44119c786fSWarner LoshCFLAGS.$i+= -include ${ZFSOSINC}/spl/sys/ccompile.h -Wformat -Wall -I${OZFS}/include \ 45119c786fSWarner Losh -DNEED_SOLARIS_BOOLEAN 462fec3ae8SWarner Losh.endfor 472fec3ae8SWarner Losh 486c8358cdSWarner LoshCFLAGS_EARLY.blake3.c+= ${ZFS_EARLY} -DOMIT_SIMD 496c8358cdSWarner LoshCFLAGS_EARLY.blake3_generic.c+= ${ZFS_EARLY} -DOMIT_SIMD 50b53ec4e4SWarner LoshCFLAGS_EARLY.blake3_impl.c+= ${ZFS_EARLY} -DOMIT_SIMD 512fec3ae8SWarner LoshCFLAGS_EARLY.list.c+= ${ZFS_EARLY} 52119c786fSWarner LoshCFLAGS_EARLY.zfs_zstd.c+= ${ZFS_EARLY} 534773d342SWarner LoshCFLAGS_EARLY.nvlist.c+= ${ZFS_EARLY} 541306a5dcSWarner LoshCFLAGS_EARLY.zfs.c += ${ZFS_EARLY} 552fec3ae8SWarner Losh 561306a5dcSWarner Losh# 571306a5dcSWarner Losh# zfs.c is special: we need to define HAS_ZSTD_ZFS to get zfssubr.c to initialize zstd 581306a5dcSWarner Losh# properly. We need to have the cddl boot compat directory in the include path for zfssubr.c 591306a5dcSWarner Losh# to be found, and we need a couple of other include paths for skein and lz4. Finally we 60654b7837SWarner Losh# temporarily need LDRSRC to pick up part.h until libsa has a way to look into partitions 61654b7837SWarner Losh# or enumerate them... 621306a5dcSWarner Losh# 6309ace5ceSWarner LoshCFLAGS.zfs.c+= -DHAS_ZSTD_ZFS \ 6409ace5ceSWarner Losh -I${SYSDIR}/cddl/boot/zfs \ 6509ace5ceSWarner Losh -I${LDRSRC} \ 6609ace5ceSWarner Losh -I${SYSDIR}/crypto/skein \ 671306a5dcSWarner Losh -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 680e5ac0adSWarner Losh 690e5ac0adSWarner Losh# 700e5ac0adSWarner Losh# ZSTD coding style has some issues, so suppress clang's warnings. Also, zstd's 710e5ac0adSWarner Losh# use of BMI instrucitons is broken in this environment, so avoid them. 720e5ac0adSWarner Losh# 730e5ac0adSWarner Losh.for i in ${ZSTD_SRC} 740e5ac0adSWarner LoshCFLAGS.$i+= -U__BMI__ ${NO_WBITWISE_INSTEAD_OF_LOGICAL} 750e5ac0adSWarner Losh.endfor 760e5ac0adSWarner Losh 77119c786fSWarner LoshCFLAGS.zfs_zstd.c+= -DIN_BASE -DIN_LIBSA 782fec3ae8SWarner Losh 79*7a7741afSMartin MatuskaCFLAGS.blake3_impl.c+= -I${OZFS}/module/icp/algs/blake3 -I${OZFS}/module/icp/include -DIN_LIBSA 806c8358cdSWarner Losh 810fec8f03SToomas Soome# Do not unroll skein loops, reduce code size 820fec8f03SToomas SoomeCFLAGS.skein_block.c+= -DSKEIN_LOOP=111 8375ad2477SWarner Losh 840163de28SJohn BaldwinCWARNFLAGS.zfs.c+= ${NO_WDANGLING_POINTER} 85