Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Will Gentoo leave gcc and adopt clang in the future?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
rudregues
Apprentice
Apprentice


Joined: 29 Jan 2013
Posts: 231
Location: Brazil

PostPosted: Fri May 13, 2016 8:55 pm    Post subject: Will Gentoo leave gcc and adopt clang in the future? Reply with quote

https://wiki.gentoo.org/wiki/Google_Summer_of_Code/2016/Ideas/Clang_native_support

For normal users like me it would be interesting faster compiles with official support from the team. But it must be a very hard mission to take, any thoughts?
_________________
Emerging en gentoo
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8708
Location: ~Brussels - Belgique

PostPosted: Fri May 13, 2016 9:25 pm    Post subject: Reply with quote

Hi!

Gentoo is about choice, and it will be interesting to support many different compilers.
I don't thnk the goal is to abadon GCC or use an other compiler as the default compiler.

So if we have enough manpower to support native compilers, this is a great news!
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Fri May 13, 2016 9:51 pm    Post subject: Re: Will Gentoo leave gcc and adopt clang in the future? Reply with quote

rudregues wrote:
For normal users like me it would be interesting faster compiles with official support from the team. But it must be a very hard mission to take, any thoughts?

rudregues ... that project seems to be more about support in general (so, gcc-config), a good percentage of packages will probably compile without issue (glibc being one notable exception), and can be attempted via package.env. So, not really that difficult, though having clang replace gcc completely may not be possible (if only because all it takes is one package to fail to compile with clang as CC and gcc would then be required to resolve that).

Big problem for the properly naming brigade however, with musl replacing glibc and clang replacing gcc we will be left in the uncomfortable paroxism of not having an argreed upon prefix. I look forward to being able to 'correct' those mistakenly using the word 'linux' and insit they use the proper idiom of UoI-NCSA-MIT-DASHofGNU/Linux ;)

best ... khay
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1369
Location: EU or US

PostPosted: Fri May 13, 2016 10:16 pm    Post subject: Reply with quote

I will take faster binaries over faster compiling any time.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Fri May 13, 2016 10:33 pm    Post subject: Reply with quote

Buffoon,

In some applications, me too. However, most systems spend their time waiting for user input and all systems wait at the same speed.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


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

PostPosted: Mon May 16, 2016 10:11 am    Post subject: Reply with quote

NeddySeagoon wrote:
most systems spend their time waiting for user input and all systems wait at the same speed.

Love it. :-)

On the broader topic, I don't see it happening in the medium-term (3-5 years) at least; as others have said, yes there will always be support for whatever the admin wants to use.
Gentoo makes a great test-bed for all sorts of "game-changing" approaches, and that will always be the case, because of its nature (from-source.)

I just don't see it happening any time soon, nor do I see it as a priority for Linux and the wider GNU community it depends on.

More a priority for corporations seeking to evade the GPL, whilst still leeching all the code-efforts of the community, afaict.
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Tue May 17, 2016 12:36 am    Post subject: Reply with quote

I remember that once trying it switch to Intel compiler was a thing... kernel and glibc were the major issue makers, as far as I remember.
_________________
"I'm just very selective about the reality I choose to accept." -- Calvin
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 2158
Location: Berlin, Germany

PostPosted: Tue May 17, 2016 8:05 am    Post subject: Reply with quote

clang somewhat faster when compiling, but that difference is not as big as it used to be, especially at higher optimization.
Some packages still fail to build, or worse, compile successfully and not run properly, bug 408963.

But what makes leaving gcc impossible is that llvm/clang do not support all the architectures that Gentoo does.

Switching to icc systemwide was never "a thing", just some uninformed people who thought it was a good idea and then their systems had broken bash. :lol:
Back to top
View user's profile Send private message
Ottre
Tux's lil' helper
Tux's lil' helper


Joined: 23 Dec 2012
Posts: 129

PostPosted: Tue May 17, 2016 10:05 am    Post subject: Reply with quote

FYI, clang is the default for Gentoo Prefix on OS X.
Back to top
View user's profile Send private message
Ottre
Tux's lil' helper
Tux's lil' helper


Joined: 23 Dec 2012
Posts: 129

PostPosted: Tue May 17, 2016 10:08 am    Post subject: Reply with quote

chithanh wrote:
Some packages still fail to build, or worse, compile successfully and not run properly, bug 408963.


You can go ahead and close bug 558080, there are 2 people saying the patch works.
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Tue May 17, 2016 12:00 pm    Post subject: Reply with quote

chithanh wrote:

Switching to icc systemwide was never "a thing", just some uninformed people who thought it was a good idea and then their systems had broken bash. :lol:


Yes, because why try? It should be known to be impossible before experimentation.

I dare say that the main problem is not with compilers, but with the assumption some developers do that their software will only be compiled with GCC and, thus, they may use GCC-specific features and behaviours not specified in any C standard. It is their software, they are entitled to do so, and it may be even the most feasible way to do some things, but it is not exactly portable nor elegant.
_________________
"I'm just very selective about the reality I choose to accept." -- Calvin
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 2158
Location: Berlin, Germany

