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