0

I am using RHEL7.2 and default GCC version is 4.8.5 20150623

I would like to upgrade GCC to 6.1 and above for few reasons. (Like C++14 support, good sanitize options, SSO)

This link says distro's keep default version of GCC due to some reasons and else it may break ABI.

Is it ok to upgrade GCC if I build all the libs/files I am using same compiler? Do I need to take care anything else?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Nasir
  • 708
  • 2
  • 11
  • 28
  • 1
    It depends on what you're going to be doing. If you need to rebuild the kernel, you may be better off staying with the official compiler. If you're doing application development without tinkering with the kernel, I'd go with the latest version you can lay hands on (7.3.0 as of 2018-01-26). I'd install the upgraded version separately from the official build; I don't tinker with the official release, but I don't use it, either. – Jonathan Leffler Jan 31 '18 at 15:18
  • @JonathanLeffler its for application development. But link i mentioned gives some reason as why in distro its not upgraded. Is that applicable only if kernel is being compiled? – Nasir Jan 31 '18 at 15:20
  • I've not yet read your link; the first thing I had to do was fix the link in the question so it was usable. In my experience, if you build the compiler on the system where it is to run, you shouldn't run into problems. I've never run into problems with it. (For obscure reasons that I hate, one of my work machines is running archaic RHEL 5.x; it's also got GCC 7.3.0 on it (and 7.2.0, and 6.x, and 5.x) — I built them on the machine — and I've never run into a problem. If you import a GCC built elsewhere, you may be subject to problems.) . I'm primarily working in C, but there is C++ around. – Jonathan Leffler Jan 31 '18 at 15:29

1 Answers1

0

You do not want to update/replace the system ones because it may cause incompatibility/ABI issues.

Install the new gcc in a different location.

Or, easier, just get Red Hat Developer Toolset.

Maxim Egorushkin
  • 131,725
  • 17
  • 180
  • 271