-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 70835c5 ("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
- Loading branch information
1 parent
dd4bc56
commit 7150427
Showing
16 changed files
with
87 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
.*.d | ||
*.mod | ||
|
||
/Kbuild | ||
/.cache.mk | ||
/.tmp_versions | ||
/Module.markers | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# When integrated in to a monolithic kernel the spl module must appear | ||
# first. This ensures its module initialization function is run before | ||
# any of the other module initialization functions which depend on it. | ||
ZFS_MODULES += spl/ | ||
ZFS_MODULES += avl/ | ||
ZFS_MODULES += icp/ | ||
ZFS_MODULES += lua/ | ||
ZFS_MODULES += nvpair/ | ||
ZFS_MODULES += unicode/ | ||
ZFS_MODULES += zcommon/ | ||
ZFS_MODULES += zfs/ | ||
|
||
# The rest is only relevant when run by kbuild | ||
ifneq ($(KERNELRELEASE),) | ||
|
||
obj-$(CONFIG_ZFS) := $(ZFS_MODULES) | ||
|
||
ZFS_MODULE_CFLAGS += -std=gnu99 -Wno-declaration-after-statement | ||
ZFS_MODULE_CFLAGS += @KERNEL_DEBUG_CFLAGS@ @NO_FORMAT_ZERO_LENGTH@ | ||
|
||
ifneq ($(KBUILD_EXTMOD),) | ||
zfs_include = @abs_top_srcdir@/include | ||
ZFS_MODULE_CFLAGS += -include @abs_top_builddir@/zfs_config.h | ||
else | ||
zfs_include = $(srctree)/include/zfs | ||
ZFS_MODULE_CFLAGS += -include $(zfs_include)/zfs_config.h | ||
endif | ||
|
||
ZFS_MODULE_CFLAGS += -I$(zfs_include)/os/linux/kernel | ||
ZFS_MODULE_CFLAGS += -I$(zfs_include)/os/linux/spl | ||
ZFS_MODULE_CFLAGS += -I$(zfs_include)/os/linux/zfs | ||
ZFS_MODULE_CFLAGS += -I$(zfs_include) | ||
ZFS_MODULE_CPPFLAGS += -D_KERNEL | ||
ZFS_MODULE_CPPFLAGS += @KERNEL_DEBUG_CPPFLAGS@ | ||
|
||
ifneq ($(KBUILD_EXTMOD),) | ||
@CONFIG_QAT_TRUE@ZFS_MODULE_CFLAGS += -I@QAT_SRC@/include | ||
@CONFIG_QAT_TRUE@KBUILD_EXTRA_SYMBOLS += @QAT_SYMBOLS@ | ||
endif | ||
|
||
subdir-asflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS) | ||
subdir-ccflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS) | ||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
src = @abs_top_srcdir@/module/avl | ||
ifneq ($(KBUILD_EXTMOD),) | ||
src = @abs_srcdir@ | ||
obj = @abs_builddir@ | ||
endif | ||
|
||
MODULE := zavl | ||
|
||
obj-$(CONFIG_ZFS) := $(MODULE).o | ||
|
||
ccflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS) | ||
|
||
$(MODULE)-objs += avl.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
src = @abs_top_srcdir@/module/spl | ||
ifneq ($(KBUILD_EXTMOD),) | ||
src = @abs_srcdir@ | ||
obj = @abs_builddir@ | ||
mfdir = $(obj) | ||
else | ||
mfdir = $(srctree)/$(src) | ||
endif | ||
|
||
MODULE := spl | ||
|
||
obj-$(CONFIG_ZFS) := $(MODULE).o | ||
|
||
ccflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS) | ||
|
||
|
||
-include @abs_top_builddir@/module/os/linux/spl/Makefile | ||
include $(mfdir)/../os/linux/spl/Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
src = @abs_top_srcdir@/module/unicode | ||
ifneq ($(KBUILD_EXTMOD),) | ||
src = @abs_srcdir@ | ||
obj = @abs_builddir@ | ||
endif | ||
|
||
MODULE := zunicode | ||
|
||
obj-$(CONFIG_ZFS) := $(MODULE).o | ||
|
||
ccflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS) | ||
|
||
$(MODULE)-objs += u8_textprep.o | ||
$(MODULE)-objs += uconv.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters