As promised, a README.cross file for gcc-2.95.


dave...

Good news, the gcc-2.95 source package will build cross-compilers
out of the box.

It should be able to build cross-compilers for any debian
architecture as a target, although you may find it difficult to
fulfill the dependencies for every target.

- Install the following packages (additional Build-Depends:) before
  continuing:

    dpkg-cross
    binutils-multiarch
    binutils-${target}

  binutils-${target} is only in sid, and only for powerpc, m68k,
  arm, and avr.  If you are building for some other target, you'll
  need to find a cross binutils some other way, i.e., by fixing
  the binutils package.

- Download (by hand, probably) the binary packages
  libc6_*_${target}.deb and libc6-dev_*_${target}.deb.
  
- dpkg-cross is a cool utility that mangles library and lib-dev
  packages to be cross development packages.  The install path
  is changed (e.g.) from /usr/lib to /usr/${target}-linux/lib,
  so you don't affect the native installation.  Run the command

    dpkg-cross -a ${target} -b libc_*_${target}.deb
    dpkg-cross -a ${target} -b libc-dev_*_${target}.deb

  This will create libc-${target}-cross_*_all.deb and
  libc-dev-${target}-cross_*_all.deb.  (Note that they are now
  architecture independent.)  Look at the packge contents,
  in order to marvel at the coolness of dpkg-cross and/or to
  verify that it worked:

    dpkg-deb -C libc-${target}-cross_*_all.deb

  Of course, you can do this for other development packages that
  you want to install later.

- Install the cross-libc packages created in the last step.  The
  gcc build process needs these to build libgcc2 and libg++.

- Create the directory /usr/lib/gcc-lib/${target}-linux/2.95.3.
  This is to overcome a buglet in the current build.  Fix the version
  number if it has changed.

- Edit the file gcc-2.95-*/debian/rules.defs where it defines
  TARGETS.  Change this to 'TARGETS = ${target}'.

- In order to speed up the build process, disable the regression
  tests.  Search for 'with_check := disabled by hand' in
  gcc-2.95-*/debian/rules.defs and uncomment it.

- In order to speed up the build process, disable building of the
  Pascal compiler if you don't need it.  Search for 'with_pascal
  := disabled by hand' in gcc-2.95-*/debian/rules.defs and uncomment
  it.

- The build process for some target architectures don't create the
  file SYSCALLS.c.X.  The reason for this is lost in the code, but
  it will probably be fixed eventually.  Until then, try applying
  this patch:

diff -urN debian/rules2 debian.new/rules2
--- debian/rules2       Thu Mar 29 20:33:48 2001
+++ debian.new/rules2   Thu Mar 29 20:13:08 2001
@@ -524,11 +524,11 @@
     files_gcc += $(gcc_lib_dir)/soft-float/{libgcc.a,*.o}
 endif
 endif
-#files_gcc += \
-#      $(shell test -e $(d)/$(gcc_lib_dir)/SYSCALLS.c.X \
-#              && echo $(gcc_lib_dir)/SYSCALLS.c.X)
 files_gcc += \
-       $(gcc_lib_dir)/SYSCALLS.c.X
+       $(shell test -e $(d)/$(gcc_lib_dir)/SYSCALLS.c.X \
+               && echo $(gcc_lib_dir)/SYSCALLS.c.X)
+#files_gcc += \
+#      $(gcc_lib_dir)/SYSCALLS.c.X
 ifneq (,$(findstring gcc,$(MULTILIBS)))
     dirs_gcc += $(gcc_lib_dir)/$(MULTIDIRS)
     files_gcc += $(gcc_lib_dir)/$(MULTIDIRS)/{libgcc.a,*.o}


- Build using 'dpkg-buildpackage -rfakeroot'.  This will take a _long_
  time, as it builds a bootstrap native compiler first, and also
  builds the native packages.


Please send any comments/corrections to this document to David
Schleef <[EMAIL PROTECTED]>.

Reply via email to