On 11/22/21 11:42 AM, WANG Xuerui wrote:
Normally this would be based on qemu/debian10 or qemu/ubuntu2004, but after a week-long struggle, I still cannot build stage2 gcc with the known-good LoongArch toolchain sources, so I chose the least-resistance path with Gentoo as base image. As this image is not expected to be re-built by CI, like hexagon, it should not take much maintenance effort; also it's expected to be replaced as soon as Debian is available.
That seems fine. I'm familiar with gentoo (only remaining distro for alpha), and it's a good way to bootstrap a new system.
+docker-image-gentoo-loongarch64-cross: $(DOCKER_FILES_DIR)/gentoo-loongarch64-cross.docker + $(if $(NOCACHE), \ + $(call quiet-command, \ + $(DOCKER_SCRIPT) build -t qemu/gentoo-loongarch64-cross -f $< \ + $(if $V,,--quiet) --no-cache \ + --registry $(DOCKER_REGISTRY) --extra-files \ + $(DOCKER_FILES_DIR)/gentoo-loongarch64-cross.docker.d/build-toolchain.sh, \ + "BUILD", "gentoo-loongarch64-cross"), \ + $(call quiet-command, \ + $(DOCKER_SCRIPT) fetch $(if $V,,--quiet) \ + qemu/gentoo-loongarch64-cross $(DOCKER_REGISTRY), \ + "FETCH", "gentoo-loongarch64-cross") \ + $(call quiet-command, \ + $(DOCKER_SCRIPT) update $(if $V,,--quiet) \ + qemu/gentoo-loongarch64-cross --add-current-user, \ + "PREPARE", "gentoo-loongarch64-cross")) + + debian-toolchain-run = \ $(if $(NOCACHE), \ $(call quiet-command, \
Note the addition of debian-toolchain-run, handling the boilerplate for this for microblaze and nios2.
(I haven't converted hexagon to this, because I had expected to be able to replace that with a pre-built toolchain. But then the compiler turned out to be buggy, and that patch got dropped. I hope we can revisit this during 7.0.)
+FROM gentoo/stage3:20211116
If I understand correctly, this should be the fully qualified name: docker.io/library/etc. Alex? Phil?
+"$CROSS_EMERGE" -1 --onlydeps -j4 gawk
...
+"$CROSS_EMERGE" -1 --onlydeps -j4 qemu
Why the quotes on CROSS_EMERGE? Use $J, which you computed earlier. All minor nits, as it Worked For Me. Thanks for putting this together. r~