qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: peter.maydell@linaro.org
Cc: "Thomas Huth" <thuth@redhat.com>,
	richard.henderson@linaro.org, qemu-devel@nongnu.org,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Willian Rampazzo" <willianr@redhat.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: [PULL 04/21] tests/docker: Add debian-microblaze-cross image
Date: Wed,  3 Nov 2021 17:05:41 +0000	[thread overview]
Message-ID: <20211103170558.717981-5-alex.bennee@linaro.org> (raw)
In-Reply-To: <20211103170558.717981-1-alex.bennee@linaro.org>

From: Richard Henderson <richard.henderson@linaro.org>

Build the entire cross tool chain from source.
For this reason, default to caching.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
[AJB: Update MAINTAINERS]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20211014224435.2539547-7-richard.henderson@linaro.org>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20211026102234.3961636-7-alex.bennee@linaro.org>

diff --git a/MAINTAINERS b/MAINTAINERS
index e07134aa28..a4d7a6f2e5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -227,6 +227,7 @@ S: Maintained
 F: target/microblaze/
 F: hw/microblaze/
 F: disas/microblaze.c
+F: tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh
 
 MIPS TCG CPUs
 M: Philippe Mathieu-Daudé <f4bug@amsat.org>
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 24ed5c1f1d..e943ac33b0 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -167,6 +167,10 @@ debian-toolchain-run = \
 			"PREPARE", $1))
 debian-toolchain = $(call debian-toolchain-run,$(patsubst docker-image-%,%,$1))
 
+docker-image-debian-microblaze-cross: $(DOCKER_FILES_DIR)/debian-toolchain.docker \
+    $(DOCKER_FILES_DIR)/debian-microblaze-cross.d/build-toolchain.sh
+	$(call debian-toolchain, $@)
+
 docker-image-debian-nios2-cross: $(DOCKER_FILES_DIR)/debian-toolchain.docker \
     $(DOCKER_FILES_DIR)/debian-nios2-cross.d/build-toolchain.sh
 	$(call debian-toolchain, $@)
@@ -176,6 +180,7 @@ docker-image-debian-tricore-cross: docker-image-debian10
 docker-image-debian-all-test-cross: docker-image-debian10
 docker-image-debian-arm64-test-cross: docker-image-debian11
 docker-image-debian-hexagon-cross: docker-image-debian10
+docker-image-debian-microblaze-cross: docker-image-debian10
 docker-image-debian-nios2-cross: docker-image-debian10
 docker-image-debian-powerpc-test-cross: docker-image-debian11
 
@@ -185,6 +190,7 @@ DOCKER_PARTIAL_IMAGES += debian-arm64-test-cross
 DOCKER_PARTIAL_IMAGES += debian-powerpc-test-cross
 DOCKER_PARTIAL_IMAGES += debian-hppa-cross
 DOCKER_PARTIAL_IMAGES += debian-m68k-cross debian-mips64-cross
+DOCKER_PARTIAL_IMAGES += debian-microblaze-cross
 DOCKER_PARTIAL_IMAGES += debian-nios2-cross
 DOCKER_PARTIAL_IMAGES += debian-sh4-cross debian-sparc64-cross
 DOCKER_PARTIAL_IMAGES += debian-tricore-cross
