View previous topic :: View next topic |
Author |
Message |
mnie n00b
Joined: 21 Nov 2015 Posts: 1
|
Posted: Sat Nov 21, 2015 1:53 pm Post subject: Why Gentoo is using old GCC compiler? |
|
|
Some statistics from Distrowatch.com:
GCC compiler version:
Gentoo (4.9.3)
Debian (5.2.1)
Arch Linux (5.2.0)
Ubuntu 15.10, Wily (5.2.1)
Mint (4.8.2)
Fedora (5.2.1)
My question is: Why Gentoo does not use 5.2 GCC software release, when all other major Linux distributions will? Almost everything in Gentoo is compiled from source code. Why Gentoo does not use the most recent GCC compiler? Only Linux Mint in this test group uses lower version of GCC.. |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Sat Nov 21, 2015 2:02 pm Post subject: |
|
|
You can use any version of gcc you like, but in general it's good to be cautious.
Personally I don't feel very good about more recent gcc, mainly because they've gone to a hand-written C++ parser, and C++ is well-known to be a pig when it comes to language design. This has become an issue for me, because they now use C++ in the core compiler as well, and AIUI bootstrap is (even more of) a real pita. You need a recent gcc to build recent gcc, or something.
Losing f77 isn't nice either.
Still, at least someone's keeping gcc-3 alive (thanks be to mirabilos ;) |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21498
|
Posted: Sat Nov 21, 2015 3:52 pm Post subject: |
|
|
Distrowatch is inaccurate, possibly because of a limited output format. Gentoo offers a wide variety of gcc versions. According to eix, I can get: Code: | sys-devel/gcc
Available versions:
(2.95.3) (~*)2.95.3-r10^s
(3.3.6) (~)3.3.6-r1^s
(3.4.6) 3.4.6-r2^s
(4.0.4) {M}(**)4.0.4^s
(4.1.2) {M}4.1.2^s
(4.2.4) {M}(~)4.2.4-r1^s
(4.3.6) 4.3.6-r1^s
(4.4.7) 4.4.7^s
(4.5.4) 4.5.4^s
(4.6.4) 4.6.4^s
(4.7) 4.7.4^s
(4.8) (~)4.8.0^s (~)4.8.1-r1^s (~)4.8.2^s 4.8.3^s 4.8.4^s 4.8.5^s
(4.9) (~*)4.9.0^s (~*)4.9.1^s (~)4.9.2^s 4.9.3^s
(5) (**)5.1.0^s (**)5.2.0^s
| I am not sure why Distrowatch claims Debian, Ubuntu, and Fedora are on 5.2.1. According to upstream, gcc 5.x only has 5.1 and 5.2.
OP answered his own question about which version to use. Gentoo does not immediately use the latest release because everything is compiled from source code. If you set your system compiler to gcc 5.2, then you can only compile those packages which build under gcc 5.2. Since new versions of gcc tend to be better at optimizing and better at detecting non-conforming code, it is not uncommon for a technically ill-formed program to work under old gcc, but fail to build or fail to run correctly under new gcc. Therefore, the Gentoo maintainers are cautious about exposing a new version until they have confidence that all the core packages work correctly when built with that version. Binary distributions have the luxury of readily building ill-formed packages under an old gcc while they either fix, or wait for upstream to fix, the ill-formed code. |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Sat Nov 21, 2015 4:09 pm Post subject: |
|
|
What Hu said, to which I'd just add that it's not just "ill-formed code" but a sometimes numbskull approach to "conformity" and doing the dumbass thing "because we can" instead of just complaining that we've found UB (which we're now taking advantage of to do the wrong thing.)
upstream gcc are human, too; and that means they make mistakes, just like everyone else.
Whatever you do, don't use -O3 which is for experimental optimisations, which can and often have, been counter-productive, especially in combination, and are often later withdrawn.
-O3 is not a production flag. |
|
Back to top |
|
|
asturm Developer
Joined: 05 Apr 2007 Posts: 8933
|
|
Back to top |
|
|
mv Watchman
Joined: 20 Apr 2005 Posts: 6747
|
Posted: Sat Nov 21, 2015 5:32 pm Post subject: |
|
|
Hu wrote: | Binary distributions have the luxury of readily building ill-formed packages under an old gcc while they either fix, or wait for upstream to fix, the ill-formed code. |
Theoretically you are right, but AFAIK the policy of Debian (hence probably also of Ubuntu) for the current (unstable) release is to build only with gcc-5.2, mandatorily requiring fixes for packages which do not build with gcc-5.
So, in practice, gentoo is really a bit "behind", probably due to lack of manpower. OTOH, most gcc-5 issues have been fixed meanwhile in gentoo so that the "behindness" is only marginal. |
|
Back to top |
|
|
saellaven l33t
Joined: 23 Jul 2006 Posts: 646
|
Posted: Sat Nov 21, 2015 7:12 pm Post subject: |
|
|
In addition to the compilation problems with gcc 5.x, there's also the ABI change, which will require a full rebuild of everything (including those broken packages), which is why I've been delaying it myself, even though I normally have gcc ~arch |
|
Back to top |
|
|
schorsch_76 Guru
Joined: 19 Jun 2012 Posts: 450
|
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sun Nov 22, 2015 8:44 am Post subject: |
|
|
steveL wrote: | Personally I don't feel very good about more recent gcc, mainly because they've gone to a hand-written C++ parser, and C++ is well-known to be a pig when it comes to language design. |
So they've thrown away all the work done in the '80s on compiler-compilers, not the mention the earlier pioneering work by IBM. Figures.
Also agree with you on Fortran. No need to advance the compiler, but why not keep it?
I hate to sound like a grumpy old man, but today's software engineers no longer stand on the shoulders of giants. They prefer to throw away the work of the giants and reinvent the wheel (Why not elliptical? It's modern!) |
|
Back to top |
|
|
modnaruved Apprentice
Joined: 21 Mar 2011 Posts: 158
|
Posted: Sun Nov 22, 2015 9:01 am Post subject: |
|
|
Its very good when you can build software with over 5 or 10 years+ created and deps |
|
Back to top |
|
|
Irre Guru
Joined: 09 Nov 2013 Posts: 434 Location: Stockholm
|
Posted: Sun Nov 22, 2015 2:35 pm Post subject: |
|
|
grub:0 doesn't work if built with gcc:5 |
|
Back to top |
|
|
|