From: NIIBE Y. <gn...@m1...> - 2001-09-20 00:11:36
|
Stuart Menefy wrote: > I've been looking at the compiler you used to build the debian > environment, and am rather confused (not that that is hard, I must > admit). > > It appears to build the kernel using gcc 3.0.1, but then later in the > build replaces it with gcc 3.0 + a massive patch to build everything else. > > I thought from the posting a couple of days ago 3.0.1 was now ready > for use, or are there still problems? No problem. (It's Debian specific issue.) There's three builds of GCC in the bootstrap. (1) Initial cross GCC with static libgcc. (2) cross GCC with shared libgcc. (3) native GCC. For (1) and (2), I use my own package (gcc-sh-linux). For (3) I took the package from Debian pool and added SuperH specific patch. Yes, (3) includes massive patches which Debian guy has done, but I don't rely on them. The initial compiler #1 is replaced by compiler #2. Note that the source code base is same for #1 and #2. The difference is configure process and required library. To build #2 compiler, we need C library. To build C library, we need a compiler, that's #1 compiler. Then, (only) shared libgcc is replaced by the one of #3. Note that cross compiler is not replaced. This is needed for Debian because of package dependency. Package which depends on shared libgcc should have package dependency to the package "libgcc1", not to the cross compiler package. * * * Here's the steps I've done. 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, we don't need those two. However, we need it for now because 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: Prepare kernel headers. Step 1.3: Build and install glibc. Step 1.4: 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.5: Build native compiler with cross compiler. We get working (shared) libgcc package in this build. Remove libgcc of 1.4, install libgcc. Step 2.0: Build and install libraries. Step 2.1: Build and install libraries (which depends 2.0). pam, procps, and readline. 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 5.0: With native system, build the package perl, libnet-perl, expect, and dejagnu. (Those packages cannot be build on cross environment easily.) 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. -- |