You are not logged in.

#26 2014-01-21 09:00:19

STiAT
Member
From: Vienna, Austria
Registered: 2004-12-23
Posts: 603

Re: Will Arch Linux going to change the default compiler to Clang?

Fact is, there is (at the moment) no reason to do a switch to Clang. Yes, Qt and other toolkit/libs are checking if they compile on clang, for the simple reason that companies (and possibly customers) are doing the switch - maybe due to the license or whatsoever. Well .. except that clang actually has more sane error messages than GCC ;-).

Though, the progress is interesting and we may see something like a Clang compiled Arch in the future - officially or forked.

Last edited by STiAT (2014-01-21 09:11:54)


Ability is nothing without opportunity.

Offline

#27 2014-01-21 15:22:57

fsckd
Forum Moderator
Registered: 2009-06-15
Posts: 3,565

Re: Will Arch Linux going to change the default compiler to Clang?

Until the kernel and all the wonderful non-official patches for it can be compiled with clang, there's not a chance of it being the default compiler on any distro, let alone Arch Linux. http://llvm.linuxfoundation.org/index.php/Main_Page


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#28 2014-01-22 05:02:17

mmix
Member
Registered: 2014-01-11
Posts: 33

Re: Will Arch Linux going to change the default compiler to Clang?

don't wait, just build it yourself.
when cpu goes to multi-core, llvm will win.
compiler source code management..

Offline

#29 2014-01-28 13:22:13

Janarto
Member
From: Paris
Registered: 2008-09-23
Posts: 80

Re: Will Arch Linux going to change the default compiler to Clang?

Debian can mostly be compiled with clang (10 % failure among 18k packages)

http://sylvestre.ledru.info/blog/2013/0 … and-debian


I think LLVM  will be popular among companies that do not want to follow the gpl3. It should also help developpers to improve the quality of existing application's source code

Offline

#30 2014-02-21 07:31:14

GI Jack
Member
Registered: 2010-12-29
Posts: 85

Re: Will Arch Linux going to change the default compiler to Clang?

why do you want to use clang?

I feel there is a lot of FUD around GNU, and the whole push for clang/llvm is political not technical.

Offline

#31 2014-02-24 09:24:57

Janarto
Member
From: Paris
Registered: 2008-09-23
Posts: 80

Re: Will Arch Linux going to change the default compiler to Clang?

Well the point is not that much that clang is "better"

but thinking long term, it may be nice to go "compiler agnostic" and to have code that compile and run whatever the toolchain is

And there is quite a lot of effort put behind llvm/clang

https://fosdem.org/2014/schedule/track/llvm/

Last edited by Janarto (2014-02-24 09:28:05)

Offline

#32 2014-05-15 07:23:46

hussam
Member
Registered: 2006-03-26
Posts: 525
Website

Re: Will Arch Linux going to change the default compiler to Clang?

Sorry for posting in an old topic.
Actually Debian is attempting to experiment with this.
clang 3.3 failed to compile just under 12% of the Debian archive.
clang 3.4 only failed to compile 10.5% of the Debian archive. http://clang.debian.net/
Even the big boys like Microsoft experimented with LLVM http://lists.cs.uiuc.edu/pipermail/llvm … 66528.html
Although perhaps a huge part of this is wanting to try something that is less stale.

Offline

#33 2014-05-15 08:47:08

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,033

Re: Will Arch Linux going to change the default compiler to Clang?

hussam wrote:

Sorry for posting in an old topic.
Actually Debian is attempting to experiment with this.
clang 3.3 failed to compile just under 12% of the Debian archive.
clang 3.4 only failed to compile 10.5% of the Debian archive. http://clang.debian.net/
Even the big boys like Microsoft experimented with LLVM http://lists.cs.uiuc.edu/pipermail/llvm … 66528.html
Although perhaps a huge part of this is wanting to try something that is less stale.

