Cleanup linux module kbuild files
The linux module can be built either as an external module, or compiled
into the kernel, using copy-builtin. The source and build directories
are slightly different between the two cases, and currently, compiling
into the kernel still refers to some files from the configured ZFS
source tree, instead of the copies inside the kernel source tree. There
is also duplication between copy-builtin, which creates a Kbuild file to
build ZFS inside the kernel tree, and the top-level module/Makefile.in.
Fix this by moving the list of modules and the CFLAGS settings into a
new module/Kbuild.in, which will be used by the kernel kbuild
infrastructure, and using KBUILD_EXTMOD to distinguish the two cases
within the Makefiles, in order to choose appropriate include
directories etc.
Module CFLAGS setting is simplified by using subdir-ccflags-y (available
since 2.6.30) to set them in the top-level Kbuild instead of each
individual module. The disabling of -Wunused-but-set-variable is removed
from the lua and zfs modules. The variable that the Makefile uses is
actually not defined, so this has no effect; and the warning has long
been disabled by the kernel Makefile itself.
The target_cpu definition in module/{zfs,zcommon} is removed as it was
replaced by use of CONFIG_SPARC64 in
commit 70835c5b755e ("Unify target_cpu handling")
os/linux/{spl,zfs} are removed from obj-m, as they are not modules in
themselves, but are included by the Makefile in the spl and zfs module
directories. The vestigial Makefiles in os and os/linux are removed.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes #10379
Closes #10421
2020-06-07 21:03:12 +00:00
|
|
|
ifneq ($(KBUILD_EXTMOD),)
|
|
|
|
src = @abs_srcdir@
|
2016-05-12 14:51:24 +00:00
|
|
|
obj = @abs_builddir@
|
Cleanup linux module kbuild files
The linux module can be built either as an external module, or compiled
into the kernel, using copy-builtin. The source and build directories
are slightly different between the two cases, and currently, compiling
into the kernel still refers to some files from the configured ZFS
source tree, instead of the copies inside the kernel source tree. There
is also duplication between copy-builtin, which creates a Kbuild file to
build ZFS inside the kernel tree, and the top-level module/Makefile.in.
Fix this by moving the list of modules and the CFLAGS settings into a
new module/Kbuild.in, which will be used by the kernel kbuild
infrastructure, and using KBUILD_EXTMOD to distinguish the two cases
within the Makefiles, in order to choose appropriate include
directories etc.
Module CFLAGS setting is simplified by using subdir-ccflags-y (available
since 2.6.30) to set them in the top-level Kbuild instead of each
individual module. The disabling of -Wunused-but-set-variable is removed
from the lua and zfs modules. The variable that the Makefile uses is
actually not defined, so this has no effect; and the warning has long
been disabled by the kernel Makefile itself.
The target_cpu definition in module/{zfs,zcommon} is removed as it was
replaced by use of CONFIG_SPARC64 in
commit 70835c5b755e ("Unify target_cpu handling")
os/linux/{spl,zfs} are removed from obj-m, as they are not modules in
themselves, but are included by the Makefile in the spl and zfs module
directories. The vestigial Makefiles in os and os/linux are removed.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes #10379
Closes #10421
2020-06-07 21:03:12 +00:00
|
|
|
icp_include = $(src)/include
|
|
|
|
else
|
|
|
|
icp_include = $(srctree)/$(src)/include
|
|
|
|
endif
|
2016-05-12 14:51:24 +00:00
|
|
|
|
|
|
|
MODULE := icp
|
|
|
|
|
|
|
|
obj-$(CONFIG_ZFS) := $(MODULE).o
|
|
|
|
|
Cleanup linux module kbuild files
The linux module can be built either as an external module, or compiled
into the kernel, using copy-builtin. The source and build directories
are slightly different between the two cases, and currently, compiling
into the kernel still refers to some files from the configured ZFS
source tree, instead of the copies inside the kernel source tree. There
is also duplication between copy-builtin, which creates a Kbuild file to
build ZFS inside the kernel tree, and the top-level module/Makefile.in.
Fix this by moving the list of modules and the CFLAGS settings into a
new module/Kbuild.in, which will be used by the kernel kbuild
infrastructure, and using KBUILD_EXTMOD to distinguish the two cases
within the Makefiles, in order to choose appropriate include
directories etc.
Module CFLAGS setting is simplified by using subdir-ccflags-y (available
since 2.6.30) to set them in the top-level Kbuild instead of each
individual module. The disabling of -Wunused-but-set-variable is removed
from the lua and zfs modules. The variable that the Makefile uses is
actually not defined, so this has no effect; and the warning has long
been disabled by the kernel Makefile itself.
The target_cpu definition in module/{zfs,zcommon} is removed as it was
replaced by use of CONFIG_SPARC64 in
commit 70835c5b755e ("Unify target_cpu handling")
os/linux/{spl,zfs} are removed from obj-m, as they are not modules in
themselves, but are included by the Makefile in the spl and zfs module
directories. The vestigial Makefiles in os and os/linux are removed.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes #10379
Closes #10421
2020-06-07 21:03:12 +00:00
|
|
|
asflags-y := -I$(icp_include)
|
|
|
|
ccflags-y := -I$(icp_include)
|
2016-05-12 14:51:24 +00:00
|
|
|
|
|
|
|
$(MODULE)-objs += illumos-crypto.o
|
|
|
|
$(MODULE)-objs += api/kcf_cipher.o
|
|
|
|
$(MODULE)-objs += api/kcf_mac.o
|
|
|
|
$(MODULE)-objs += api/kcf_ctxops.o
|
|
|
|
$(MODULE)-objs += core/kcf_callprov.o
|
|
|
|
$(MODULE)-objs += core/kcf_prov_tabs.o
|
|
|
|
$(MODULE)-objs += core/kcf_sched.o
|
|
|
|
$(MODULE)-objs += core/kcf_mech_tabs.o
|
|
|
|
$(MODULE)-objs += core/kcf_prov_lib.o
|
|
|
|
$(MODULE)-objs += spi/kcf_spi.o
|
|
|
|
$(MODULE)-objs += io/aes.o
|
|
|
|
$(MODULE)-objs += io/sha2_mod.o
|
2016-06-15 22:47:05 +00:00
|
|
|
$(MODULE)-objs += io/skein_mod.o
|
2016-05-12 14:51:24 +00:00
|
|
|
$(MODULE)-objs += os/modhash.o
|
|
|
|
$(MODULE)-objs += algs/modes/cbc.o
|
|
|
|
$(MODULE)-objs += algs/modes/ccm.o
|
|
|
|
$(MODULE)-objs += algs/modes/ctr.o
|
|
|
|
$(MODULE)-objs += algs/modes/ecb.o
|
2018-08-02 18:59:24 +00:00
|
|
|
$(MODULE)-objs += algs/modes/gcm_generic.o
|
2016-05-12 14:51:24 +00:00
|
|
|
$(MODULE)-objs += algs/modes/gcm.o
|
|
|
|
$(MODULE)-objs += algs/modes/modes.o
|
2018-08-02 18:59:24 +00:00
|
|
|
$(MODULE)-objs += algs/aes/aes_impl_generic.o
|
2016-05-12 14:51:24 +00:00
|
|
|
$(MODULE)-objs += algs/aes/aes_impl.o
|
|
|
|
$(MODULE)-objs += algs/aes/aes_modes.o
|
2016-06-15 22:47:05 +00:00
|
|
|
$(MODULE)-objs += algs/edonr/edonr.o
|
2016-05-12 14:51:24 +00:00
|
|
|
$(MODULE)-objs += algs/sha2/sha2.o
|
2016-06-15 22:47:05 +00:00
|
|
|
$(MODULE)-objs += algs/skein/skein.o
|
|
|
|
$(MODULE)-objs += algs/skein/skein_block.o
|
|
|
|
$(MODULE)-objs += algs/skein/skein_iv.o
|
2020-01-17 20:40:09 +00:00
|
|
|
|
|
|
|
$(MODULE)-$(CONFIG_X86_64) += asm-x86_64/aes/aeskey.o
|
|
|
|
$(MODULE)-$(CONFIG_X86_64) += asm-x86_64/aes/aes_amd64.o
|
|
|
|
$(MODULE)-$(CONFIG_X86_64) += asm-x86_64/aes/aes_aesni.o
|
|
|
|
$(MODULE)-$(CONFIG_X86_64) += asm-x86_64/modes/gcm_pclmulqdq.o
|
2020-02-10 20:59:50 +00:00
|
|
|
$(MODULE)-$(CONFIG_X86_64) += asm-x86_64/modes/aesni-gcm-x86_64.o
|
|
|
|
$(MODULE)-$(CONFIG_X86_64) += asm-x86_64/modes/ghash-x86_64.o
|
2020-01-17 20:40:09 +00:00
|
|
|
$(MODULE)-$(CONFIG_X86_64) += asm-x86_64/sha2/sha256_impl.o
|
|
|
|
$(MODULE)-$(CONFIG_X86_64) += asm-x86_64/sha2/sha512_impl.o
|
2016-05-12 14:51:24 +00:00
|
|
|
|
2018-08-02 18:59:24 +00:00
|
|
|
$(MODULE)-$(CONFIG_X86) += algs/modes/gcm_pclmulqdq.o
|
|
|
|
$(MODULE)-$(CONFIG_X86) += algs/aes/aes_impl_aesni.o
|
|
|
|
$(MODULE)-$(CONFIG_X86) += algs/aes/aes_impl_x86-64.o
|
|
|
|
|
2020-02-10 20:59:50 +00:00
|
|
|
# Suppress objtool "can't find jump dest instruction at" warnings. They
|
|
|
|
# are caused by the constants which are defined in the text section of the
|
|
|
|
# assembly file using .byte instructions (e.g. bswap_mask). The objtool
|
|
|
|
# utility tries to interpret them as opcodes and obviously fails doing so.
|
|
|
|
OBJECT_FILES_NON_STANDARD_aesni-gcm-x86_64.o := y
|
|
|
|
OBJECT_FILES_NON_STANDARD_ghash-x86_64.o := y
|
2021-04-17 20:11:18 +00:00
|
|
|
# Suppress objtool "unsupported stack pointer realignment" warnings. We are
|
|
|
|
# not using a DRAP register while aligning the stack to a 64 byte boundary.
|
|
|
|
# See #6950 for the reasoning.
|
|
|
|
OBJECT_FILES_NON_STANDARD_sha256_impl.o := y
|
|
|
|
OBJECT_FILES_NON_STANDARD_sha512_impl.o := y
|
2020-02-10 20:59:50 +00:00
|
|
|
|
2016-05-12 14:51:24 +00:00
|
|
|
ICP_DIRS = \
|
|
|
|
api \
|
|
|
|
core \
|
|
|
|
spi \
|
|
|
|
io \
|
|
|
|
os \
|
|
|
|
algs \
|
|
|
|
algs/aes \
|
2016-06-15 22:47:05 +00:00
|
|
|
algs/edonr \
|
2016-05-12 14:51:24 +00:00
|
|
|
algs/modes \
|
|
|
|
algs/sha2 \
|
2016-06-15 22:47:05 +00:00
|
|
|
algs/skein \
|
2016-05-12 14:51:24 +00:00
|
|
|
asm-x86_64 \
|
|
|
|
asm-x86_64/aes \
|
|
|
|
asm-x86_64/modes \
|
|
|
|
asm-x86_64/sha2 \
|
|
|
|
asm-i386 \
|
|
|
|
asm-generic
|
|
|
|
|
|
|
|
all:
|
|
|
|
mkdir -p $(ICP_DIRS)
|