Find the answer to your Linux question:
Results 1 to 7 of 7
Downgrade gcc compiler -------------------------------------------------------------------------------- I have RHEL5 box installed with gcc version 4.1.2. I want to install gcc version 3.4.2 on to that. I was ablw to install gccV4.3.2, after ...
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    13

    [SOLVED] Downgrade gcc compiler

    Downgrade gcc compiler

    --------------------------------------------------------------------------------

    I have RHEL5 box installed with gcc version 4.1.2. I want to install gcc version 3.4.2 on to that.

    I was ablw to install gccV4.3.2, after removing many other packages and isntalling the older versions of the same packages.However, its not successful. I landed corrupting my glibc in the process.

    So I would like to know the formal procedure /steps to be followed for replacing my gccV4.1.2 with gccV3.4.2.

    Or, Is it possible to have two versions of gcc installed on the same machine. If yes, how can i achieve that and how do I invoke the specific version of compiler during compilation ?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    First off, don't remove the gcc 4.1.2 or, as you have found, you will fubar your system because of glibc and other dependencies. What you want to do is install gcc 3.4.2 in addition to 4.1.2 - but because you cannot do so using the normal package manager (yum or rpm), you will probably need to build from source and install into another location, and put the associated shared libraries in another lib directory, such as /usr/local/lib, or /usr/local/gcc-3.4.2/lib. Then, to build applications with the new/old compiler you will need to alter their makefiles to include the appropriate headers and link the appropriate libraries, explicitly. Finally, to run them, you will need to alter your LD_LIBRARY_PATH environment variable to search the new lib directory first before standard libraries.

    So, at last I get to the salient point - why on god's green earth do you want to do this?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jan 2009
    Posts
    13
    I am working on porting our product to RHEL5.0 from4.0. As the first step i took the code and began compiling it on RHEL5.0 that had the gcc4.1.2 Compiler. However, i get stuck with some linker errors. All the code/shared library paths, makefiles all are exact replica of what i had in our existing system(RHEL4.0 with gcc3.4.6) where it compiles without issues.

  4. #4
    Just Joined!
    Join Date
    Jan 2009
    Posts
    13
    I see that the linker error i get is not because of the normal reasons, like library not in memtioned path, header fiels missing etc...consulted with some experts too. Not able to identify the reason i get those linker erros.So finaly I decided to compile it with the previous compiler we used. There are configuration differences between the two compilers which also results in differences in the switches used(-fvisibility,etc) for compiling my code on RHEL5.0.
    Kindly suggest ways to proceed with my existing compiler4.1.2. What could i do to overcome the linker errors.

  5. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Quote Originally Posted by kk2202 View Post
    I am working on porting our product to RHEL5.0 from4.0. As the first step i took the code and began compiling it on RHEL5.0 that had the gcc4.1.2 Compiler. However, i get stuck with some linker errors. All the code/shared library paths, makefiles all are exact replica of what i had in our existing system(RHEL4.0 with gcc3.4.6) where it compiles without issues.
    Rather than downgrading your compiler, I would suggest that it is better to fix the build problems. This is not uncommon when porting to a new platform, and the move from RHEL 4 to 5 is indeed a platform port. A lot of things have changed, and using the old compiler is not going to fix your problems. You are trying to get a quick fix to a fundamental issue. Bite the bullet and deal with the differences. You will find that the experience will make the next occasion that you need to do this a LOT simpler. I spent 30 years developing software to run on multiple platforms encompassing totally different hardware and software architectures, so the entire build process that I engineered was designed to enable porting to a new platform with the minimum of hassles. That software, which controls the processes and equipment of many manufacturing enterprises all over the world, runs on every variety of Unix, as well as QNX and Windows, with 0 code changes. 10 million lines of code, and it takes only a week to port it to a new platform or version of Unix/Linux, and that includes unit test time. System level testing / QA takes longer than that, but usually doesn't reveal any issues, and those that it does reveal are generally simple enough to fix without regressing any of the other platforms.

    So, apply an engineering discipline to the problem. Learn from the experience, and incorporate it into your personal development process. Then you can call yourself a professional software developer or engineer in truth.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Quote Originally Posted by kk2202 View Post
    I see that the linker error i get is not because of the normal reasons, like library not in memtioned path, header fiels missing etc...consulted with some experts too. Not able to identify the reason i get those linker erros.So finaly I decided to compile it with the previous compiler we used. There are configuration differences between the two compilers which also results in differences in the switches used(-fvisibility,etc) for compiling my code on RHEL5.0.
    Kindly suggest ways to proceed with my existing compiler4.1.2. What could i do to overcome the linker errors.
    First, I need to see the entire make file(s), and a full listing of your compiler and linker errors. I might be able to provide some better advice with that information.

    In any case, I apologize if my last posting seems somewhat "grumpy". It's getting late on Sunday night here and I'm a bit tired. I'm sure you are trying everything you can think of to deal with this, but as I said, and I stand by that, this is a platform porting problem, and is something that you will need to learn how to deal with over time.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Just Joined!
    Join Date
    Jan 2009
    Posts
    13
    Thanks a lot for your responses. I resolved the issue. I did not downgrade the compiler. But installed the backward compatibility package compat-gcc-34-c++-3.4.6-9 and modify my make file to point to g++34 which installed with this package. And also forced the g++34 compiler to read the specs from /usr/lib/gcc/i386-redhat-linux/3.4.6/specs.

    This resolved the issue.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...