Compilation gcc 4.6.2 (cannot compute suffix of object files)

前端 未结 2 942
春和景丽
春和景丽 2021-02-19 07:51

Problem when compiling gcc 4.6.2:

checking for avr-gcc... /data/data6/soft/src_build/gcc-4.6.2/host-x86_64-unknown-linux-gnu/gcc/xgcc -B/data/data6/soft/src_buil         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-19 07:58

    "*Building GCC is not trivial, but is not difficult if you follow the instructions carefully. Many people rush into trying to build it without reading the installation docs properly and make one or more of these common mistakes:

    1) do not run ./configure from gcc src dir (this is not supported) => you need to run configure from outside the gcc source directory

    2) Note: if GCC links dynamically to the prerequisite libs (GMP/MPFR/MPC) then the shared libraries must be in the dynamic linker's path (LD_LIBRARY_PATH), both when building gcc and when using the installed compiler.*"

    Simple example (without dynamic link to GMP/MPFR/MPC):

    tar xzf gcc-4.8.0.tar.gz
    cd gcc-4.8.0
    ./contrib/download_prerequisites
    cd ..
    mkdir objdir
    cd objdir
    $PWD/../gcc-4.8.0/configure --prefix=/opt/gcc-4.8.0 
    make
    make install
    

    Sources: Advogato Doc - GNU Doc

提交回复
热议问题