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

Problems building gcc-4.1 from etch testing. 'debian/rules control' fails because no FFI or GFDL files in /debian



I'm trying to build a powerpc cross compiler using the Embedian guidelines for building from source. I'm working from an Etch install of Oct. 2. I've retrieved the GCC source using

apt-get source gcc-4.1

which returned the following flavor of gcc-4.1

gcc-4.1_4.1.1ds1-13

I've successfully built and installed binutils 2.17-2, but when trying to reconfigure gcc-4.1 for powerpc using

debian/rules control

I get a failure because the script can't find debian/*FFI* files. I checked the script and it appears it will also fail to find debian/*GFDL* files, since neither of these file types exist in the /debian directory. Is it possible these have been removed and the rules scripts just not updated, or am I doing something wrong? All of the other file types it is looking for at that point in the script exist in the directory (e.g. debian/*BV* files)

Here is the tail of the script where the failure occurs.

fs=`echo debian/*-BV* debian/*GCJ* debian/*CXX* debian/*LC* debian/*FFI*|sort -u`; \
   for f in $fs; do \
     [ -f $f ] || echo "CANNOT FIND $f"; \
     [ -f $f ] || continue; \
     case $f in \
     debian/libgcjGCJ.*) \
f2=$(echo $f | sed 's/BV/4.1/;s/PV/2.1/;s/CXX/6/;s/GCJ/7-0/;s/LC/1/;s/FFI/4/');; \
     *) \
f2=$(echo $f | sed 's/BV/4.1/;s/PV/2.1/;s/CXX/6/;s/GCJ/7/;s/LC/1/;s/FFI/4/'); \
     esac; \
     sed -e 's/@BV@/4.1/g' \
         -e 's/@PV@/2.1/g' \
         -e 's/@CXX@/6/g' \
         -e 's/@GCJ@/7/g' \
         -e 's/@LC@/1/g' \
         -e 's/@FFI@/4/g' \
         -e 's/@GFDL@//g' \
       $f > $f2; \
     touch -r $f $f2; \
   done
