RHEL 5.5 Upgrade gcc from 4.1.2 to gcc 4.4

Latest response

I am working on a legacy RHEL 5.5 embedded system, and in order to link with a third party library I need to upgrade compiler to gcc 4.4.

Yum tells me the packages are available

root$ yum list all | grep gcc
gcc.x86_64                                4.1.2-50.el5            installed
gcc-c++.x86_64                            4.1.2-50.el5            installed
gcc44.x86_64                              4.4.7-11.el5_11         installed
libgcc.i386                               4.1.2-50.el5            installed
libgcc.x86_64                             4.1.2-50.el5            installed
gcc.x86_64                                4.1.2-55.el5            res5-x86_64
gcc-c++.x86_64                            4.1.2-55.el5            res5-x86_64
gcc-debuginfo.i386                        4.1.2-55.el5            res5-x86_64
gcc-debuginfo.x86_64                      4.1.2-55.el5            res5-x86_64
gcc-gfortran.x86_64                       4.1.2-55.el5            res5-x86_64
gcc-gnat.x86_64                           4.1.2-55.el5            res5-x86_64
gcc-java.x86_64                           4.1.2-55.el5            res5-x86_64
gcc-libraries-debuginfo.i386              4.8.0-5.1.1.el5         res5-x86_64
gcc-libraries-debuginfo.x86_64            4.8.0-5.1.1.el5         res5-x86_64
gcc-objc.x86_64                           4.1.2-55.el5            res5-x86_64
gcc-objc++.x86_64                         4.1.2-55.el5            res5-x86_64
gcc43.x86_64                              4.3.2-7.nv5.3           res5-x86_64
gcc43-c++.x86_64                          4.3.2-7.nv5.3           res5-x86_64
gcc43-gfortran.x86_64                     4.3.2-7.nv5.3           res5-x86_64
gcc44-c++.x86_64                          4.4.7-11.el5_11         res5-x86_64
gcc44-debuginfo.i386                      4.4.7-11.el5_11         res5-x86_64
gcc44-debuginfo.x86_64                    4.4.7-11.el5_11         res5-x86_64
gcc44-gfortran.x86_64                     4.4.7-11.el5_11         res5-x86_64
libgcc.i386                               4.1.2-55.el5            res5-x86_64
libgcc.x86_64                             4.1.2-55.el5            res5-x86_64

And so I installed them

root$ yum install gcc44.x86_64 gcc44-c++.x86_6

but my gcc version is still 4.1.2

root$ gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-50)

What did I miss?

Responses

Try rpm -ql gcc44 and see where the binary is.

It's likely this package doesn't override the gcc in PATH so you have to call it directly, or use it explicitly in Makefiles with the $(CC) variable.

That's a good thing, because overriding the default compiler may break anything else which is depending on known gcc 4.1.2 behaviour.

Jamie, you are right... it was a separate install.

which gcc44

/usr/bin/gcc44

Jamie, You wrote 'overriding the default compiler may break anything else which is depending on known gcc 4.1.2 behaviour' and I'd like to understand that. I know that replacing libc is a bad idea (http://www.linuxquestions.org/questions/linux-software-2/upgrade-redhat5-from-glibc-2-5-to-glibc-2-7-a-883641/) but how can a compiler change break things?

But back to my current efforts.... In addition to gcc I was expecting newer libc and libstdc++ libraries as well but I was disappointed.

What I propose to do is install newer versions of libc and libstdc++, change LD_LIBRARY_PATH so the executable will find them first and then execute the program. Can this possibly work?

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.