From 52ee6089f53b93f5e699a21657613982a31a88b4 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 18 Jul 2020 23:59:34 +0000 Subject: [PATCH 1/2] Document how to cross-compile SCST git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9051 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- README.cross-compilation | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 README.cross-compilation diff --git a/README.cross-compilation b/README.cross-compilation new file mode 100644 index 000000000..9e6e4ca0f --- /dev/null +++ b/README.cross-compilation @@ -0,0 +1,24 @@ +Cross-compilation is the process of compiling code for one architecture (often +called the target) on a different system, usually called the host. +Cross-compilation of SCST is possible as follows: +1. Download the Linux kernel source code and also the SCST source code. +2. Install the appropriate cross-compiler, e.g. as follows: + + zypper install cross-arm-gcc9 + +3. Store the cross-compilation prefix and architecture names in the + CROSS_COMPILE and ARCH environment variables, e.g. as follows: + + export CROSS_COMPILE=/usr/bin/arm-suse-linux-gnueabi- + export ARCH=arm + +4. Build the Linux kernel. + + cd $HOME/software/linux-kernel + make + +5. Cross-compile SCST using any of the supported build methods. An example: + + export KDIR=$HOME/software/linux-kernel + cd scst.git + make rpm From cf909e3e1625bd5b246e4f35f2e41e66c00e71eb Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 19 Jul 2020 00:00:49 +0000 Subject: [PATCH 2/2] Makefiles: If both KDIR and KVER have been set, preserve KDIR git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9052 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- fcst/Makefile | 4 +++- iscsi-scst/Makefile | 4 +++- qla2x00t-32gbit/Makefile | 4 +++- qla2x00t-32gbit/qla2x00-target/Makefile | 4 +++- qla2x00t/Makefile | 4 +++- qla2x00t/qla2x00-target/Makefile | 4 +++- scst/src/Makefile | 4 +++- scst/src/dev_handlers/Makefile | 4 +++- scst_local/Makefile | 4 +++- srpt/Makefile | 4 +++- 10 files changed, 30 insertions(+), 10 deletions(-) diff --git a/fcst/Makefile b/fcst/Makefile index ac6e640d4..ab7a71f4d 100644 --- a/fcst/Makefile +++ b/fcst/Makefile @@ -46,7 +46,9 @@ ifeq ($(KVER),) make -s -C $(KDIR) kernelversion)) endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile index 6c488c141..9302197ba 100644 --- a/iscsi-scst/Makefile +++ b/iscsi-scst/Makefile @@ -34,7 +34,9 @@ ifeq ($(KVER),) endif endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/qla2x00t-32gbit/Makefile b/qla2x00t-32gbit/Makefile index 2cc88c31f..dd4f889cc 100644 --- a/qla2x00t-32gbit/Makefile +++ b/qla2x00t-32gbit/Makefile @@ -35,7 +35,9 @@ ifeq ($(KVER),) make -s -C $(KDIR) kernelversion)) endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/qla2x00t-32gbit/qla2x00-target/Makefile b/qla2x00t-32gbit/qla2x00-target/Makefile index 94598660a..e541e9da3 100644 --- a/qla2x00t-32gbit/qla2x00-target/Makefile +++ b/qla2x00t-32gbit/qla2x00-target/Makefile @@ -44,7 +44,9 @@ ifeq ($(KVER),) endif endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/qla2x00t/Makefile b/qla2x00t/Makefile index 0dce532fa..ce1ba74c6 100644 --- a/qla2x00t/Makefile +++ b/qla2x00t/Makefile @@ -34,7 +34,9 @@ ifeq ($(KVER),) make -s -C $(KDIR) kernelversion)) endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/qla2x00t/qla2x00-target/Makefile b/qla2x00t/qla2x00-target/Makefile index d6f3f0888..89c239c25 100644 --- a/qla2x00t/qla2x00-target/Makefile +++ b/qla2x00t/qla2x00-target/Makefile @@ -43,7 +43,9 @@ ifeq ($(KVER),) endif endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/scst/src/Makefile b/scst/src/Makefile index 240a6061d..d611cb71f 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -45,7 +45,9 @@ ifeq ($(KVER),) make -s -C $(KDIR) kernelversion)) endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/scst/src/dev_handlers/Makefile b/scst/src/dev_handlers/Makefile index bddc1a87f..f6c2242ab 100644 --- a/scst/src/dev_handlers/Makefile +++ b/scst/src/dev_handlers/Makefile @@ -39,7 +39,9 @@ ifeq ($(KVER),) make -s -C $(KDIR) kernelversion)) endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/scst_local/Makefile b/scst_local/Makefile index 5dba991dc..22273223a 100644 --- a/scst_local/Makefile +++ b/scst_local/Makefile @@ -20,7 +20,9 @@ ifeq ($(KVER),) make -s -C $(KDIR) kernelversion)) endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/srpt/Makefile b/srpt/Makefile index d96d6df9b..1d2da90c1 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -22,7 +22,9 @@ ifeq ($(KVER),) endif endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),)