gcc-4.7.2 was released 3 days ago on September 20th. It won't have made it into the debian repos yet (See update2, thanks derobert).
According to the release notes it is a bug-fixing release so will probably use the same library versions as the previous, 4.7.1, release. So, since 4.7.1 is in the repos, install it to get all the dependencies sorted, then if you really really need the latest version, download the source and compile following the instructions from the gcc website.
UPDATE:
You seem to have a problem with your source.lst. As a workaround, try downloading the package here and installing using dkpg -i gcc_4.7.1-1_amd64.deb
.
UPDATE 2:
As @derobert points out below, 4.7.2 is indeed in the experimental repo. So, adapt the instructions from the post you linked to:
Your /etc/apt/sources.list
should look something like this:
deb local.debian.mirror squeeze main
deb local.debian.mirror unstable main
while your /etc/apt/preferences
should look something like this:
Package: *
Pin: release n=squeeze
Pin-Priority: 900
Package: *
Pin: release n=unstable
Pin-Priority: 200
Then install using apt-get install gcc-4.7/unstable
.
As both jordanm and the original tutorial you linked to mention, this is not a very good idea. Make sure to point your sources back to stable once you're finished.
I made it :-)
I basically followed Gilles's advice and decided to do it properly: i.e. manage a complete cross-compilation of GLIBC. I started from crosstool-ng, and was initially disappointed - seeing that it didn't support my old kernel. I kept at it, though - manually editing the configuration file saved by crosstool-ng to do changes like these on the default arm-gnueabi build configuration:
$ ct-ng arm-unknown-linux-gnueabi
$ ct-ng menuconfig
...
$ vi .config
$ cat .config
...
CT_KERNEL_VERSION="2.6.17"
CT_KERNEL_V_2_6_17=y
CT_LIBC_VERSION="2.13"
CT_LIBC_GLIBC_V_2_13=y
CT_LIBC_GLIBC_MIN_KERNEL_VERSION="2.6.9"
CT_LIBC_GLIBC_MIN_KERNEL="2.6.9
...
$ ct-ng +libc
After numerous tests and failed attempts, the above changes did it - I got a compiled version of GLIBC that would work with my kernel, and copied the resulting files to my Debian Lenny ARM machine:
$ cd .build/arm-unknown-linux-gnueabi/build/build-libc-final/
$ tar zcpf newlibc.tgz $(find . -type f -iname \*.so)
$ scp newlibc.tgz root@mybook:.
I went all the way and moved past squeeze: I debootstrapped a /wheezy and then - very carefully - overwrote the GLIBC versions of the armel-debootstrapped /wheezy
with my own:
# # In the ARM machine
# cd /wheezy/lib/arm-linux-gnueabi/
# mv /var/tmp/ohMyGod/libc.so libc-2.13.so
# mv /var/tmp/ohMyGod/rt/librt.so librt-2.13.so
...
...etc, making sure I didn't miss any shared libraries.
Finally, I copied over the ldd
and ldconfig
binaries (which were also part of GLIBC), and chrooted inside my /wheezy.
It worked.
I can only assume that the compilation of GLIBC from a chroot-ed 'qemu-arm' emulation inside a x86, somehow messed things up - maybe the configure
process detects some stuff from the running environment - whereas the cross-compilation can't be misled.
So naturally I moved to the next step, and used a busybox-static shell to replace the {/bin,/sbin,...} folders of my old lenny with the wheezy ones - and rebooted into my brand new Wheezy :-)
I hereby claim that my WD MyBook World Edition is the only one on the planet running Debian Wheezy :-) If anyone else is interested, I can upload a tarball of the libc files someplace.
Best Answer
Emdebian repositories are recommended to be used in
stable
most of the time since there could be utilities not built in the repositories, packages that were pulled back, etc. If you want to ensure that all your libraries have the correct dependencies, I would suggeststable
ortesting
since they are less likely to have some dependency problem or have something that got borked.