1.PATH: ${SRCTOP}/sys/contrib/openzfs/module/icp 2 3PACKAGE= zfs 4LIB_PACKAGE= 5 6LIB= icp 7LIBADD= 8 9.if ${MACHINE_ARCH} == "amd64" 10ASM_SOURCES_C = asm-x86_64/aes/aeskey.c 11ASM_SOURCES_AS = \ 12 asm-x86_64/aes/aes_amd64.S \ 13 asm-x86_64/aes/aes_aesni.S \ 14 asm-x86_64/modes/gcm_pclmulqdq.S \ 15 asm-x86_64/modes/aesni-gcm-x86_64.S \ 16 asm-x86_64/modes/aesni-gcm-avx2-vaes.S \ 17 asm-x86_64/modes/ghash-x86_64.S \ 18 asm-x86_64/sha2/sha256-x86_64.S \ 19 asm-x86_64/sha2/sha512-x86_64.S \ 20 asm-x86_64/blake3/blake3_avx2.S \ 21 asm-x86_64/blake3/blake3_avx512.S \ 22 asm-x86_64/blake3/blake3_sse2.S \ 23 asm-x86_64/blake3/blake3_sse41.S 24 25CFLAGS+= -D__amd64 -D_SYS_STACK_H -UHAVE_AES 26.elif ${MACHINE_CPUARCH} == "arm" 27ASM_SOURCES_C = 28ASM_SOURCES_AS = \ 29 asm-arm/sha2/sha256-armv7.S \ 30 asm-arm/sha2/sha512-armv7.S 31.elif ${MACHINE_ARCH} == "aarch64" 32ASM_SOURCES_C = 33ASM_SOURCES_AS = \ 34 asm-aarch64/blake3/b3_aarch64_sse2.S \ 35 asm-aarch64/blake3/b3_aarch64_sse41.S \ 36 asm-aarch64/sha2/sha256-armv8.S \ 37 asm-aarch64/sha2/sha512-armv8.S 38.elif ${MACHINE_ARCH} == "powerpc64" 39ASM_SOURCES_C = 40ASM_SOURCES_AS = \ 41 asm-ppc64/sha2/sha256-ppc.S \ 42 asm-ppc64/sha2/sha512-ppc.S \ 43 asm-ppc64/sha2/sha256-p8.S \ 44 asm-ppc64/sha2/sha512-p8.S 45.elif ${MACHINE_ARCH} == "powerpc64le" 46ASM_SOURCES_C = 47ASM_SOURCES_AS = \ 48 asm-ppc64/blake3/b3_ppc64le_sse2.S \ 49 asm-ppc64/blake3/b3_ppc64le_sse41.S \ 50 asm-ppc64/sha2/sha256-ppc.S \ 51 asm-ppc64/sha2/sha512-ppc.S \ 52 asm-ppc64/sha2/sha256-p8.S \ 53 asm-ppc64/sha2/sha512-p8.S 54.else 55ASM_SOURCES_C = 56ASM_SOURCES_AS = 57.endif 58 59KERNEL_C = \ 60 spi/kcf_spi.c \ 61 api/kcf_ctxops.c \ 62 api/kcf_cipher.c \ 63 api/kcf_mac.c \ 64 algs/aes/aes_impl_aesni.c \ 65 algs/aes/aes_impl_generic.c \ 66 algs/aes/aes_impl_x86-64.c \ 67 algs/aes/aes_impl.c \ 68 algs/aes/aes_modes.c \ 69 algs/blake3/blake3.c \ 70 algs/blake3/blake3_generic.c \ 71 algs/blake3/blake3_impl.c \ 72 algs/edonr/edonr.c \ 73 algs/modes/modes.c \ 74 algs/modes/gcm_generic.c \ 75 algs/modes/gcm_pclmulqdq.c \ 76 algs/modes/gcm.c \ 77 algs/modes/ccm.c \ 78 algs/sha2/sha2_generic.c \ 79 algs/sha2/sha256_impl.c \ 80 algs/sha2/sha512_impl.c \ 81 algs/skein/skein.c \ 82 algs/skein/skein_block.c \ 83 algs/skein/skein_iv.c \ 84 illumos-crypto.c \ 85 io/aes.c \ 86 io/sha2_mod.c \ 87 core/kcf_sched.c \ 88 core/kcf_prov_lib.c \ 89 core/kcf_callprov.c \ 90 core/kcf_mech_tabs.c \ 91 core/kcf_prov_tabs.c \ 92 $(ASM_SOURCES_C) 93 94.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zfs 95KERNEL_C+= zfs_impl.c 96 97SRCS= $(ASM_SOURCES_AS) $(KERNEL_C) 98 99WARNS?= 2 100SHLIB_MAJOR= 3 101CSTD= c99 102CFLAGS+= -DIN_BASE 103CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include 104CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ 105CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd 106CFLAGS+= -I${SRCTOP}/sys 107CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include 108CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include 109CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzpool/include 110CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h 111CFLAGS+= -DHAVE_ISSETUGID 112CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h 113 114CFLAGS.aes_amd64.S+= -DLOCORE 115CFLAGS.aes_aesni.S+= -DLOCORE 116CFLAGS.gcm_pclmulqdq.S+= -DLOCORE 117CFLAGS.aesni-gcm-x86_64.S+= -DLOCORE 118CFLAGS.aesni-gcm-avx2-vaes.S+= -DLOCORE 119CFLAGS.ghash-x86_64.S+= -DLOCORE 120CFLAGS.sha256-x86_64.S+= -DLOCORE 121CFLAGS.sha512-x86_64.S+= -DLOCORE 122CFLAGS.blake3_avx2.S = -DLOCORE 123CFLAGS.blake3_avx512.S = -DLOCORE 124CFLAGS.blake3_sse2.S = -DLOCORE 125CFLAGS.blake3_sse41.S = -DLOCORE 126CFLAGS.b3_aarch64_sse2.S = -DLOCORE 127CFLAGS.b3_aarch64_sse41.S = -DLOCORE 128CFLAGS.sha256-armv7.S = -DLOCORE 129CFLAGS.sha256-armv8.S = -DLOCORE 130CFLAGS.sha512-armv7.S = -DLOCORE 131CFLAGS.sha512-armv8.S = -DLOCORE 132CFLAGS.b3_ppc64le_sse2.S = -DLOCORE 133CFLAGS.b3_ppc64le_sse41.S = -DLOCORE 134CFLAGS.sha256-p8.S = -DLOCORE 135CFLAGS.sha256-ppc.S = -DLOCORE 136CFLAGS.sha512-p8.S = -DLOCORE 137CFLAGS.sha512-ppc.S = -DLOCORE 138 139 140LDFLAGS.bfd+= -Wl,-znoexecstack 141 142.include <bsd.lib.mk> 143