[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bootstrapping Debian GNU/Linux distribution on SuperH

Hi there, 

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
binutils-multiarch installed.

Step 0:
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.

Step 1.0:
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
	and gdb
	We need special setting to support all of
	  sh3-linux, sh4-linux, sh3eb-linux, and sh4eb-linux
	with sh-linux target.

Step 1.1:
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.

Step 1.2:
Build and install glibc.

Step 1.3:
Build and install cross compiler, gcc-sh-linux.  (We need this special
package for now, which shoud be integrated to standard gcc package.)

Step 1.4:
Build native compiler with cross compiler.  We get working (shared)
libgcc package in this build.  Install libgcc.

Step 2.0:
Build and install libraries.

Step 2.1:
Build and install libraries (which depends 2.0).  pam, procps, and

Step 3.0:
Build basic packages.

Step 3.1:
Build basic packages for Debian.

Step 3.2:
Build development packages.

Step 3.3:
Build development packages for Debian.

Step 3.4:
Build optional packages.  gdb, groff and ntp...

Step 4.0:
With native system, build perl.

Step 4.1:
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.

Reply to: