GCC 4.5.0 introduces a new dependency, the MPC library, which isn't covered by the tutorial yet. But that isn't my problem.
It seems that the tutorial only works when you use /usr/local as the prefix.
During the configure step for GCC, you state --with-gmp=..., --with-mpfr=... and --with-mpc=..., which allows the build process to find the headers and linker libraries. Unfortunately the search path for the libraries does not get coded into the resulting executables:
Code: Select all
/usr/src/build-gcc/gcc $ ldd cc1
linux-gate.so.1 => (0xb804e000)
libmpc.so.2 => not found
libmpfr.so.1 => /usr/lib/libmpfr.so.1 (0xb7fed000)
libgmp.so.10 => not found
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7fe8000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e85000)
libgmp.so.3 => /usr/lib/libgmp.so.3 (0xb7e3e000)
/lib/ld-linux.so.2 (0xb804f000)
I really despise this kind of autoconfig stupidity.
I don't like mixing manually-installed libraries with the code under control of my system package manager, and anyway by using $PREFIX our tutorial gives the impression of being independent of the actual location binaries are installed to - which obviously it is not.
And editing /etc/ld.so.conf isn't an option for people who are working as non-root on shared systems.
I'd really like to file this as a bug in GCC / Autoconfig, but I know what the answer would be.
How do we handle this in the tutorial? Hardcode /usr/local and scrap $PREFIX, recommend editing /etc/ld.so.conf (which would be tricky since distros differ in this regard), or something else? (Please nobody recommend setting LD_LIBRARY_PATH, that's evil.)