From f3cbdcea03833c95e29d55a3ee850bbaf62d1302 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 19 Jul 2020 01:16:24 +0000 Subject: [PATCH 1/3] scst.spec.in: Set ${KDIR} and ${KVER} correctly git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9053 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst.spec.in | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scst.spec.in b/scst.spec.in index 3e933e090..8527e2800 100644 --- a/scst.spec.in +++ b/scst.spec.in @@ -9,7 +9,7 @@ make -sC "%{kdir}" kernelversion | grep -v ^make)}} %{!?kdir: %define kversion %{expand:%%(uname -r)}}} -%{echo:kversion=%{kversion} +%{echo:kdir=%{kdir} kversion=%{kversion} } # kernel_rpm: Name of the kernel RPM if the kernel is available as an RPM. # krpmver: Version of the kernel RPM. Not necessarily identical to kversion. @@ -115,8 +115,9 @@ Authors: %setup -q -n %{kmod_name}-%{version} %build -export KVER=%{kversion} PREFIX=%{_prefix} -%{?kdir:%{expand:%%(export KDIR=%{kdir})}} +%{?kdir:export KDIR=%{kdir}} +%{!?kdir:%{?kversion:export KVER=%{kversion}}} +export PREFIX=%{_prefix} export BUILD_2X_MODULE=y CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y make 2release for d in scst fcst iscsi-scst qla2x00t/qla2x00-target scst_local srpt; do @@ -124,8 +125,9 @@ for d in scst fcst iscsi-scst qla2x00t/qla2x00-target scst_local srpt; do done %install -export KVER=%{kversion} PREFIX=%{_prefix} MANDIR=%{_mandir} DEPMOD=true -%{?kdir:%{expand:%%(export KDIR=%{kdir})}} +%{?kdir:export KDIR=%{kdir}} +%{!?kdir:%{?kversion:export KVER=%{kversion}}} +export PREFIX=%{_prefix} MANDIR=%{_mandir} DEPMOD=true export BUILD_2X_MODULE=y CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y for d in scst; do DESTDIR=%{buildroot} %{make} -C $d install From 7569ddaf2ef645c42f329da4eb7fa83a8f538b9e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 19 Jul 2020 01:18:24 +0000 Subject: [PATCH 2/3] Makefiles: Remove -Wextra Since not all kernel header files are compatible with -Wextra, remove -Wextra. To enable -Wextra, build SCST with W=1. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9054 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/Makefile | 3 --- iscsi-scst/kernel/isert-scst/Makefile | 3 --- qla2x00t-32gbit/Kbuild | 4 +--- qla2x00t-32gbit/qla2x00-target/Kbuild | 1 - qla2x00t/Kbuild | 4 +--- qla2x00t/qla2x00-target/Kbuild | 1 - scst/src/Kbuild | 3 +-- scst/src/dev_handlers/Kbuild | 4 +--- scst_local/Kbuild | 2 -- srpt/src/Makefile | 2 -- 10 files changed, 4 insertions(+), 23 deletions(-) diff --git a/iscsi-scst/kernel/Makefile b/iscsi-scst/kernel/Makefile index 2a8c90278..806f3ab7d 100644 --- a/iscsi-scst/kernel/Makefile +++ b/iscsi-scst/kernel/Makefile @@ -23,9 +23,6 @@ KBUILD_EXTRA_SYMBOLS = $(src)/../../scst/src/Module.symvers ccflags-y += -I$(src)/../include -I$(src)/../../scst/include -ccflags-y += $(call cc-option,-Wextra) \ - $(call cc-option,-Wno-old-style-declaration) \ - -Wno-unused-parameter -Wno-missing-field-initializers ccflags-y += $(PRE_CFLAGS) #ccflags-y += -DCONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES diff --git a/iscsi-scst/kernel/isert-scst/Makefile b/iscsi-scst/kernel/isert-scst/Makefile index d7fb7f081..e430979a9 100644 --- a/iscsi-scst/kernel/isert-scst/Makefile +++ b/iscsi-scst/kernel/isert-scst/Makefile @@ -25,9 +25,6 @@ KBUILD_EXTRA_SYMBOLS=$(src)/../../kernel/Module.symvers \ $(shell for d in /usr/src/ofa_kernel/default/Module.symvers; do\ [ -e $$d ] || continue; echo $$d; break; done) ccflags-y += -I$(src)/../../include -I$(src)/../../../scst/include -ccflags-y += $(call cc-option,-Wextra) \ - $(call cc-option,-Wno-old-style-declaration) \ - -Wno-unused-parameter -Wno-missing-field-initializers obj-m += isert-scst.o isert-scst-objs := isert.o isert_login.o \ diff --git a/qla2x00t-32gbit/Kbuild b/qla2x00t-32gbit/Kbuild index ec35194de..f25885d78 100644 --- a/qla2x00t-32gbit/Kbuild +++ b/qla2x00t-32gbit/Kbuild @@ -1,6 +1,4 @@ -ccflags-y += $(call cc-option,-Wextra) -Wno-unused-parameter \ - -Wno-missing-field-initializers \ - -I$(src)/../scst/include -I$(src)/include \ +ccflags-y += -I$(src)/../scst/include -I$(src)/include \ -DDEFAULT_SYMBOL_NAMESPACE=QLA32GB ifneq ($(CONFIG_SCSI_QLA2XXX_TARGET),) diff --git a/qla2x00t-32gbit/qla2x00-target/Kbuild b/qla2x00t-32gbit/qla2x00-target/Kbuild index eb3b6be8f..c3b0c09a7 100644 --- a/qla2x00t-32gbit/qla2x00-target/Kbuild +++ b/qla2x00t-32gbit/qla2x00-target/Kbuild @@ -1,7 +1,6 @@ KBUILD_EXTRA_SYMBOLS = $(src)/../../scst/src/Module.symvers \ $(src)/../Module.symvers ccflags-y += -I$(src)/../../scst/include -I$(src)/.. -ccflags-y += -Wextra -Wno-unused-parameter -Wno-missing-field-initializers #ccflags-y += -DCONFIG_QLA_TGT_DEBUG_WORK_IN_THREAD #ccflags-y += -DCONFIG_QLA_TGT_DEBUG_SRR diff --git a/qla2x00t/Kbuild b/qla2x00t/Kbuild index d18d16379..7b182d960 100644 --- a/qla2x00t/Kbuild +++ b/qla2x00t/Kbuild @@ -1,6 +1,4 @@ -ccflags-y += $(call cc-option,-Wextra) -Wno-unused-parameter \ - -Wno-missing-field-initializers -I$(src)/../scst/include\ - -DDEFAULT_SYMBOL_NAMESPACE=QLA16GB +ccflags-y += -I$(src)/../scst/include -DDEFAULT_SYMBOL_NAMESPACE=QLA16GB ifneq ($(CONFIG_SCSI_QLA2XXX_TARGET),) ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=$(CONFIG_SCSI_QLA2XXX_TARGET) diff --git a/qla2x00t/qla2x00-target/Kbuild b/qla2x00t/qla2x00-target/Kbuild index e00c73e73..be16e0571 100644 --- a/qla2x00t/qla2x00-target/Kbuild +++ b/qla2x00t/qla2x00-target/Kbuild @@ -1,7 +1,6 @@ KBUILD_EXTRA_SYMBOLS = $(src)/../../scst/src/Module.symvers \ $(src)/../Module.symvers ccflags-y += -I$(src)/../../scst/include -I$(src)/.. -ccflags-y += -Wextra -Wno-unused-parameter -Wno-missing-field-initializers #ccflags-y += -DCONFIG_QLA_TGT_DEBUG_WORK_IN_THREAD #ccflags-y += -DCONFIG_QLA_TGT_DEBUG_SRR diff --git a/scst/src/Kbuild b/scst/src/Kbuild index 5f58b7dfe..257e2de3f 100644 --- a/scst/src/Kbuild +++ b/scst/src/Kbuild @@ -1,7 +1,6 @@ # See also Documentation/core-api/symbol-namespaces.rst for more information # about DEFAULT_SYMBOL_NAMESPACE. -ccflags-y += -I$(src)/../include $(call cc-option,-Wextra) \ - -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare\ +ccflags-y += -I$(src)/../include\ -DDEFAULT_SYMBOL_NAMESPACE=SCST\ $(shell [ -n "${CONFIG_SCST_NO_DLM}" ] && echo -DCONFIG_SCST_NO_DLM) diff --git a/scst/src/dev_handlers/Kbuild b/scst/src/dev_handlers/Kbuild index a7996af0e..4674acc76 100644 --- a/scst/src/dev_handlers/Kbuild +++ b/scst/src/dev_handlers/Kbuild @@ -1,7 +1,5 @@ KBUILD_EXTRA_SYMBOLS=$(src)/../Module.symvers -ccflags-y += -I$(src)/../../include \ - $(call cc-option,-Wextra) \ - -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare +ccflags-y += -I$(src)/../../include #ccflags-y += -DCONFIG_DEBUG_EXT_COPY_REMAP obj-m := scst_cdrom.o scst_changer.o scst_disk.o scst_modisk.o scst_tape.o \ diff --git a/scst_local/Kbuild b/scst_local/Kbuild index e96859041..115020e42 100644 --- a/scst_local/Kbuild +++ b/scst_local/Kbuild @@ -1,6 +1,4 @@ KBUILD_EXTRA_SYMBOLS=$(src)/../scst/src/Module.symvers ccflags-y += -I$(src)/../scst/include -ccflags-y += $(call cc-option,-Wextra) -Wno-unused-parameter\ - -Wno-missing-field-initializers obj-m := scst_local.o diff --git a/srpt/src/Makefile b/srpt/src/Makefile index e5415bbbe..c0be48d7f 100644 --- a/srpt/src/Makefile +++ b/srpt/src/Makefile @@ -5,6 +5,4 @@ KBUILD_EXTRA_SYMBOLS=$(src)/../../scst/src/Module.symvers \ [ -e $$d ] || continue; echo $$d; break; done) ccflags-y += -I$(src)/../../scst/include -#ccflags-y += -Wextra -Wno-unused-parameter - obj-m += ib_srpt.o From a7446766c5314e4f8d82fe6ca7687b464e6f6f62 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 19 Jul 2020 01:19:49 +0000 Subject: [PATCH 3/3] isert-scst Makefile: Add the SCST Module.symvers file This patch fixes a linker error when cross-compiling for ARM on x86_64. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9055 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iscsi-scst/kernel/isert-scst/Makefile b/iscsi-scst/kernel/isert-scst/Makefile index e430979a9..545578432 100644 --- a/iscsi-scst/kernel/isert-scst/Makefile +++ b/iscsi-scst/kernel/isert-scst/Makefile @@ -21,7 +21,8 @@ # Note 2! The CFLAGS definitions are now in the main makefile. LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) -KBUILD_EXTRA_SYMBOLS=$(src)/../../kernel/Module.symvers \ +KBUILD_EXTRA_SYMBOLS = $(src)/../../../scst/src/Module.symvers \ + $(src)/../../kernel/Module.symvers \ $(shell for d in /usr/src/ofa_kernel/default/Module.symvers; do\ [ -e $$d ] || continue; echo $$d; break; done) ccflags-y += -I$(src)/../../include -I$(src)/../../../scst/include