Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Why Gentoo is using old GCC compiler?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
mnie
n00b
n00b


Joined: 21 Nov 2015
Posts: 1

PostPosted: Sat Nov 21, 2015 1:53 pm    Post subject: Why Gentoo is using old GCC compiler? Reply with quote

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
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sat Nov 21, 2015 2:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21498

PostPosted: Sat Nov 21, 2015 3:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sat Nov 21, 2015 4:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8933

PostPosted: Sat Nov 21, 2015 4:33 pm    Post subject: Reply with quote

https://bugs.gentoo.org/show_bug.cgi?id=gcc-5
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Sat Nov 21, 2015 5:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
saellaven
l33t
l33t


Joined: 23 Jul 2006
Posts: 646

PostPosted: Sat Nov 21, 2015 7:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 450

PostPosted: Sun Nov 22, 2015 6:54 am    Post subject: Reply with quote

Please see this thread too:
My experience: gcc-5 usable by now
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Sun Nov 22, 2015 8:44 am    Post subject: Reply with quote

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
View user's profile Send private message
modnaruved
Apprentice
Apprentice


Joined: 21 Mar 2011
Posts: 158

PostPosted: Sun Nov 22, 2015 9:01 am    Post subject: Reply with quote

Its very good when you can build software with over 5 or 10 years+ created and deps ;)
Back to top
View user's profile Send private message
Irre
Guru
Guru


Joined: 09 Nov 2013
Posts: 434
Location: Stockholm

PostPosted: Sun Nov 22, 2015 2:35 pm    Post subject: Reply with quote

grub:0 doesn't work if built with gcc:5 :!:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum