summaryrefslogtreecommitdiff
path: root/cddl/lib/libicp/Makefile
blob: 15846e67a14bc1124561a58c56a264c04103686c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
.PATH: ${ZFSTOP}/module/icp

PACKAGE=	zfs
LIB_PACKAGE=

LIB=	icp
LIBADD=

.if ${MACHINE_ARCH} == "amd64"
ASM_SOURCES_C = asm-x86_64/aes/aeskey.c
ASM_SOURCES_AS = \
        asm-x86_64/aes/aes_amd64.S \
        asm-x86_64/aes/aes_aesni.S \
        asm-x86_64/modes/gcm_pclmulqdq.S \
        asm-x86_64/modes/aesni-gcm-x86_64.S \
        asm-x86_64/modes/aesni-gcm-avx2-vaes.S \
        asm-x86_64/modes/ghash-x86_64.S \
        asm-x86_64/sha2/sha256-x86_64.S \
        asm-x86_64/sha2/sha512-x86_64.S \
        asm-x86_64/blake3/blake3_avx2.S \
        asm-x86_64/blake3/blake3_avx512.S \
        asm-x86_64/blake3/blake3_sse2.S \
        asm-x86_64/blake3/blake3_sse41.S

CFLAGS+= -D__amd64 -D_SYS_STACK_H -UHAVE_AES
.elif ${MACHINE_CPUARCH} == "arm"
ASM_SOURCES_C =
ASM_SOURCES_AS = \
        asm-arm/sha2/sha256-armv7.S \
        asm-arm/sha2/sha512-armv7.S
.elif ${MACHINE_ARCH} == "aarch64"
ASM_SOURCES_C =
ASM_SOURCES_AS = \
        asm-aarch64/blake3/b3_aarch64_sse2.S \
        asm-aarch64/blake3/b3_aarch64_sse41.S \
        asm-aarch64/sha2/sha256-armv8.S \
        asm-aarch64/sha2/sha512-armv8.S
.elif ${MACHINE_ARCH} == "powerpc64"
ASM_SOURCES_C =
ASM_SOURCES_AS = \
        asm-ppc64/sha2/sha256-ppc.S \
        asm-ppc64/sha2/sha512-ppc.S \
        asm-ppc64/sha2/sha256-p8.S \
        asm-ppc64/sha2/sha512-p8.S
.elif ${MACHINE_ARCH} == "powerpc64le"
ASM_SOURCES_C =
ASM_SOURCES_AS = \
        asm-ppc64/blake3/b3_ppc64le_sse2.S \
        asm-ppc64/blake3/b3_ppc64le_sse41.S \
        asm-ppc64/sha2/sha256-ppc.S \
        asm-ppc64/sha2/sha512-ppc.S \
        asm-ppc64/sha2/sha256-p8.S \
        asm-ppc64/sha2/sha512-p8.S
.else
ASM_SOURCES_C =
ASM_SOURCES_AS =
.endif

KERNEL_C = \
        spi/kcf_spi.c \
        api/kcf_ctxops.c \
        api/kcf_cipher.c \
        api/kcf_mac.c \
        algs/aes/aes_impl_aesni.c \
        algs/aes/aes_impl_generic.c \
        algs/aes/aes_impl_x86-64.c \
        algs/aes/aes_impl.c \
        algs/aes/aes_modes.c \
        algs/blake3/blake3.c \
        algs/blake3/blake3_generic.c \
        algs/blake3/blake3_impl.c \
        algs/edonr/edonr.c \
        algs/modes/modes.c \
        algs/modes/gcm_generic.c \
        algs/modes/gcm_pclmulqdq.c \
        algs/modes/gcm.c \
        algs/modes/ccm.c \
        algs/sha2/sha2_generic.c \
        algs/sha2/sha256_impl.c \
        algs/sha2/sha512_impl.c \
        algs/skein/skein.c \
        algs/skein/skein_block.c \
        algs/skein/skein_iv.c \
        illumos-crypto.c \
        io/aes.c \
        io/sha2_mod.c \
        core/kcf_sched.c \
        core/kcf_prov_lib.c \
        core/kcf_callprov.c \
        core/kcf_mech_tabs.c \
        core/kcf_prov_tabs.c \
        $(ASM_SOURCES_C)

SRCS= $(ASM_SOURCES_AS) $(KERNEL_C)

WARNS?=	2
SHLIB_MAJOR= 3
CSTD=	c99
CFLAGS+= -DIN_BASE
CFLAGS+= -I${ZFSTOP}/include
CFLAGS+= -I${ZFSTOP}/lib/libspl/include/
CFLAGS+= -I${ZFSTOP}/lib/libspl/include/os/freebsd
CFLAGS+= -I${SRCTOP}/sys
CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
CFLAGS+= -I${ZFSTOP}/module/icp/include
CFLAGS+= -I${ZFSTOP}/lib/libzpool/include
CFLAGS+= -include ${ZFSTOP}/include/os/freebsd/spl/sys/ccompile.h
CFLAGS+= -DHAVE_ISSETUGID
CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h

CFLAGS.aes_amd64.S+= -DLOCORE
CFLAGS.aes_aesni.S+= -DLOCORE
CFLAGS.gcm_pclmulqdq.S+= -DLOCORE
CFLAGS.aesni-gcm-x86_64.S+= -DLOCORE
CFLAGS.aesni-gcm-avx2-vaes.S+= -DLOCORE
CFLAGS.ghash-x86_64.S+= -DLOCORE
CFLAGS.sha256-x86_64.S+= -DLOCORE
CFLAGS.sha512-x86_64.S+= -DLOCORE
CFLAGS.blake3_avx2.S = -DLOCORE
CFLAGS.blake3_avx512.S = -DLOCORE
CFLAGS.blake3_sse2.S = -DLOCORE
CFLAGS.blake3_sse41.S = -DLOCORE
CFLAGS.b3_aarch64_sse2.S = -DLOCORE
CFLAGS.b3_aarch64_sse41.S = -DLOCORE
CFLAGS.sha256-armv7.S = -DLOCORE
CFLAGS.sha256-armv8.S = -DLOCORE
CFLAGS.sha512-armv7.S = -DLOCORE
CFLAGS.sha512-armv8.S = -DLOCORE
CFLAGS.b3_ppc64le_sse2.S = -DLOCORE
CFLAGS.b3_ppc64le_sse41.S = -DLOCORE
CFLAGS.sha256-p8.S = -DLOCORE
CFLAGS.sha256-ppc.S = -DLOCORE
CFLAGS.sha512-p8.S = -DLOCORE
CFLAGS.sha512-ppc.S = -DLOCORE


LDFLAGS.bfd+= -Wl,-znoexecstack

.include <bsd.lib.mk>