How is gcc stale (assuming that's what you were implying)? And who cares what the "big boys" are doing?

I wouldn't expect Debian to switch to Clang, but getting their entire archive to compile with it would be a boon for free software in general because it would lead to more portable code.

Offline

#34 2014-05-15 11:24:24

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,416
Website

Re: Will Arch Linux going to change the default compiler to Clang?

Why would they switch and have their distribution run slower?

Offline

#35 2014-05-15 18:10:23

hussam
Member
Registered: 2006-03-26
Posts: 525
Website

Re: Will Arch Linux going to change the default compiler to Clang?

Allan wrote:

Why would they switch and have their distribution run slower?

I don't believe anyone would switch. I think they simply like to experiment with new things smile

Offline

#36 2014-05-28 13:27:28

krnlpk
Member
Registered: 2010-01-03
Posts: 15

Re: Will Arch Linux going to change the default compiler to Clang?

jakobcreutzfeldt wrote:

How is gcc stale (assuming that's what you were implying)?

For a simple, simple reason:

GCC codebase is a pure *mess*.
The whole compiler is designed as a collection of single threaded executables (go1, cc1, ..) with a messy wrapper on the top of them.
Writing a frontend and interfacing into its backend is absolutely a tedious task, because of the complete lack of good documentation; its completely unextendable architecture implies that if you have written a simple frontend, with LLVM it's all about linking it with LLVM libraries, with gcc you have to do a whole build of gcc (with all the frontends disabled, or not if you want them too) to get something that it's not even a cross compiler!
If you want to do it, then you have to rebuild the whole thing because the backend target is set at build time. But instead, clang/LLVM is inherently a cross compiler; you can do (after installing mingw64 libraries and binutils) clang -target x86_64-w64-mingw32 to build a windows executable with the same clang that you are using to build for x86_64-unknown-linux-gnu.

clang compiles way faster, and has been written from the very start to be modular and in C++ (gcc started using a small C++ subset recently, because it was a total mess). It's first a set of libraries that things like IDE and YouCompleteMe can use, and then a standalone compiler.
It has an inherently tecnical edge on gcc for the simple fact that it's better designed, and it's easier to work and extend it - not from a political view but from a purely technical view.
The whole infrastructure of gcc is not so extensible because of the fact that RMS is afraid that some proprietary software vendor could use it as a backend or frontend - and this has made gcc a utter, total, monolithical mess, based on a messy wrapper (gcc itself) that calls a bunch of real compilers (cc1, go1, ...) and then as, ld, ...
All of this happens inside clang without calling external executables (except the linker) because the whole LLVM is a set of libraries, and this is why it's all so much faster.

Performance differences are, in most cases, irrelevant between the two (GCC is still a bit faster because of its maturity, though).
I expect clang to gain the upper edge on performances when OpenMP will be ready for it too and after more work on LLVM optimizers.
After that, GCC will find a very hard time to regain the lost terrain against a foe which is better designed and way easier to mantain.

Last edited by krnlpk (2014-05-28 13:33:25)

Offline

#37 2014-05-28 13:36:17

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,416
Website

Re: Will Arch Linux going to change the default compiler to Clang?

I'm not going to disagree with point #1 and maybe point #2 if you had numbered beyond 1!

However, clang compiles faster because it does not optimize the binary as much.  gcc -O1 compiles as fast as clang -O2 and the binaries run the same speed on average.   Adding the extra optimization passes will likely result in a similar compile speed between the two compilers.

Offline

#38 2014-05-28 13:42:35

krnlpk
Member
Registered: 2010-01-03
Posts: 15

Re: Will Arch Linux going to change the default compiler to Clang?

Allan wrote:

I'm not going to disagree with point #1 and maybe point #2 if you had numbered beyond 1!

However, clang compiles faster because it does not optimize the binary as much.  gcc -O1 compiles as fast as clang -O2 and the binaries run the same speed on average.   Adding the extra optimization passes will likely result in a similar compile speed between the two compilers.

LOL, I forgot to add the remaining points (so I removed them).

Anyway, the fact is, clang is clean and modular, so there's more room for optimizing and improving it.
gcc is an old, big fat mess that requires a lot of time and effort to understand and work with; the latter is the reason I think that clang will - in the end - win the fight.

Last edited by krnlpk (2014-05-28 13:44:44)

Offline

#39 2014-05-28 15:15:05

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,033

Re: Will Arch Linux going to change the default compiler to Clang?

You use words like "foe" and "fight" as if there is some sort of animosity between the two projects. I don't see why the two cannot coexist. It seems almost as if the very continued existence of gcc is an insult to some people. Relax, it's not that big of a deal.

FWIW, I'm glad RMS took the decision to block making proprietary back/front-ends to gcc. That way, any developments could be enjoyed freely by everyone. The bigger problem is that for a long time gcc was the only player in town, so there was no great motivation to radically redesign any aspect of it. And if they did undertake any major overhauls, all the pimply geeks would be wheezing out long diatribes about "change for change's sake" and "i hate u fsf u broak the traditional cc concept".

Last edited by jakobcreutzfeldt (2014-05-28 15:15:52)

Offline

#40 2014-05-28 16:18:56

krnlpk
Member
Registered: 2010-01-03
Posts: 15

Re: Will Arch Linux going to change the default compiler to Clang?

jakobcreutzfeldt wrote:

You use words like "foe" and "fight" as if there is some sort of animosity between the two projects. I don't see why the two cannot coexist. It seems almost as if the very continued existence of gcc is an insult to some people. Relax, it's not that big of a deal.

FWIW, I'm glad RMS took the decision to block making proprietary back/front-ends to gcc. That way, any developments could be enjoyed freely by everyone. The bigger problem is that for a long time gcc was the only player in town, so there was no great motivation to radically redesign any aspect of it. And if they did undertake any major overhauls, all the pimply geeks would be wheezing out long diatribes about "change for change's sake" and "i hate u fsf u broak the traditional cc concept".

Well, if you read the gcc mailing list, you would notice that actually there is a lot of rivalry between the projects, especially from the gcc side (for purely political, licensing reasons).

The problem is that the choices that Stallman did forced several Free Software projects - including emacs - to renounce to features that proprietary software had for years, because of the extreme difficulty of reusing the gcc frontend.
GPL software is now forced to use LLVM because it allows people to accomplish their tasks better. RMS choices have, ironically, led to the affirmation of a non-copylefted compiler infrastructure, and also damaged GCC reputation and its usefulness - and I really can't see this as a win.

Last edited by krnlpk (2014-05-28 16:28:04)

Offline

#41 2014-05-28 22:37:05

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,033

Re: Will Arch Linux going to change the default compiler to Clang?

krnlpk wrote:

Well, if you read the gcc mailing list, you would notice that actually there is a lot of rivalry between the projects, especially from the gcc side (for purely political, licensing reasons).

The problem is that the choices that Stallman did forced several Free Software projects - including emacs - to renounce to features that proprietary software had for years, because of the extreme difficulty of reusing the gcc frontend.
GPL software is now forced to use LLVM because it allows people to accomplish their tasks better. RMS choices have, ironically, led to the affirmation of a non-copylefted compiler infrastructure, and also damaged GCC reputation and its usefulness - and I really can't see this as a win.

I still think you're trying to turn this into something that it's not. And anyway, nothing in your argument suggests an "affirmation of a non-copylefted compiler infrastructure". LLVM just as easily could have been copylefted but designed in a way to still allow proprietary front-ends just as gcc was designed to block them. So it's still the design of LLVM that is advancing the state of free compilers, not its license. I assume that that comment was just thrown in as a knee-jerk anti-GPL response, irrelevant though it may be.

I also don't see how gcc's reputation has been damaged. Is it suddenly a bad compiler? Is it a worse compiler than it was 5 years ago? Or did the flyer that they were handing out on the bandwagon tell you that gcc has sucked all along and everyone knew it and so should you? Even if LLVM were technically superior, that wouldn't tarnish the reputation of gcc as good software. Reputations get damaged when major security holes are found or when they're used as vectors for malware, etc., not just when a competitor comes along.

As many others have said before me, it's good that both gcc and LLVM co-exist. LLVM has improved because it was competing against the features of gcc. gcc has now improved to compete against the features of LLVM. We, the users, win. Both are free software, so again, we, the users, win.  Unfortunately, improvements to LLVM can be made proprietary (and likely are already, although I'm too lazy to look it up), which is a loss for us, but it doesn't make it a worse compiler. And it doesn't mean that a GPL'ed program that uses it is somehow dirty ("GPL software is now forced to use LLVM..."...give me a break).

Anyway, as I said before, relax. It's just a competition between compilers. Sit back and enjoy. Don't get so emotionally tied up in it.

Last edited by jakobcreutzfeldt (2014-05-28 22:39:07)

Offline

#42 2014-09-12 10:06:26

hoschi
Member
From: Ulm (Germany)
Registered: 2008-11-03
Posts: 358
Website

Re: Will Arch Linux going to change the default compiler to Clang?

Allan wrote:

No.

TLDR
Thanks! That is - positively / the only thing I want to read.

Why?
LLVM (i.e. CLANG) has positive influence on GCC, which is a good thing because Microsoft and Intel are improving their compilers only slowly. I especially thinkg about the improved warning and error-messages, colorized output or the various new sanitizerers. Besides that, GCC is using GPL and LLVM is using BSD as licencse. Therefore GCC preseres the openess the the source-code through the copyleft, LLVM does not. The GCC is mature and works for many years in production. The performance of the combiled binary objects is on the same level as of LLVM, or even better. But GCC is also lacking a usable external interface for code-completion through editors like VIM, Emaces or full-blown IDEs. That is really a thing they need to add.

I really don't like the steady mentions of how much faster LLVM is, because it is wrong and a misinterpretation. Most people are referencying Phoronix as source for this, but please read through this:
http://draketo.de/light/english/free-so … md-vishera

Phoronix is the first website which put an eye on performance of games and graphics-cards on GNU/Linux and this is good. But Phoronix* is in my eyes not a sufficient source of information, too much self-marketing and deviation. They don't read and interpret the own results correctly. Compile times matters for developers during development, but not for production. Execution times of the binaries are the only thing which matter for production! You even can't compare compile times between compilers, because the compilers do differeny things on the different levels (e.g. -Os, -O, -O1, -O2, -O3 in case of gcc).

* Phronix is doing benchmarks which varying clockrates. That is implicit wrong. Nobody can and should determine the action of the ondemand governor or intel-pstate, you can do benchmarking with them but cannot deduce any reliable result. Benchmarking must be done in a reproducable environment with fixed, default clock-rates (in the first place).

To sum up:
LLVM is good, for GCC.

Offline

#43 2014-09-15 07:03:58

MrLemux
Member
From: Northern Germany
Registered: 2014-08-17
Posts: 3
Website

Re: Will Arch Linux going to change the default compiler to Clang?

Besides that, GCC is using GPL and LLVM is using BSD as licencse. Therefore GCC preseres the openess the the source-code through the copyleft, LLVM does not.

Please no religous war, there are two forms of understanding freedom, the one is Copyleft-Style the other one is BSD-Style freedom, and that is totally okay,as both are free.
Personally I think it isn't time for LLVM/Clang yet as it hasn't matured enough, But i think, that someday GCC _could_ be replaced by LLVM/Clang as LLVM is a cleaner design than GCC.
And even if this doesn't happen, competition is good for us all

To sum it up
LLVM is good for GCC
GCC is good for LLVM
But in the end we have survival of the fittest.

Offline

#44 2014-09-15 08:57:01

hoschi
Member
From: Ulm (Germany)
Registered: 2008-11-03
Posts: 358
Website

Re: Will Arch Linux going to change the default compiler to Clang?

That is not religous smile
I'm not against LLVM. BSD and GLP are not different opinions, they are different matters. The BSD is just programming ("open-source") the GPL is about programming and politics ("license"). Most people still do not grasp, that the GPL is a political thing and the whole GNU-Ecosystem is also political matter. Neither BSD or GPL are better, they are completely different.

That's it. Probably this is also the reason, why people are bewildered by Richard Stallman. Most people nowadays know that GPL is not about freedom and about being free of charge. Otherwise a lot of people still don't realize, that the GPL is also political license which is about preserving and fighting for the freedom*. BSD is not, it is neither preserving nor fighting for freedom in a political way**. By the way, it is maybe theoretical possible to move a project which use (some type) of BSD under the GPL. But that is not about programming or politics, this is a law-stuff.

Replacing a core-part of a GNU-System by a a project which is licencsed by BSD is damaging the GNU-System. And the compiler and language-libraries are the core as the kernel, shell and coreutils are. The compiler and it's libraries are required to build the complete system.

*That is the reason way companies like Microsoft doesn't like the GPL, but can live well with BSD.

**Probably you know that example:
BSD allows someone to silently building a closed-source extension on your BSD code. Pushes people to use the extension and depending on it. Than people start to rely on it and lose there freedom again. Even if your project is catching up or doing things better, anybody can copy it immediately and add some of there sugar-stuff on top and beat you always. The open-source project can't win.

Probably someone don't care about this, others care about this.

// null brainer fixed

Last edited by hoschi (2015-03-13 15:26:49)

Offline

Board footer

Powered by FluxBB