PostPosted: Tue May 17, 2016 2:16 pm    Post subject: Reply with quote

Ottre wrote:
You can go ahead and close bug 558080, there are 2 people saying the patch works.
I don't know whether the patch has been applied in the tree yet, the bug should remain open until that has happened.

pilla wrote:
chithanh wrote:

Switching to icc systemwide was never "a thing", just some uninformed people who thought it was a good idea and then their systems had broken bash. :lol:

Yes, because why try? It should be known to be impossible before experimentation.
Oh, I'm all for experimentation and doing cool new stuff with Gentoo.
With icc specifically however, you read in their forums things like "strict observance of language standards might pose an intolerable performance obstacle" (source) and as such, one should weigh using that compiler on important packages against the expected benefits and what if things go wrong.

So do it one package at a time, and have a plan B ready how to unbreak your system. Or read the wiki which packages better not to compile with icc (there was an article in the old wiki that nobody bothered to port over to the new one).
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


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

PostPosted: Tue May 17, 2016 3:00 pm    Post subject: Reply with quote

pilla wrote:
I dare say that the main problem is not with compilers, but with the assumption some developers do that their software will only be compiled with GCC and, thus, they may use GCC-specific features and behaviours not specified in any C standard. It is their software, they are entitled to do so, and it may be even the most feasible way to do some things, but it is not exactly portable nor elegant.

I agree with your overall point, but the context it is put in, is usually deceptive, ime.

It will end up being "use these clang-specific extensions" (look, shiny!) rather than "write portable code".
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Tue May 17, 2016 3:21 pm    Post subject: Reply with quote

chithanh wrote:

Oh, I'm all for experimentation and doing cool new stuff with Gentoo.
With icc specifically however, you read in their forums things like "strict observance of language standards might pose an intolerable performance obstacle" (source) and as such, one should weigh using that compiler on important packages against the expected benefits and what if things go wrong.


I wouldn't take stuff written in an Internet forum as the supreme truth (oh the irony). However, this is not even a good example, as it is an optimization that both ICC and GCC seem to do with different degrees of success. I was talking about of extensions such as those in this list.


chithanh wrote:

So do it one package at a time, and have a plan B ready how to unbreak your system. Or read the wiki which packages better not to compile with icc (there was an article in the old wiki that nobody bothered to port over to the new one).


I tried it a long time ago and things like kernel, that used GCC extensions, failed miserably. Maybe some of the fault was with ICC, but I am still find it hard to justify those extensions being so important. They should probably part of the standard if it is not feasible to write software without them.
_________________
"I'm just very selective about the reality I choose to accept." -- Calvin
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 2158
Location: Berlin, Germany

PostPosted: Wed May 18, 2016 12:04 am    Post subject: Reply with quote

pilla wrote:
I wouldn't take stuff written in an Internet forum as the supreme truth (oh the irony). However, this is not even a good example, as it is an optimization that both ICC and GCC seem to do with different degrees of success.
My goal was here to show the mindset surrounding icc, and that Internet forum is perfectly good at capturing that. The actual issue discussed there is almost inconsequential, I just happened to have that open from a discussion elsewhere about whether -Ofast can break well-written programs (turns out yes, because -Ofast implies -fassociative-math which enables optimizations forbidden by the C standard).


pilla wrote:
I tried it a long time ago and things like kernel, that used GCC extensions, failed miserably. Maybe some of the fault was with ICC, but I am still find it hard to justify those extensions being so important. They should probably part of the standard if it is not feasible to write software without them.

Compiling a Linux kernel with icc was possible since around 2009, see this topic.
The project to build the kernel with icc later became inactive. But recently, the kernel cleaned up some code, and Intel themselves improved gcc extension support in icc-16.0 to the point that the Linux kernel would build.
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Wed May 18, 2016 12:38 am    Post subject: Reply with quote

chithanh wrote:

pilla wrote:
I tried it a long time ago and things like kernel, that used GCC extensions, failed miserably. Maybe some of the fault was with ICC, but I am still find it hard to justify those extensions being so important. They should probably part of the standard if it is not feasible to write software without them.

Compiling a Linux kernel with icc was possible since around 2009, see this topic.
The project to build the kernel with icc later became inactive. But recently, the kernel cleaned up some code, and Intel themselves improved gcc extension support in icc-16.0 to the point that the Linux kernel would build.


I don't remember the exact date, but I remember playing with ICC in 2004, while using it to run SPEC benchmarks in some servers for a Brazilian company as part of a university project. A little earlier than that, I am afraid.
_________________
"I'm just very selective about the reality I choose to accept." -- Calvin
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Wed May 18, 2016 2:21 pm    Post subject: Reply with quote

steveL wrote:
It will end up being "use these clang-specific extensions" (look, shiny!) rather than "write portable code".

https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html don't have anything to do with 'shiny'.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


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

PostPosted: Fri May 20, 2016 1:01 am    Post subject: Reply with quote

steveL wrote:
It will end up being "use these clang-specific extensions" (look, shiny!) rather than "write portable code".

Dr.Willy wrote:
https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html don't have anything to do with 'shiny'.

You're missing the point. (re-read and it should be apparent.)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat 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