Will app built with gcc 4.x on CentOS/RHEL 4.8 run on completely un-updated CentOS/RHEL 4? - portability

We have a commercial application that we build on 32-bit CentOS 4.8 (equivalent to Red Hat Enterprise Linux (RHEL) 4 update 8.
The default gcc compiler is at 3.4.6
We are able to run our binary on both 32- and 64-bit CentOS/RHEL 4 and 5 including completely un-updated RHEL 4.
THE QUESTION: If we update to a newer gcc 4 version, will the binary still run on a completely un-updated RHEL 4
The newest gcc appears to be 4.5.1 and 4.4.5
(And yes there are customers who install the intial version, run on an isolated network with no Internet access, and NEVER update from the as-shipped version.)
This issue has arisen because we are now porting to 64-bit FreeBSD 8.1 for amd64 and the default gcc there is gcc 4.2.1

As long as you're compiling against the same runtime libraries (like glibc) you'll be fine.

Related

Cygwin, choose between different GCC versions

I already had Cygwin installed, but I just ran the installer to get a later version of GCC.
Previously I was running GCC 4.9, I am now running 9.3. However, my code now runs approximately 20% slower.
To confirm the GCC version is the cause I would like to be able to compile it with GCC 4.9 again.
How do I do switch between using GCC 4.9 and 9.3?
you can try to install a older Cygwin with the older GCC
from the Cygwin Time Machine
http://www.crouchingtigerhiddenfruitbat.org/Cygwin/timemachine.html
I suggest you to make a parallel installation if you want to compare the results

How to install older version of GCC on Windows 10

I need to install MinGW GCC 7.3 on my computer for a project. Downloaded and installed: C:\MinGW\bin\MingGW-get.exe. But when I run it, it only gives me the option to install the latest GCC v9.2.0. How do I download and install GCC v7.3 on my computer? Step-by-step directions appreciated.
Unless you specifically want the mingw.org toolchain, check out https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/. Currently there's v8.1.0, v7.3.0, v6.4.0 and v5.4.0. Other versions are available elsewhere.
Of you need to support an older C/C++ standard the -std= compiler flag may already help (e.g. -std=c99 for ISO 1999 C or -std=c++98 for ISO 1998 C++).
Note that GCC 7.3 is not the latest version of GCC 7. The latest GCC 7 release is version 7.5.0.
You can the Windows (MinGW-w64) version from: http://winlibs.com/
The online installer tool (first option on the page) allows you to do so.
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe

How to upgrade gcc 4.7.2 in centos 6.9 to gcc 4.8

I am running centos version 6.9 and had installed gcc using command sudo yum install -y gcc gcc-c++ which installed gcc version 4.7.2. However i need to use gcc version 4.8.5. How do i upgrade gcc to the required version?
CentOS 6 does not come with GCC 4.7, so you must have installed something else.
You can upgrade to CentOS 7. This will give you GCC 4.8.5 (plus extensive backports, including at least one new backend). But the binaries you compile on CentOS 7 will not run on CentOS 6.
If you need just a newer GCC, and not version 4.8.5 exactly, you can use Developer Toolset. Version 7 gives you GCC 7. For C and C++ at least, the compiled code will run on any CentOS 6 system.

How to get old toolchain for Linux

We have a project that was working fine in Red Hat Enterprise Linux Server release 6.2. Since GCC version is getting updated periodically, we wanted to have our project to be independent of GCC upgrade in local system. Hence we wanted to keep GCC toolchain (binaries and libraries) in our project rather than standard location in the machine. ldd of our binaries generated out of our project should depend on the libraries in my our project not from the gcc libraries available in local system (because it might change at any time).
How do I do that? Where I shall get specific GCC toolchain for intel 64 bit (C & C++ compilers) ?
Current GCC Version: gcc-4.4.6-3.el6.x86_64

Compiling with different GCC versions

This is a follow up Q to CUDA incompatible with my gcc version.
I've recently updated to Ubuntu 12.04 as well as grabbing the latest CUDA toolkit. My nvcc --version is showing: Cuda compilation tools, release 5.0 (My driver ver is 304.43.)
I'm trying to fix my build environment. I get errs about using GCC 4.6. I can probably fix this w/ the help of the above link. I'm wondering about the other 8 packages in this large project. Should I be concerned with building other pieces with one version of GCC-4.6 and my cuda stuff with GCC-4.5? I figure they should all be compatible, but I've never run into this before. Is this anything I need to be concerned with?
I have run into incompatibility issues with different versions of GCC.
Specifically, GCC 4.7 and 4.6. My Qt applications wouldn't compile for me, because I was using GCC 4.7, and the library was compiled against GCC 4.6. They compiled fine, and there seemed to be no problem at first. But then I ran into trouble actually running them.
I would recommend against using different versions of GCC in the same project.

Resources