building gcc 4.0.2 with gcc 4.6.3: version `GCC_4.2.0' not found
Ilya Basin
basinilya@gmail.com
Sun Sep 2 13:10:00 GMT 2012
ILT> On Tue, Aug 28, 2012 at 10:30 AM, Ilya Basin <basinilya@gmail.com> wrote:
>> Hi list! I can't build older gcc on archlinux 64.
>>
>> I want to build gcc with bounds checking patches. Bu first I want to
>> test the build without the patches.
>>
>> $ ~/gcc-4.0.2/configure --disable-multilib
>> $ make BOOT_CFLAGS="-O2" STAGE1_CFLAGS="-O2" CFLAGS="-O2" bootstrap
>> ...
>> checking for C compiler default output file name... configure: error: C compiler cannot create executables
>> See `config.log' for more details.
>> make[1]: *** [configure-fixincludes] Error 1
>>
>> $ less fixincludes/config.log
>> configure:1782: gcc -O2 conftest.c >&5
>> /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/cc1: /home/il/build_4.0.2_dir/gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)
ILT> Somehow when your existing 4.6.3 GCC runs the dynamic linker is
ILT> picking up your newly built libgcc_s.so.1. That fails, because your
ILT> system libstdc++.so.6 requires a version of libgcc_s.so.1 newer than
ILT> the one in 4.0.2.
ILT> It is strange that your existing 4.6.3 GCC is dynamically linked
ILT> against libstdc++.so.6. That does not normally happen. Normally when
ILT> GCC is built using a C++ compiler it links statically against
ILT> libstdc++.a.
ILT> Anyhow, I think this is happening because the top level Makefile is
ILT> setting LD_LIBRARY_PATH. And I think in GCC 4.0.2 that happens by
ILT> default, but you can turn it off by using --disable-shared when you
ILT> run configure. So unless you badly need the GCC 4.0.2 dynamic
ILT> libraries for some reason, I recommend using --disable-shared.
ILT> Otherwise hack the top level Makefile.in to stop it from setting
ILT> LD_LIBRARY_PATH. In that file it's known as RPATH_ENVVAR.
ILT> Ian
Hi Ian, thanks for advice.
CC="env -u LD_LIBRARY_PATH cc" ./configure
solved the problem.
--
More information about the Gcc-help
mailing list