"ada compiler rhel8" "rhel8 ada" "centos8 gnat rpm" "rhel8 gnat 32 bit rpm"
ada is no longer provided by redhat in rpm format.
rhel 8 is a 64 bit OS, but it can run 32 bit code. The gcc toolset will still make 32 bit object.
This ada compiler will also make 32 bit code. But support in the spec file is kind of "rusted".
These rpms are provided for situations where you want to keep the gcc version the same as original. So, it "sneaks right in" at the expense of the file names being the same. I haven't done it, but I assume you will need to delete the rpms prior to 'dnf update' actually updating the base gcc.
Why do you have to replace the base gcc package? It is needed because invoking gcc with a .adb file works.
OS version | gcc version |
---|---|
CentOS-8.1.1911 | gcc-8.3.1.4 |
CentOS-8.2.2004 | gcc-8.3.1.5 |
CentOS-8.3.2011 | gcc-8.3.1.5 |
CentOS-Stream-8 | "who knows!" |
At the time this is written, there are no source rpms available for "stream", and if they were, what is current? You can get them from a centos git repository, but at this point I don't need it.
The version you have installed is important.
$ rpm --query gcc
To install:
-
install "GUI Server"
-
install yum utils
`yum install yum-utils`
-
enable this rep
`vi /etc/yum.repos.d/CentOS-PowerTools.repo
-
update the system
`yum update`
-
Install headers (to include 32 bit) (need to figure out the correct version..., one of these will work)
`dnf install glibc-devel-2.28-127.el8.i686` `yum install glibc-devel-2.28-101.el8.i686 glibc-common glibc-headers`
-
Install the redhat compilers
`yum groupinstall "Development Tools"`
-
The ada packages have exactly the same names as the rest of the gcc package. So, we need to make sure the versions match exactly.
`rpm --query gcc`
Keep the results availible. They must match.
-
Install the ada rpms. The below example shows selecting the correct versions with a wildcard.
`cd <where the rpms are>` `yum localinstall *8.3.1-5*` or `rpm --reinstall *8.3.1-5*`
-
Test Program (cut and paste into a.adb)
with text_io;
procedure a is
begin
text_io.put_line("hello");
end;
#10. Try it
gnatmake -m32 a.adb
file ./a
./a
or
gnatmake a.adb
file ./a
./a
#11. The changes to the spec file is in the file "pfile". Not proud of it, but it is what it is.
Note: The above ada compiler was built without running the testsuite (because I didn't change any functional source) and it was not 'bootstrapped'. It should work fine, but it is a little different than one would expect.
So, do you trust some random rpm from the internet? Probably not the smartest thing to do. You may want to build this for yourself; the problem is that building gcc-gnat requires having an ada compiler. And that has to come from somewhere.
No matter what, you have to trust something.
My suggestion is to install the binary rpms for the version you need, and then follow the below suggestions. They are not verified, but they should get you close to being able to compile these from source.
`cd SRPMS`
`rpm --install gcc-8.3.1-5.el8.0.3.src.rpm`
`cd`
`cd rpmbuild`
`cd SPECS`
`yum install zlib-devel`
`yum install dblatex`
`yum install dejagnu doxygen elfutils-devel elfutils-libelf-devel glibc-static gmp-devel isl-devel libmpc-devel mpfr-devel python3-devel`
`yum install python3-sphinx sharutils systemtap`
`yum install systemtap-sdt-devel texinfo-tex`
`rpmbuild -ba gcc.spec`