diff --git a/tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh b/tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh
new file mode 100755
index 0000000000..23ec0aa9a7
--- /dev/null
+++ b/tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh
@@ -0,0 +1,88 @@
+#!/bin/bash
+
+set -e
+
+TARGET=microblaze-linux-musl
+LINUX_ARCH=microblaze
+
+J=$(expr $(nproc) / 2)
+TOOLCHAIN_INSTALL=/usr/local
+TOOLCHAIN_BIN=${TOOLCHAIN_INSTALL}/bin
+CROSS_SYSROOT=${TOOLCHAIN_INSTALL}/$TARGET/sys-root
+
+export PATH=${TOOLCHAIN_BIN}:$PATH
+
+#
+# Grab all of the source for the toolchain bootstrap.
+#
+
+wget https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.xz
+wget https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.xz
+wget https://www.musl-libc.org/releases/musl-1.2.2.tar.gz
+wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.70.tar.xz
+
+tar axf binutils-2.37.tar.xz
+tar axf gcc-11.2.0.tar.xz
+tar axf musl-1.2.2.tar.gz
+tar axf linux-5.10.70.tar.xz
+
+mv binutils-2.37 src-binu
+mv gcc-11.2.0 src-gcc
+mv musl-1.2.2 src-musl
+mv linux-5.10.70 src-linux
+
+mkdir -p bld-hdr bld-binu bld-gcc bld-musl
+mkdir -p ${CROSS_SYSROOT}/usr/include
+
+#
+# Install kernel headers
+#
+
+cd src-linux
+make headers_install ARCH=${LINUX_ARCH} INSTALL_HDR_PATH=${CROSS_SYSROOT}/usr
+cd ..
+
+#
+# Build binutils
+#
+
+cd bld-binu
+../src-binu/configure --disable-werror \
+  --prefix=${TOOLCHAIN_INSTALL} --with-sysroot --target=${TARGET}
+make -j${J}
+make install
+cd ..
+
+#
+# Build gcc, just the compiler so far.
+#
+
+cd bld-gcc
+../src-gcc/configure --disable-werror --disable-shared \
+  --prefix=${TOOLCHAIN_INSTALL} --with-sysroot --target=${TARGET} \
+  --enable-languages=c --disable-libssp --disable-libsanitizer \
+  --disable-libatomic --disable-libgomp --disable-libquadmath
+make -j${J} all-gcc
+make install-gcc
+cd ..
+
+#
+# Build musl.
+# We won't go through the extra step of building shared libraries
+# because we don't actually use them in QEMU docker testing.
+#
+
+cd bld-musl
+../src-musl/configure --prefix=/usr --host=${TARGET} --disable-shared
+make -j${j}
+make install DESTDIR=${CROSS_SYSROOT}
+cd ..
+
+#
+# Go back and build the compiler runtime
+#
+
+cd bld-gcc
+make -j${j}
+make install
+cd ..
-- 
2.30.2



  parent reply	other threads:[~2021-11-03 17:17 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03 17:05 [PULL for 6.2 00/21] testing, plugin and gdbstub updates Alex Bennée
2021-11-03 17:05 ` [PULL 01/21] tests/docker: Update debian-hexagon-cross to a newer toolchain Alex Bennée
2021-11-03 17:05 ` [PULL 02/21] gitlab-ci: Remove special casing for hexagon testing Alex Bennée
2021-11-03 17:05 ` [PULL 03/21] tests/docker: Add debian-nios2-cross image Alex Bennée
2021-11-03 17:05 ` Alex Bennée [this message]
2021-11-03 17:05 ` [PULL 05/21] tests/tcg: Enable container_cross_cc for microblaze Alex Bennée
2021-11-03 17:05 ` [PULL 06/21] tests/tcg: Fix some targets default cross compiler path Alex Bennée
2021-11-03 17:05 ` [PULL 07/21] tests/docker: split PARTIAL into PARTIAL and VIRTUAL images Alex Bennée
2021-11-03 17:05 ` [PULL 08/21] tests/tcg: enable debian-nios2-cross for test building Alex Bennée
2021-11-03 17:05 ` [PULL 09/21] ebpf: really include it only in system emulators Alex Bennée
2021-11-03 17:05 ` [PULL 10/21] plugins/cache: freed heap-allocated mutexes Alex Bennée
2021-11-03 17:05 ` [PULL 11/21] plugins/cache: implement unified L2 cache emulation Alex Bennée
2021-11-03 17:05 ` [PULL 12/21] plugins/cache: split command line arguments into name and value Alex Bennée
2021-11-03 17:05 ` [PULL 13/21] plugins/cache: make L2 emulation optional through args Alex Bennée
2021-11-03 17:05 ` [PULL 14/21] docs/tcg-plugins: add L2 arguments to cache docs Alex Bennée
2021-11-03 17:05 ` [PULL 15/21] chardev: don't exit() straight away on C-a x Alex Bennée
2021-11-03 17:05 ` [PULL 16/21] tests/plugins: extend the insn plugin to track opcode sizes Alex Bennée
2021-11-03 17:05 ` [PULL 17/21] plugins: try and make plugin_insn_append more ergonomic Alex Bennée
2021-11-03 17:05 ` [PULL 18/21] tests/tcg: remove duplicate EXTRA_RUNS Alex Bennée
2021-11-03 17:05 ` [PULL 19/21] gdbstub: Switch to the thread receiving a signal Alex Bennée
2021-11-03 17:05 ` [PULL 20/21] tests/tcg: remove debug polluting make output Alex Bennée
2021-11-03 17:05 ` [PULL 21/21] tests/vm/openbsd: Update to release 7.0 Alex Bennée
2021-11-03 17:20 ` [PULL for 6.2 00/21] testing, plugin and gdbstub updates Alex Bennée
2021-11-03 19:32   ` Taylor Simpson
2021-11-04  4:45     ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211103170558.717981-5-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=edgar.iglesias@gmail.com \
    --cc=f4bug@amsat.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    --cc=wainersm@redhat.com \
    --cc=willianr@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).