Lines Matching +full:build +full:- +full:tools +full:- +full:and +full:- +full:docs +full:- +full:debian
12 2. One-time setup
15 The following is required to build and run the test suite:
18 * s390 development headers and libraries
23 Debian supports installing compiler and libraries for s390 out of the box.
24 Users of other distros may use debootstrap in order to set up a Debian chroot::
27 --variant=minbase \
28 --include=sudo \
30 ./s390-toolchain
31 sudo mount --rbind /dev ./s390-toolchain/dev
32 sudo mount --rbind /proc ./s390-toolchain/proc
33 sudo mount --rbind /sys ./s390-toolchain/sys
34 sudo chroot ./s390-toolchain
36 Once on Debian, the build prerequisites can be installed as follows::
38 sudo dpkg --add-architecture s390x
39 sudo apt-get update
40 sudo apt-get install \
49 g++-s390x-linux-gnu \
50 gcc-s390x-linux-gnu \
51 gdb-multiarch \
55 qemu-system-misc \
56 qemu-utils \
58 libcap-dev:s390x \
59 libelf-dev:s390x \
60 libncurses-dev
64 git clone https://github.com/llvm/llvm-project.git
65 ln -s ../../clang llvm-project/llvm/tools/
66 mkdir llvm-project-build
67 cd llvm-project-build
69 -DLLVM_TARGETS_TO_BUILD=BPF \
70 -DCMAKE_BUILD_TYPE=Release \
71 -DCMAKE_INSTALL_PREFIX=/opt/clang-bpf \
72 ../llvm-project/llvm
75 export PATH=/opt/clang-bpf/bin:$PATH
77 The disk image can be prepared using a loopback mount and debootstrap::
79 qemu-img create -f raw ./s390.img 1G
80 sudo losetup -f ./s390.img
85 --foreign \
86 --arch=s390x \
87 --variant=minbase \
88 --include=" \
90 iputils-ping, \
91 isc-dhcp-client, \
100 sudo losetup -d /dev/loopX
116 Compiling kernel, modules and testsuite, as well as preparing gdb scripts to
119 make ARCH=s390 CROSS_COMPILE=s390x-linux-gnu- menuconfig
120 make ARCH=s390 CROSS_COMPILE=s390x-linux-gnu- bzImage modules scripts_gdb
121 make ARCH=s390 CROSS_COMPILE=s390x-linux-gnu- \
122 -C tools/testing/selftests \
124 INSTALL_PATH=$PWD/tools/testing/selftests/kselftest_install \
132 qemu-system-s390x \
133 -cpu max,zpci=on \
134 -smp 2 \
135 -m 4G \
136 -kernel linux/arch/s390/boot/compressed/vmlinux \
137 -drive file=./s390.img,if=virtio,format=raw \
138 -nographic \
139 -append 'root=/dev/vda rw console=ttyS1' \
140 -virtfs local,path=./linux,security_model=none,mount_tag=linux \
141 -object rng-random,filename=/dev/urandom,id=rng0 \
142 -device virtio-rng-ccw,rng=rng0 \
143 -netdev user,id=net0 \
144 -device virtio-net-ccw,netdev=net0
146 When using this on a real IBM Z, ``-enable-kvm`` may be added for better
150 /debootstrap/debootstrap --second-stage
152 Directory with the code built on the host as well as ``/proc`` and ``/sys``
155 mkdir -p /linux
156 mount -t 9p linux /linux
157 mount -t proc proc /proc
158 mount -t sysfs sys /sys
162 cd /linux/tools/testing/selftests/kselftest_install
167 cd /linux/tools/testing/selftests/bpf
174 by passing ``-s`` to QEMU.
183 gdb-multiarch -ex 'target remote localhost:1234' ./vmlinux
199 - `Debootstrap <https://wiki.debian.org/EmDebian/CrossDebootstrap>`_
200 - `Multiarch <https://wiki.debian.org/Multiarch/HOWTO>`_
201 - `Building LLVM <https://llvm.org/docs/CMake.html>`_
202 - `Cross-compiling the kernel <https://wiki.gentoo.org/wiki/Embedded_Handbook/General/Cross-compili…
203 - `QEMU s390x Guest Support <https://wiki.qemu.org/Documentation/Platforms/S390X>`_
204 - `Plan 9 folder sharing over Virtio <https://wiki.qemu.org/Documentation/9psetup>`_
205 - `Using GDB with QEMU <https://wiki.osdev.org/Kernel_Debugging#Use_GDB_with_QEMU>`_