[arch-ports] Easier to cross-bootstrap or bootstrap with another distro?
mail at andreasbaumann.cc
Thu Apr 29 04:57:15 UTC 2021
> Reply-To: Andreas Baumann <mail at andreasbaumann.cc>
> In-Reply-To: <BY5PR14MB3669ACC64AF81801392F1F64DA429 at BY5PR14MB3669.namprd14.prod.outlook.com>
> On Mon, Apr 26, 2021 at 09:00:04AM +0000, Sijie Bu via arch-ports wrote:
> > (This message was originally posted on arch-general and I was redirected by a member to this list.)
> > Hello,
> > I am about to start working as an intern at CIP United, a company focusing on MIPS chips, and I will be bootstrapping Arch Linux onto the MIPS64r6 architecture, in a fashion similar to Arch Linux ARM.
> > I have checked the Arch Linux MIPS project, but it seems to be inactive for years now. I have checked ArchWiki's DeveloperWiki section, but it seems to lack guidelines or suggestions on bootstrapping Arch onto a new architecture. Therefore I have a few questions:
> > - Intuitively, I think I should cross-compile the packages of the "core" section (sans a few x64-specific packages) and build a bootable rootfs, but I was having some trouble finding how should I set makepkg to cross-compile. Do I just set up an Arch developer environment as usual, but substitute the toolchain with the cross ones?
> I did a "cross-compile" from x86_64 to i486 some time ago, you can maybe
> find some useful information in https://git.archlinux32.org/bootstrap32/.
> I can also recommend the oakensource's RISC-V port at
> Basically yes, you'll need a cross toolchain for MIPS, either from the AUR
> or use a cross-platorm distro like http://t2sde.org/ to bootstrap directly
> from MIPS (in qemu or so).
> > - Does adding a new architecture require modifications to the pacman source code? Or pacman itself should support new architectures? I have also tried looking at pacman source code, and it seems to not have hard-coded list of architectures, but I am not 100% sure about this (if I'll have to modify the source code of pacman, I will be emailing the pacman-dev mailing list regarding their policies on patches etc.).
> In theory pacman should be quite portable (it runs at least on x86_64, IA32,
> ARM 32-bit, AARCH64). So the typical 32-/64-bit issues should have been
> You will have to make pacman know about your new architecture (and
> eventually subarchitectures). See our fork of pacman on
> (basically auto-detection for SSE2, support for sub-architectures
> 'i486', 'i686', 'pentium4').
> Most work I expect in breaking cycles and dependencies in PKGBUILDs.
> > Thank you for your time and have a nice day.
> > Sincerely
> > _______________________________________________
> > arch-ports mailing list
> > arch-ports at lists.archlinux.org
> > https://lists.archlinux.org/listinfo/arch-ports
> Happy porting, feel free to ask questions on IRC at #archinux-ports or #archlinux32. :-)
> Andreas Baumann
> Trottenstrasse 20
> CH-8037 Zuerich
> Telefon: +41(0)76/373 01 29
> E-mail: mail at andreasbaumann.cc
> Homepage: www.andreasbaumann.cc
On Thu, Apr 29, 2021 at 12:52:06AM +0000, Sijie Bu wrote:
> I do have a quick follow-up question. My friends who works for CIP United told me that
> they've already got a full Debian port, and it can be run with either qemu-system or
> qemu-user (unfortunately it seems actual hardware for MIPS64 R6 aren't available yet,
> probably due to the global silicon shortage). So I'm wondering will it be easier if
> I first compile pacman against Debian libraries, and use that to natively bootstrap
> a stage1 image than using cross compiler for bootstrapping?
You can in this case start right away to build a minimal Archlinux chroot
on Debian containing all essential packages (at least the C/C++ toolchain, base
packages and pacman and its dependencies). It's definitely easier to
do so, as you don't have to deal with cross-compilation issues in packages.
On the other hand running this in qemu might me unthinkable slow, without
ccache/distcc-ing the load to the native CPU, this will take forever.
> Thank you for your time and have a nice day.
Telefon: +41(0)76/373 01 29
E-mail: mail at andreasbaumann.cc
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 488 bytes
Desc: not available
More information about the arch-ports