From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6F903158086 for ; Sat, 1 Jan 2022 17:28:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7CFEB2BC026; Sat, 1 Jan 2022 17:28:23 +0000 (UTC) Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1DB1E2BC01C for ; Sat, 1 Jan 2022 17:28:21 +0000 (UTC) Received: from [192.168.9.172] (unknown [101.88.31.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 93C51600FF for ; Sun, 2 Jan 2022 01:28:16 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=xen0n.name; s=mail; t=1641058096; bh=2yB3NLp+N36Ylsk0J/iOhGdkQ5a5u3RzY/xtru+pqMs=; h=Date:To:From:Subject:From; b=vOWt8hzPthl1Kxn6pLnjIYonk3lqZ2JEr/tyJjj2Onp2QaHr6DNwHgD3fdQhH9B4c a7VisKSfNA96iZGV06ycO8gTlmRc6yuyZ5sOz08LmyH0YDSLl9kpXbwjABHxipo2WL aZrAu5NUuLSK+k24soSbFHtuUXIk7w9XeH8LKVms= Message-ID: Date: Sun, 2 Jan 2022 01:28:16 +0800 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:97.0) Gecko/20100101 Thunderbird/97.0a1 Content-Language: en-US To: gentoo-dev@lists.gentoo.org From: WANG Xuerui Subject: [gentoo-dev] Progress of the Gentoo/LoongArch port, and question on upstreaming procedure Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Archives-Salt: 5dc88952-8334-4c02-a9e6-637ae122f872 X-Archives-Hash: 3796cac970142666cf24832ae5476ff7 Hi everyone, I'm the guy who previously announced the Gentoo/LoongArch port [1]; since that post, some nice progress has been made, and here's a heads-up and a procedural question regarding how to continue work upstream. ## Progress of the port After some minimal forking and tweaking, it's already possible to build working stage3 tarballs with catalyst; with quick-and-dirty catalyst[2] and genkernel[3] patches, even working installation CDs can be built (confirmed by LiveUSB-making and booting on real 3A5000 hardware). The built stages and installation CD images are already available in several mirrors like [4] or [5]. The toolchain development of Loongson has gone more-or-less quiet lately, and many projects (eselect, icu, systemd, etc.) have already had releases that contain LoongArch bring-up changes, so it's time to push more things upstream (in this case, the main gentoo.git repo). ## How to test this? The necessary changes are all brewing in the loongson-overlay[6], which is available via layman (`sudo layman -a loongson`). You'll need this for the loong profile and toolchain patches. The stages can be tested with QEMU linux-user emulation, if you don't have the LoongArch hardware; but the LoongArch target is not upstream yet, so you'll have to compile Loongson's fork ([7]; qemu-devel threads [8] [9]) yourself. The necessary binfmt-misc declaration is like this (remove all whitespaces and newlines before using): > :loongarch64:M:: > \x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02\x01: > \xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff > \xff\xff:/usr/local/bin/qemu-loongarch64: You can use your favorite way to set up this (manually, via rc-scripts, via systemd-binfmt.service, whatever), replacing the interpreter path to suit your setup, then just proceed like every chroot. Inside the chroot, you need to `git clone` the loongson-overlay, add it to /etc/portage/repos.conf, and fix the profile symlink; after that you should be able to emerge packages as usual. Keywords are mostly missing, so you may use ACCEPT_KEYWORDS=~riscv or something similar to get through, in case everything is masked and not package.accept_keywords-ed. Note that their system emulation is currently in a worse state than linux-user (horribly slow and dependent on prebuilt firmware blob), according to review comments, so you may as well ignore the installation CDs for now. ## Problem regarding further upstream work As described above, there is already some nice progress, but a procedural problem still remains: every new architecture needs a backing project and arch team [10], yet I'm not a Gentoo dev and it's unclear if any Gentoo dev would be interested in such a niche architecture with limited hardware availability outside China, so we may get stuck in this state for an extended period. Any suggestion is welcome; and thank you for your attention. Regards, WANG "xen0n" Xuerui [1]: https://archives.gentoo.org/gentoo-dev/message/ef0b1812e9b66cdf5978ecc2ad4eda4e [2]: https://github.com/xen0n/catalyst/tree/3.0.20-for-loong [3]: https://github.com/xen0n/genkernel/tree/loong [4]: https://mirrors.tuna.tsinghua.edu.cn/loongson/gentoo/experimental/ [5]: https://mirrors.bfsu.edu.cn/loongson/gentoo/experimental/ [6]: https://github.com/xen0n/loongson-overlay [7]: https://github.com/loongson/qemu/tree/tcg-dev [8]: https://patchew.org/QEMU/1638610165-15036-1-git-send-email-gaosong@loongson.cn/ [9]: https://patchew.org/QEMU/1638619645-11283-1-git-send-email-yangxiaojuan@loongson.cn/ [10]: https://projects.gentoo.org/council/meeting-logs/20180114-summary.txt