Hello,
I am building an older application on Debian 12.6 and am having some issues with gcc-12. The last time I built this on linux was using gcc 4.8. There are a great many issues that need to be resolved to get this to compile and link with gcc11+ so I would like to go back to an older version that will work out of the box, at least for now.
I have looked on the Debian ftp site here,
http://ftp.us.debian.org/debian/pool/main/g/
but there is no entry for gcc4. There is a gcc3 entry that looks like src and then the next version is gcc7.
Is there anywhere I can get a .deb install package for the final version of gcc4/g++4/gfortran4? Would the gcc7 version likely work the same as 4? I don't know what changes were made along the way other than that gcc11 was a big jump.
Thanks,
LMHmedchem
installing gcc4 on Debian 12.6
-
- Global Moderator
- Posts: 4311
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 126 times
- Been thanked: 579 times
Re: installing gcc4 on Debian 12.6
Hello,
Is your "older application" available as public source code ?LMHmedchem wrote: 2024-09-12 23:23 I am building an older application on Debian 12.6 and am having some issues with gcc-12. The last time I built this on linux was using gcc 4.8.
These are the versions currently available in Debian maintained releases:LMHmedchem wrote: 2024-09-12 23:23 There are a great many issues that need to be resolved to get this to compile and link with gcc11+ so I would like to go back to an older version that will work out of the box, at least for now. I have looked on the Debian ftp site but there is no entry for gcc4. There is a gcc3 entry that looks like src and then the next version is gcc7.
Code: Select all
$ rmadison gcc --arch amd64
gcc | 4:8.3.0-1 | oldoldstable | amd64
gcc | 4:10.2.1-1 | oldstable | amd64
gcc | 4:12.2.0-3 | stable | amd64
gcc | 4:14.1.0-2 | testing | amd64
gcc | 4:14.1.0-2 | unstable | amd64
You can search here:LMHmedchem wrote: 2024-09-12 23:23 Is there anywhere I can get a .deb install package for the final version of gcc4/g++4/gfortran4?
It probably depends on the target source code.
Each Debian package has a changelog; furthermore, you can see here:LMHmedchem wrote: 2024-09-12 23:23 I don't know what changes were made along the way other than that gcc11 was a big jump.
Re: installing gcc4 on Debian 12.6
Would using Docker be an option? There is e.g. a docker image from gcc - https://hub.docker.com/_/gcc/
Re: installing gcc4 on Debian 12.6
You could try to set the dialect with the -std" option. In your makefile if exists
And the same for g++. See the man page for details.
Code: Select all
CC = gcc -std=89
Re: installing gcc4 on Debian 12.6
As this thread is a few months old now, I'll add to the discussion with a potential solution that might help others:
You could use Debian Etch (Debian 4.0) which shipped with gcc 4.1. Here's how:
1. Download the Debian Etch netinstall ISO: https://cdimage.debian.org/mirror/cdima ... etinst.iso
2. After basic installation, set up your /etc/apt/sources.list with:
3. Run the next commands going forward as root:
If you need a GUI environment, you can also install xorg and gnome:
Important notes:
- This is only recommended for isolated development/testing environments
- I've done this exact setup for researching mid 2000s Linux using QEMU with user mode networking (-net user). This configuration is quite safe as QEMU's user networking creates an isolated virtual network environment. Your VM gets its own internal VLAN with no direct external network access, essentially acting as a NAT with its own DHCP server.
You could use Debian Etch (Debian 4.0) which shipped with gcc 4.1. Here's how:
1. Download the Debian Etch netinstall ISO: https://cdimage.debian.org/mirror/cdima ... etinst.iso
2. After basic installation, set up your /etc/apt/sources.list with:
Code: Select all
deb http://archive.debian.org/debian/ etch main
deb-src http://archive.debian.org/debian/ etch main
3. Run the next commands going forward as root:
Code: Select all
apt-get update
apt-get install gcc-4.1
If you need a GUI environment, you can also install xorg and gnome:
Code: Select all
apt-get install xorg gnome-core
Important notes:
- This is only recommended for isolated development/testing environments
- I've done this exact setup for researching mid 2000s Linux using QEMU with user mode networking (-net user). This configuration is quite safe as QEMU's user networking creates an isolated virtual network environment. Your VM gets its own internal VLAN with no direct external network access, essentially acting as a NAT with its own DHCP server.
- Attachments
-
- Screenshot 2025-01-30 131230.png (137.61 KiB) Viewed 2756 times
Software Engineer
AKA: markmental/mentalnet98
Debian User since 6.0 Squeeze
My Technical Blog: http://mentalnet.xyz/mentalnet98-netblog/
AKA: markmental/mentalnet98
Debian User since 6.0 Squeeze
My Technical Blog: http://mentalnet.xyz/mentalnet98-netblog/
- stevepusser
- Posts: 13137
- Joined: 2009-10-06 05:53
- Has thanked: 56 times
- Been thanked: 105 times
Re: installing gcc4 on Debian 12.6
Debian 8 had gcc-4.9 by default, but Debian 9, which had a gcc-6 as default, still might have had it available in the repos, just like bookworm has gcc-11 still available
MX Linux packager and developer