Bootstrapping Debian GNU/Linux distribution on SuperH
As I've found that the kernel is reasonably stable, for these weeks,
I've been working bootstrapping Debian GNU/Linux on SuperH.
I've followed Takeshi Yaegashi's work of April, and try to formalize
the procedure of building Debian from scratch by cross compiling. My
goal is to build the environment where it can build Debian by itself
natively, for all possible SuperH targets, sh3, sh4, sh3b and sh4eb.
I'd like to share my experience with those who work for Debian.
Prerequisite: You have Debian GNU/Linux, i386-linux. You have
development environment on that. Note that you need
Build and install dpkg (modified to support all SuperH targets),
dpkg-cross (modified to support all SuperH targets).
I need the modification because it doesn't support all SuperH targets.
Besides, SuperH development environment is somewhat special. GCC for
sh-linux is multilibbed environment and supports all of targets, i.e.,
sh3-linux, sh4-linux, sh3eb-linux, and sh4eb-linux.
Build and install binutils-sh-linux which supports sh-linux (all of
SuperH target), optionally build and install gdb-sh-linux.
Ideally, this two doesn't need. However we need it for now
We have a local patches not integrated into mainline binutils
We need special setting to support all of
sh3-linux, sh4-linux, sh3eb-linux, and sh4eb-linux
with sh-linux target.
Build and install initail gcc for sh-linux. As we don't have working
glibc at this point, we only could build gcc with static libgcc.
Build and install glibc.
Build and install cross compiler, gcc-sh-linux. (We need this special
package for now, which shoud be integrated to standard gcc package.)
Build native compiler with cross compiler. We get working (shared)
libgcc package in this build. Install libgcc.
Build and install libraries.
Build and install libraries (which depends 2.0). pam, procps, and
Build basic packages.
Build basic packages for Debian.
Build development packages.
Build development packages for Debian.
Build optional packages. gdb, groff and ntp...
With native system, build perl.
With native system, build the package perl, libnet-perl, expect, and
dejagnu. (Those packages cannot be build on cross environment.)
So far, I've done step 0 to step 3.4 for all SuperH targets. I've
done Step 4.0 only on sh4, and I'm on the Step 4.1 (only for sh4). It
takes more than four hours to build perl package natively, you know,
perl package in Debian has perl-shared, perl-static, and
Step 4.0 is a kind of black magic. Well, I've heard that the cross
compilation is planned in 5.7 of perl. If we could cross compile
perl, we can bootstrap cleanly.