Will gcc be upgraded from version 4.8.5?

General support questions
Post Reply
greina
Posts: 1
Joined: 2019/06/18 20:16:57

Will gcc be upgraded from version 4.8.5?

Post by greina » 2019/06/18 20:27:37

On CentOS 7, the `yum install` seems like limit `gcc` to version 4.8.5. I can use other repos to update to later versions, but wasn't sure why the main repo was so far behind. Can anyone comment? Thanks.

chemal
Posts: 546
Joined: 2013/12/08 19:44:49

Re: Will gcc be upgraded from version 4.8.5?

Post by chemal » 2019/06/19 01:09:11

The system compiler will never be upgraded and no reputable repository will offer such upgrades, because doing so would break binary compatibility. If you want newer versions of gcc for your own programming work, they can be installed alongside the system compiler but do not replace it. See RH's devtoolset software collections. At the moment we are at devtoolset-8.1 which contains gcc 8.3.1. Rebuilds for CentOS are available.

User avatar
jlehtone
Posts: 2202
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Will gcc be upgraded from version 4.8.5?

Post by jlehtone » 2019/06/19 10:39:57

RHEL/CentOS base repositories/images have to remain consistent and a lot depends on the compiler.

Same is much more noticeable with Python. Package management is done with 'yum'. Yum is python-2.7 code. If you replace python-2.7 with python-3.x, the yum will break. You cannot fix anything, if you cannot install/uninstall packages. You can upgrade core component only if you simultaneously upgrade all dependent components.

There is such upgrade. It is called RHEL-8. There will be CentOS-8 once it is done. They will have a GCC version X.Y for the next 10 years.

You can have two versions simultaneously, if they have different names or if you can control when they are found.
You cannot put file named "gcc" in /usr/bin because there is already system's gcc.
You can put it into another folder and put that folder first in your PATH, as long as that PATH is not visible to programs that expect the "gcc" to start system's version.


Repository centos-sclo-rh is still with devtoolset-8 that has GCC-8.2.1:

Code: Select all

# yum install centos-release-scl-rh
# yum install devtoolset-8-toolchain

# scl enable devtoolset-8 bash
# which gcc
/opt/rh/devtoolset-8/root/usr/bin/gcc
# exit
# which gcc
/usr/bin/gcc

Post Reply