How to use multiple versions of GCC

后端 未结 5 1082
谎友^
谎友^ 2020-12-01 04:09

We have a new application that requires glibc 2.4 (from gcc 4.1). The machine we have runs on has gcc 3.4.6. We can not upgrade, and the application must be run on this ma

5条回答
  •  一整个雨季
    2020-12-01 05:02

    You possibly still execute the old gcc. Try making a symlink from gcc to your version of it, like

    ln -s gcc-4.1 gcc
    

    Beware of not removing an old "gcc" binary placed there, in case they placed not just a symlink. If you can recompile your own gcc version, the safest is just use another prefix at configure time of gcc, something like --prefix=/home/jojo/usr/gcc (i did it that way with gcc-4.4 from svn-trunk, and it worked great).

    Note that that just runs the right gcc version. If you update your gcc, your glibc won't be updated automatically too. It's a separate package which is deeply coupled with the rest of the system. Be careful when installing another glibc version.

提交回复
热议问题