CANNOT FIND debian/*FFI*
make[1]: Leaving directory `/usr/src/cross-toolchain/gcc-4.1-4.1.1ds1'

Any help would be greatly appreciated.

Thanks,

-Jim Heck




Here are some notes I have been taking as I went along in the process of building the tool chain, as to exactly what I did.





Steps to building a cross compile tool chain in Debian

Cribbed general technique from http://psas.pdx.edu/DebianCrossCompilerHowto

**0. Starting with Etch install circa 10/02/06.

**1. Create a working directory.

This process will create many files and directories; you will want to work in a separate working directory.

--------------------
androcross:/usr/src# mkdir -p /usr/src/cross-toolchain
androcross:/usr/src# cd /usr/src/cross-toolchain
androcross:/usr/src/cross-toolchain#

**2. Get the source for binutils and GCC

In order to build a cross-compilation toolchain, you need to get the source for the Debian binutils and GCC packages. Note that you need binutils 2.16.1cvs20060413-1 or newer to build cross packages

--------------------
androcross:/etc/apt# apt-get source binutils gcc-4.1
Reading package lists... Done
Building dependency tree... Done
Need to get 62.1MB of source archives.
<snip>
dpkg-source: extracting binutils in binutils-2.17
dpkg-source: unpacking binutils_2.17.orig.tar.gz
dpkg-source: applying ./binutils_2.17-2.diff.gz
gpg: Signature made Fri 01 Sep 2006 09:54:21 AM EDT using DSA key ID 0F932C9C
gpg: Can't check signature: public key not found
dpkg-source: extracting gcc-4.1 in gcc-4.1-4.1.1ds1
dpkg-source: unpacking gcc-4.1_4.1.1ds1.orig.tar.gz
dpkg-source: applying ./gcc-4.1_4.1.1ds1-13.diff.gz
androcross:/etc/apt#

**3. Install Build Depends

GCC and binutils require several other packages in order to build; you can install all of them using "apt-get build-dep"; this will also install build-essential.

--------------------
androcross:/etc/apt# apt-get build-dep binutils gcc-4.1
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
 autoconf autoconf2.13 autogen automake1.9 autotools-dev build-essential
 chrpath debhelper dejagnu doxygen dpatch expect-tcl8.3 gawk gettext gperf
graphviz gsfonts-x11 html2text intltool-debian lib64gcc1 lib64z1 lib64z1-dev
 libc6-dev-amd64 libgmp3-dev libgmp3c2 libgmpxx4 libmpfr-dev libmpfr1
libopts25 libopts25-dev libperl5.8 libtool po-debconf realpath tcl8.3 tcl8.4
 tk8.4 zlib1g-dev
0 upgraded, 38 newly installed, 0 to remove and 0 not upgraded.
Need to get 17.6MB of archives.
After unpacking 52.1MB of additional disk space will be used.
Do you want to continue [Y/n]?
<snip>


**4. Install fakeroot and dpkg-cross

fakeroot allows you to build packages without being root.

dpkg-cross adds cross-compilation support to some of the basic Debian package tools. dpkg-cross can also convert packages designed for the target architecture into packages usable for cross-compilation to that architecture.

--------------------
androcross:/usr/src/cross-toolchain# aptitude install fakeroot
androcross:/usr/src/cross-toolchain# aptitude install dpkg-cross


**5. Unpack the source trees for binutils and gcc

--------------------
androcross:/usr/src/cross-toolchain# ls
binutils-2.17              gcc-4.1-4.1.1ds1
binutils_2.17-2.diff.gz    gcc-4.1_4.1.1ds1-13.diff.gz
binutils_2.17-2.dsc        gcc-4.1_4.1.1ds1-13.dsc
binutils_2.17.orig.tar.gz  gcc-4.1_4.1.1ds1.orig.tar.gz
androcross:/usr/src/cross-toolchain# dpkg-source -x binutils_2.17-2.dsc
gpg: Signature made Wed 26 Jul 2006 04:53:07 PM EDT using RSA key ID AB2A91F5
gpg: Can't check signature: public key not found
dpkg-source: extracting binutils in binutils-2.17
dpkg-source: unpacking binutils_2.17.orig.tar.gz
dpkg-source: applying ./binutils_2.17-2.diff.gz

androcross:/usr/src/cross-toolchain# dpkg-source -x gcc-4.1
gcc-4.1-4.1.1ds1/             gcc-4.1_4.1.1ds1-13.dsc
gcc-4.1_4.1.1ds1-13.diff.gz   gcc-4.1_4.1.1ds1.orig.tar.gz
androcross:/usr/src/cross-toolchain# dpkg-source -x gcc-4.1_4.1.1ds1-13.dsc
gpg: Signature made Fri 01 Sep 2006 09:54:21 AM EDT using DSA key ID 0F932C9C
gpg: Can't check signature: public key not found
dpkg-source: extracting gcc-4.1 in gcc-4.1-4.1.1ds1
dpkg-source: unpacking gcc-4.1_4.1.1ds1.orig.tar.gz
dpkg-source: applying ./gcc-4.1_4.1.1ds1-13.diff.gz


**6. Build binutils.

--------------------
androcross:/usr/src/cross-toolchain/binutils-2.17# TARGET=powerpc-linux-gnu fakeroot debian/rules binary-cross > ../binutils.build 2>&1 || echo 'Build error'


**7. Install binutils.

The binutils package must be installed in order to build the GCC package.

--------------------
androcross:/usr/src/cross-toolchain# dpkg -i binutils-powerpc-linux-gnu_2.17-2_i386.deb
Selecting previously deselected package binutils-powerpc-linux-gnu.
(Reading database ... 72837 files and directories currently installed.)
Unpacking binutils-powerpc-linux-gnu (from binutils-powerpc-linux-gnu_2.17-2_i386.deb) ...
Setting up binutils-powerpc-linux-gnu (2.17-2) ...


**8. Get and convert library packages

You will need cross-compilation packages for various libraries; dpkg-cross can convert native packages for the target architecture into packages usable for cross-compilation.

--------------------
androcross:/usr/src/cross-toolchain# export http_proxy="http://webcache.east:8080"; androcross:/usr/src/cross-toolchain# wget 'http://ftp.us.debian.org/debian/pool/main/g/glibc/libc6-dev_2.3.6.ds1-4_powerpc.deb' androcross:/usr/src/cross-toolchain# wget 'http://ftp.us.debian.org/debian/pool/main/g/glibc/libc6_2.3.6.ds1-4_powerpc.deb' androcross:/usr/src/cross-toolchain# wget 'http://ftp.us.debian.org/debian/pool/main/l/linux-kernel-headers/linux-kernel-headers_2.6.17.10-3_powerpc.deb'
androcross:/usr/src/cross-toolchain#
androcross:/usr/src/cross-toolchain# ls l*.deb
libc6_2.3.6.ds1-4_powerpc.deb linux-kernel-headers_2.6.17.10-3_powerpc.deb
libc6-dev_2.3.6.ds1-4_powerpc.deb
androcross:/usr/src/cross-toolchain# dpkg-cross -a powerpc -b l*.deb
Building libc6-powerpc-cross_2.3.6.ds1-4_all.deb
Building libc6-dev-powerpc-cross_2.3.6.ds1-4_all.deb
Building linux-kernel-headers-powerpc-cross_2.6.17.10-3_all.deb
androcross:/usr/src/cross-toolchain#
androcross:/usr/src/cross-toolchain# dpkg -i l*powerpc-cross*.deb
Selecting previously deselected package libc6-dev-powerpc-cross.
(Reading database ... 72883 files and directories currently installed.)
Unpacking libc6-dev-powerpc-cross (from libc6-dev-powerpc-cross_2.3.6.ds1-4_all.deb) ...
Selecting previously deselected package libc6-powerpc-cross.
Unpacking libc6-powerpc-cross (from libc6-powerpc-cross_2.3.6.ds1-4_all.deb) ...Selecting previously deselected package linux-kernel-headers-powerpc-cross. Unpacking linux-kernel-headers-powerpc-cross (from linux-kernel-headers-powerpc-cross_2.6.17.10-3_all.deb) ...
Setting up libc6-powerpc-cross (2.3.6.ds1-4) ...
Setting up linux-kernel-headers-powerpc-cross (2.6.17.10-3) ...
Setting up libc6-dev-powerpc-cross (2.3.6.ds1-4) ...


**9. Build GCC

Now that you have all the necessary prerequisites, you can build a cross-compiling GCC.

--------------------
androcross:/usr/src/cross-toolchain# cd gcc-4.1-4.1.1ds1/
androcross:/usr/src/cross-toolchain/gcc-4.1-4.1.1ds1# export GCC_TARGET=powerpc
androcross:/usr/src/cross-toolchain/gcc-4.1-4.1.1ds1# debian/rules control

STUCK



Reply to: