×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

FreeBSD 10 To Use Clang Compiler, Deprecate GCC

timothy posted about 2 years ago | from the squash-it-like-a-figurative-bug dept.

GNU is Not Unix 711

An anonymous reader writes "Shared in last quarter's FreeBSD status report are developer plans to have LLVM/Clang become the default compiler and to deprecate GCC. Clang can now build most packages and suit well for their BSD needs. They also plan to have a full BSD-licensed C++11 stack in FreeBSD 10." Says the article, too: "Some vendors have also been playing around with the idea of using Clang to build the Linux kernel (it's possible to do with certain kernel configurations, patches, and other headaches)."

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

711 comments

What's wrong with GCC? (5, Interesting)

jomcty (806483) | about 2 years ago | (#39986849)

What's wrong with GCC?

Re:What's wrong with GCC? (5, Informative)

jps25 (1286898) | about 2 years ago | (#39986869)

The GPL.

Dropping the GPL ~= worse. (1, Flamebait)

sethstorm (512897) | about 2 years ago | (#39986937)

While the BSD licensing model allows various hijinks to go around without the requirement of disclosure.

Complaining about the GPL is like complaining that you can't play dirty pool with code licensing(see Tivoization). Then again, you probably would rather throw some ad hominem at me regarding a certain GPL advocate.

Re:Dropping the GPL ~= worse. (1, Offtopic)

jps25 (1286898) | about 2 years ago | (#39986995)

Don't put words into my mouth.

Re:Dropping the GPL ~= worse. (-1)

Anonymous Coward | about 2 years ago | (#39987045)

Don't throw out words from your ass. =P

The guy said "probably". By experience, he was expecting you to be a GPL Troll.

Good you aren't. But you could had paid more attention in the message than in your ego.

Re:Dropping the GPL ~= worse. (0)

Anonymous Coward | about 2 years ago | (#39987247)

Complaining about the GPL is like complaining that you don't like S&M. Many people wants _real_ freedom for their software so that all, commercial and non-commercial users can expand and use the software in any way they want.
There's a reason even the shining monument of GPL (Linux) uses GPLv2...

Re:What's wrong with GCC? (3, Interesting)

DarkHelmet433 (467596) | about 2 years ago | (#39987031)

Well.. GPLv3 specifically. FreeBSD is stuck on GCC-4.2, the last GPLv2 gcc compiler. It's getting quite dated now. It's a switch from gcc-4.2.2+ hacks/patches to clang instead of a GPLv3'd gcc-4.6 or later.

"Stuck"? FreeBSD gets a foot in the door of companies where GPL (and GPLv3 in particular) is something they'd prefer not to deal with. Being able to use a modern GPL-free OS as a foundation of a product is a convenient option to have. And being GPLv3-free can be even more compelling.

Re:What's wrong with GCC? (5, Interesting)

Alex Belits (437) | about 2 years ago | (#39987059)

And WHY would a company want to avoid GPL compiler, unless it intends to distribute a sabotaged version of the compiler?

Re:What's wrong with GCC? (1, Insightful)

bonch (38532) | about 2 years ago | (#39987083)

One example would be integrating the compiler with its own custom tools. Whether or not you consider this to be a sabotaged version depends on if you believe BSD-licensed source code suddenly disappears from existence the moment a company uses it for something.

Re:What's wrong with GCC? (3, Informative)

Alex Belits (437) | about 2 years ago | (#39987121)

One example would be integrating the compiler with its own custom tools.

The only valid way of integrating compiler with custom tools is calling the compiler from them (everything else is shit design made by shit developers). That was done with gcc for as long as gcc exists.

Go to definition of selected symbol (2)

tepples (727027) | about 2 years ago | (#39987179)

The only valid way of integrating compiler with custom tools is calling the compiler from them

So what's the valid way of finding what functions exist and what variables belong to what functions? Such functionality is needed for "go to definition of selected symbol" and "search for uses of selected symbol" actions.

Re:Go to definition of selected symbol (0)

Alex Belits (437) | about 2 years ago | (#39987315)

So what's the valid way of finding what functions exist and what variables belong to what functions? Such functionality is needed for "go to definition of selected symbol" and "search for uses of selected symbol" actions.

The valid way is "don't, because it encourages horrendously tight coupling in all interfaces". I am more productive with two editor windows side by side (something that can't be accomplished in IDEs due to multitude of itty-bitty reference windows everywhere) than programmers who rely on tools to jump to definitions that usually they have no business reading in the first place.

The way how it is implemented everywhere is, use ctags. You don't need the whole compiler for just parsing identifiers.

Re:What's wrong with GCC? (5, Informative)

ommerson (1485487) | about 2 years ago | (#39987313)

One of the key design objectives of Clang is that it is highly modular, and implemented in such a way that various compilation stages are self-contained, and have clean APIs and data structures. This allows development tools such as IDEs to link directly against the stages of the compilation pipeline then need to implement syntax highlighting, code completion, refactoring tools and so on.

Apple's XCode does precisely this, and licensing and lack of modularity in the GCC source tree would have been major factors in their choice to support Clang and LLVM development.

The traditional way of implementing these functions in IDEs has been to effectively re-implement the front-end of the compiler (often not completely). This is a big deal when developing in C++ against the STL/Boost/TR1 when you find that code completion can't grok template properly. This is something that XCode and Visual Studio (which takes a similar approach) are both capable of doing.

Re:What's wrong with GCC? (1)

Anonymous Coward | about 2 years ago | (#39987319)

You know, it's been my experience that when someone says something along those lines (any other way of doing something is shit, and anyone who does it is shit) that they really don't know what they are talking about, are full of themselves.

LLVM is built specifically as libraries for tool integration, and for very good reasons. Of course I'd argue that you have to "call the compiler" with gcc for pretty much every use case is the result of the way that gcc modules are so closely tied together. IMHO that's shit design.

Re:What's wrong with GCC? (2, Insightful)

Alex Belits (437) | about 2 years ago | (#39987385)

You know, it's been my experience that when someone says something along those lines (any other way of doing something is shit, and anyone who does it is shit) that they really don't know what they are talking about, are full of themselves.

Or, maybe, they have seen it done the shit way before, and want to warn people against doing it again.

Re:What's wrong with GCC? (1)

Anonymous Coward | about 2 years ago | (#39987395)

Three words. Embrace, Extend, Extinguish. Instant vanishing has nothing to do with it.

Re:What's wrong with GCC? (2, Interesting)

rubycodez (864176) | about 2 years ago | (#39987159)

maybe they want to distribute a USEFUL version of the compiler, for a particular purpose. Stallman et. al has long battled to keep usable API and plugin points to the front end of gcc only, and to prevent such in all parts of the toolchain, even to keeping the documentation for parts obfuscated. screw that, some people want real freedom....

Re:What's wrong with GCC? (1)

Alex Belits (437) | about 2 years ago | (#39987241)

How is any of that related to licensing?

Re:What's wrong with GCC? (4, Informative)

rubycodez (864176) | about 2 years ago | (#39987309)

the topic of this thread is "What's Wrong With GCC?", not "What's Wrong with the GPL"

Re:What's wrong with GCC? (1, Informative)

jedidiah (1196) | about 2 years ago | (#39987387)

Of course the GPL will be brought up sooner or later as a sort of bogeyman.

I never did get why any sort of freeware community would shill for corporate abusers.

If you need to care about something like the GPL then you are violating basic modularity principles taught in the first year of any CS program.

Re:What's wrong with GCC? (1)

Alex Belits (437) | about 2 years ago | (#39987391)

the topic of this thread is "What's Wrong With GCC?", not "What's Wrong with the GPL"

The brancg you are answering to, starts from my response:

And WHY would a company want to avoid GPL compiler, unless it intends to distribute a sabotaged version of the compiler?

Re:What's wrong with GCC? (3, Interesting)

Kjella (173770) | about 2 years ago | (#39987265)

"Stuck"? FreeBSD gets a foot in the door of companies where GPL (and GPLv3 in particular) is something they'd prefer not to deal with. Being able to use a modern GPL-free OS as a foundation of a product is a convenient option to have. And being GPLv3-free can be even more compelling.

Not to troll, but what companies are those? What's the closest thing to Red Hat that's selling FreeBSD support, what volume are we talking about? Or are they all providing their own support? Don't get me wrong, I know particularly a lot of web hosting companies run it - 6/39 [netcraft.com] of the top providers on Netcraft's list are FreeBSD, but I doubt they have a problem with the GPL. If BSD went away, they'd probably just join all the Linux hosting companies. There's of course Apple and then there's.... who?

Re:What's wrong with GCC? (0, Flamebait)

cheesybagel (670288) | about 2 years ago | (#39987093)

The BSD guys are an interesting crowd. Well they can continue to watch Microsoft and Apple pilfer their software stack usually giving nothing in return while they can use GNOME or KDE or whichever other GPL or LGPLed project exists on their system (takes only a recompile) because otherwise they don't have a useable desktop and are stuck with 1980s user interfaces. I have used clang and it was neither faster to compile nor produced faster code than GCC. The only noticeable thing is the ANSI colored error messages... blech. I understand it is supposed to be easy to port because of LLVM but the fact is GCC has already been ported basically to every architecture that matters so it probably wasn't that hard to port GCC either. Apple just wants to clamp down everything to be BSD so they can batter down all hatches eventually for the day when they give nothing back. All it takes is a change of heart or leadership. I still remember in the early days they only released source code much time after they did the release which is counter to the GPL people had to beg to them to get access to the source code or, heaven forbid, actually participate in development (it seems for Apple all developers outside of Apple are a bunch of idiots who can't code or something).

Re:What's wrong with GCC? (4, Insightful)

ommerson (1485487) | about 2 years ago | (#39987339)

Precisely who do you think has done a lot of the development on Clang/LLVM over the last few years and contributed it to the wider community?

Re:What's wrong with GCC? (4, Insightful)

Pinky's Brain (1158667) | about 2 years ago | (#39987117)

The GPL has never really been the issue, LLVM was offered for GPL-Next ... but the GCC maintainers have always insisted upon a monolithic compiler without standardized intermediary representations to prevent other compiler builders just using GCC as a front end and thus refused, but that's on the maintainers and not the GPL.

Re:What's wrong with GCC? (1)

Xpilot (117961) | about 2 years ago | (#39987165)

You know how BSD advocacy folks like to tell you they "don't like politics"? It's kind of like the story in the Onion about that guy who keeps telling people he doesn't own a television and how much more fulfilling his life is, even when no one asked. BSD advocacy folks are _just as political_ as the GPL crowd. The reason to use GCC isn't performance, it's the only free compiler that supports a multitude of target architectures. And that's very very useful. Dropping utility over licensing kind of smacks of the thing GNU is accused of when BSD advocacy folks get all snooty about technical superiority.

Re:What's wrong with GCC? (-1, Flamebait)

Jeremiah Cornelius (137) | about 2 years ago | (#39986879)

Ideology.

Libertarians hate GNU.

Someday, when the whole world of technology is balkanized, where premium code contributions are walled of into proprietary software owned by Apple, Google and Facebook, we will wonder how "open source" became a form of virtual date rape.

Re:What's wrong with GCC? (5, Informative)

bonch (38532) | about 2 years ago | (#39986939)

Clang and FreeBSD aren't proprietary software. They're BSD-licensed open source. That code doesn't magically disappear when a company uses it.

Re:What's wrong with GCC? (2, Insightful)

Lisias (447563) | about 2 years ago | (#39987057)

Clang and FreeBSD aren't proprietary software. They're BSD-licensed open source. That code doesn't magically disappear when a company uses it.

But the contributors do.

Re:What's wrong with GCC? (0)

rubycodez (864176) | about 2 years ago | (#39987089)

so what, so those branches with fruit for a few die off while the main tree continues to flourish. the problem has its own natural solution

Re:What's wrong with GCC? (4, Interesting)

bonch (38532) | about 2 years ago | (#39987181)

After all these years of BSD code existing and thriving without issue, it's amazing that people still spread this kind of fearmongering despite the fact that this scenario has never come true.

The original code and its contributors don't magically disappear the moment a company makes a closed change. And if a company makes contributions it doesn't show anyone, you're free to make your own open contribution that competes with it. In fact, it's in company's best interests to rely on open contributions, because they don't want to waste time and manpower on, say, maintaining a compiler. This has proven to be the case with Clang. There hasn't been some evil proprietary fork that somehow ruined the world--and even if there was, people would just contribute free versions of the fork's features to the main tree. Companies are smart enough to know that this would happen and therefore realize that closed contributions of major features would be wasted effort.

Re:What's wrong with GCC? (0)

Anonymous Coward | about 2 years ago | (#39987341)

Actually it is a matter of mass and probably marketing/selling. I believe it happened famously with Spice, made to comercial LTSpice, which made pop http://www.gnu.org/software/gnucap/ to replace it, but the damage was already done.

Re:What's wrong with GCC? (2)

iluvcapra (782887) | about 2 years ago | (#39987087)

But whenever Apple tweaks their Xcode branch of Clang and don't release the tweak the day they push the binary, it kills a Magic Free Software kitten.

Re:What's wrong with GCC? (4, Insightful)

Fred Ferrigno (122319) | about 2 years ago | (#39987109)

The derivative works companies build using BSD-licensed software are effectively proprietary software. And if they control the hardware, they can make sure it only runs binaries signed by them, so you can't even run the original unmodified code.

Re:What's wrong with GCC? (1)

cheesybagel (670288) | about 2 years ago | (#39987125)

Try asking Microsoft for the source code of their OS (particularly Winsock which is a ripoff of BSD sockets) and see how far you get. Even if you get the source you will not be able to modify it and redistribute the changes.

Re:What's wrong with GCC? (1)

UnknowingFool (672806) | about 2 years ago | (#39987205)

First of all this isn't true as Winsocks was all MS. You can tell by how crappy it was. If it had been based on BSD, it would have worked well. Second, when someone modifies BSD and doesn't release their changes, the original source code doesn't magically disappear from the BSD repositories.

Re:What's wrong with GCC? (3, Insightful)

Anonymous Coward | about 2 years ago | (#39987311)

Winsock isn't based on BSD sockets. And it wouldn't matter if it was. The original BSD source would still be there. Why does every BSD scaremonger act like the original source goes away? How many decades of BSD software has to exist without issue before people stop making this bogus argument?

Re:What's wrong with GCC? (1)

garyebickford (222422) | about 2 years ago | (#39987317)

I know some F500 companies do that. Chevron, for example, back in the late 1990s had their own custom version of Windows. (I haven't been there since, so I don't know if it's still true.) they would also fire you if you opened the computer, or loaded any software onto it. They pushed new software onto your machine any night they felt like it.

It reminded me of Mordor when I visited the company.

Re:What's wrong with GCC? (0)

Anonymous Coward | about 2 years ago | (#39987111)

Libertarians hate GNU.

I wasn't aware that we did. Why, specifically?

Date rape, seriously? (0)

Anonymous Coward | about 2 years ago | (#39987267)

I can't believe known troll Jeremiah Cornelius got +5 Insightful comparing BSD code contributions to date rape. Stop falling for the flamebait, people.

Clang isn't "proprietary software", and this scare scenario about BSD code getting walled off and lost forever has never happened in all the years of BSD and never will happen, because the original source still exists, and people would just contribute competing features under the BSD license and negate the company's closed changes.

Re:What's wrong with GCC? (1)

PhrostyMcByte (589271) | about 2 years ago | (#39987333)

It's not like devs are putting their code under BSD with the expectation that companies will share back, only to be in total shock and feeling scorned when a company doesn't. If they cared about that issue as much as the loud people on /. did, they'd be using GPL.

/. can keep waging the license war, while devs will continue to ignore it and license their code in whatever way they're comfortable with.

Re:What's wrong with GCC? (1)

Anonymous Coward | about 2 years ago | (#39987381)

That's ridiculous. The GNU GPL is a tool for maintaining the freedom in our computer systems. You clearly don't understand how it works.

GPL'd software is open source, so if you don't think the documentation is sufficient go and read the source and write better documentation for it.

As someone else mentioned, if you want to integrate with gcc just call it from your tools , and your tools don't have to be GPL'd to do that.

Re:What's wrong with GCC? (2)

mwissel (869864) | about 2 years ago | (#39986885)

One thing might be GCC is licensed under the GPL while LLVM/Clang are under a BSD(-like) license.

Re:What's wrong with GCC? (0)

Anonymous Coward | about 2 years ago | (#39986887)

It doesn't have the buzz. After all, MongoDB is webscale!

Re:What's wrong with GCC? (1)

UnknowingFool (672806) | about 2 years ago | (#39986893)

From the article:

The FreeBSD developers are interested in doing away with the GPL-licensed GNU Compiler Collection and instead use the Apple-sponsored LLVM/Clang work that's under a BSD-like license.

Re:What's wrong with GCC? (1)

cheesybagel (670288) | about 2 years ago | (#39987137)

They have been interest in it since like forever. Last I heard they were working on their own (failed) compiler. It seems they decided it was too much effort and jumped in the clang bandwagon.

Re:What's wrong with GCC? (4, Informative)

vlm (69642) | about 2 years ago | (#39986931)

Aside from the more or less irrelevant licensing issue, clang is all about the source analysis tools, refactoring, rewriting support. Uses less memory and time. Both caused by lack of optimization.

Re:What's wrong with GCC? (5, Informative)

BasilBrush (643681) | about 2 years ago | (#39986947)

Avoiding te GPL is the main reason. But Clang also has many technical superiorities to GCC too. Wikipedia gives a quick outline of them.
http://en.wikipedia.org/wiki/Clang [wikipedia.org]

Re:What's wrong with GCC? (0)

Anonymous Coward | about 2 years ago | (#39987365)

I don't get this. I can understand if someone doesn't want non-copyleft license. They want to ensure that the code stays free. Why the strong feelings about BSD? Do they want to ensure that you can close the source? Why is that so important unless you are a corporation, and I think most BSD developers are volunteers. I might be wrong though.

Re:What's wrong with GCC? (2)

rev0lt (1950662) | about 2 years ago | (#39986965)

No only licensing issues, but also performance. While CLANG may not have all the bells and whistles of GCC, it does a good job compiling C code - and given that the base system is mostly C, even a small improvement in compile time (and memory usage) can make a big difference, specially for those who - like me - prefer to build and upgrade from source.
Another motive to seek alternatives (but not directly related to FreeBSD) is the lack of support of some architectures. Some "obsolete" architectures were removed post GCC 2.95, but some BSDs still support them today. Having a easy to port, actively developed, BSD licensed compiler is way better than to rely on some archaic GCC version.

Linux dev's experimenting with LLVM/Clang too (4, Informative)

perpenso (1613749) | about 2 years ago | (#39986997)

What's wrong with GCC?

Some people argue that LLVM/Clang offers better code generation, compile time warnings, and code analysis. Some compiler developers think the gcc code has become too bloated and complicated. Even gcc devs have described the gcc code as "cumbersome".

There are various efforts to get Linux building under LLVM/Clang. Especially for embedded environments.

Re:Linux dev's experimenting with LLVM/Clang too (1)

cheesybagel (670288) | about 2 years ago | (#39987237)

GCC has been rewritten a lot of times. It used to only make tree based and peephole optimizations. However now they use a form of SSA called GIMPLE. The problem was porting all the code optimizations to GIMPLE but that should have been done by now. The backend only needs to convert GIMPLE into machine code which should not be particularly hard...

Re:What's wrong with GCC? (4, Informative)

beelsebob (529313) | about 2 years ago | (#39987097)

1) It compiles slower than clang at -O0
2) It produces slower code than clang at -O3 and -Os
3) It's error and warning messages are not as good
4) It's not as modular as clang, which can be used in parts, to produce useful tools like CSA
5) The GPL.

deliberately obscured internals by Stallman et. al (1, Interesting)

rubycodez (864176) | about 2 years ago | (#39987133)

Stallman and others deliberately fought having APIs, proper documentation and to allow plugins for all parts of the GCC toolchain, to keep control of the thing.

Re:deliberately obscured internals by Stallman et. (4, Interesting)

dragisha (788) | about 2 years ago | (#39987201)

Stallman and others deliberately fought having APIs, proper documentation and to allow plugins for all parts of the GCC toolchain, to keep control of the thing.

Mostly result of dispute with DEC SRC when GCC and parent FSF failed to enforce GPL on Modula-3. Moving target known as GCC internals has been problem ever since, mostly to "legitimate" GNU compiler developers.

LLVM, on the other hand, made ingenious move with standard and open IR. Overall modular design is another boon.

GCC was in blind alleys before. No real reason for them not to survive this one. Another EGC can happen, to pull GCC in future.

in other words (4, Insightful)

phantomfive (622387) | about 2 years ago | (#39986875)

and suit well for their BSD needs

In other words, it has the license they want. GCC was a thorn in the side of the collective BSD conscience, they didn't like it.

Re:in other words (5, Interesting)

bonch (38532) | about 2 years ago | (#39987049)

One of the FreeBSD developers gave a talk about this. FreeBSD has commercial users, and the new GCC just wouldn't have been an option for them. The older license-compatible version still in FreeBSD wasn't receiving updates, and it was beginning to affect developers too greatly.

Whether this compiler switch is a good thing or not depends on how much you hate the idea of commercial vendors using open source. GCC's strictness is admiral from an ideological perspective, but certainly not from a practical one. It should be noted that even Linus Torvalds adheres to a more pragmatic worldview [linux-mag.com] :

There are "extremists" in the free software world, but that's one major reason why I don't call what I do "free software" any more. I don't want to be associated with the people for whom it's about exclusion and hatred.

It's pretty damning when Linus himself no longer refers to Linux as free software because he doesn't like the extremism of the free software movement. And why should he? He's an engineer, not a religious fundamentalist.

Re:in other words (0, Flamebait)

Anonymous Coward | about 2 years ago | (#39987223)

It's pretty damning when Linus himself no longer refers to Linux as free software because he doesn't like the extremism of the free software movement. And why should he? He's an engineer, not a religious fundamentalist.

Which is hilarious because it is the BSD fundamentalists who are re-implementing huge projects just to avoid a license they don't like for no reason other than poltical correctness. Oh right, of course, when BSD zealots flame everyone else it doesn't count as "religious fundamentalism". You fucking hypocrites.

Gcc falls short on some technical merits (4, Interesting)

perpenso (1613749) | about 2 years ago | (#39987325)

... Which is hilarious because it is the BSD fundamentalists who are re-implementing huge projects just to avoid a license they don't like for no reason other than political correctness ...

Untrue. Gcc is handicapped by political decisions in it technical design. It intentionally does not allow "others" to plug into some "internals". "Internals" that would facilitate other tool builders, especially those creating a graphical integrated development environment.

LLVM/Clang doesn't come with such technical baggage. Its modular rather than monolithic. It is a newer code base that is far easier to work with, even gcc devs moan about the bloat/complexity of their code base. Nearly all long lived project reach a point where it is better to toss the legacy code out and start from scratch, gcc may have very well surpassed that point.

And on some platforms LLVM/Clang simply generates better code.

Re:in other words (1, Interesting)

bonch (38532) | about 2 years ago | (#39987363)

Which is hilarious because it is the BSD fundamentalists who are re-implementing huge projects just to avoid a license they don't like for no reason other than poltical correctness.

Clang also addresses the lack of modularity in GCC. One of Apple's Clang engineers gave a talk several years ago about how at NeXTStep in the early 90s, he asked Stallman to implement precompiled headers in GCC. Stallman refused on political grounds. GCC was also intentionally obfuscated to make it difficult to integrate with. It's a clear example of rigid religious ideology standing in the way of and given prominence over technological progress.

Re:in other words (-1)

Anonymous Coward | about 2 years ago | (#39987251)

Yours is a very myopic view, even that of Linus. And by the way Linus is not a god, he can have interesting or completely batshit opinions. In any case in our technologically developed societies you cannot dissociate the social value of software from its technical value. Software pervade every aspect of our lives,and since the world seems to be going towards hardware controlled prisons (walled gardens all in the name of security ha ha were did we hear that ?) , the value of free software (libre software) is paramount. Licenses that give companies the option to take code improve upon it and propose a closed version is bad. Bad bad bad. There is an enormous value in collaborative growth while BSD license distorts that idea and gives companies the upper hand. I don't want a society where software is something the end user cannot control.
So yeah Fuck the BSD license the stakes are simply too high.

Re:in other words (1, Insightful)

phantomfive (622387) | about 2 years ago | (#39987355)

Talking about 'fundamentalism' and 'how bad the other people are' is childish (yes, I'm calling you childish, Bonch). Which license you prefer is a matter of preference, and it doesn't make you an extremist, dumb, religious, or even impractical. Which license you choose is a matter of preference.

1) BSD: if you want your software used by corporations, and you don't care if you get anything back as a result. You are interested in fame.
2) GPL: if you want to help people out, but don't want a corporation to make millions without giving back. Your code might not get used as much, but you're fine with that.

Both of these are great licenses from people who are giving their hard work away for free. Insulting either one as 'religious' or 'unethical' is incredibly unseeing and idiotic. The license you choose is a preference, nothing more.

Re:in other words (1)

ommerson (1485487) | about 2 years ago | (#39987383)

There's also the awkward truth that the vast majority of Linux run-times sold are in mobile phones and other embedded devices and a very, very long way from being 100% open source software.

Re:in other words (5, Insightful)

cupantae (1304123) | about 2 years ago | (#39987103)

It's not quite as simple as that. The development of Clang is being funded by Apple. They need a BSD license so that they have the freedom to make further modifications down the line (without leaving them open). Yes, I'm a GPL advocate. No, I don't agree with Apple's ideology. But it's the case anyway.

In any case, it doesn't do us any harm to have an underdog in the world of open source C compilers. If you only have one option, then people start treating even the programme's eccentricities as standards. The need for compatibility encourages people to document. Not to mention that the different attitude taken in Clang from the offset means that it may be more suitable for certain applications. This page [llvm.org] makes for some interesting reading.

Re:in other words (-1)

Anonymous Coward | about 2 years ago | (#39987135)

and suit well for their BSD needs

In other words, it has the license they want. GCC was a thorn in the side of the collective BSD conscience, they didn't like it.

And yet that community bitches and moans like there is no tomorrow when the linux community decides to improve upon its own ecosystem without regard to BSD people. If the BSD license is so superior why then IBM, Redhat or Oracle are not using it ? It's far easier to take and improve than take, improve and share with others.

GPL is about collaborative growth, BSD is well a free for all. Ergo the GPL is and always will be superior to the BSD license.

"article" (0)

Anonymous Coward | about 2 years ago | (#39986883)

I think "article" is a bit generous.

Code quality will suffer (0)

hpa (7948) | about 2 years ago | (#39986903)

There are a number of things attractive with LLVM/Clang: the code base is cleaner, some people feel better about the license, and so on. The quality of the generated code, however, is significantly worse, at least at this time.

Re:Code quality will suffer (4, Interesting)

bonch (38532) | about 2 years ago | (#39986963)

I've heard positive and negative claims regarding this. Certainly, Apple thinks it's production-ready (I think it was Xcode 4.2 that they stopped shipping GCC). Do you have a link showing that generated code is significantly worse? Which versions were compared?

Re:Code quality will suffer (-1, Flamebait)

cheesybagel (670288) | about 2 years ago | (#39987243)

Like Apple cares about performance. If they did they wouldn't be using Mach.

Re:Code quality will suffer (0)

Anonymous Coward | about 2 years ago | (#39987337)

Are you a timetraveller from 1998? Nobody cares anymore what kernel people are using.

Code quality may vary with platform (3, Insightful)

perpenso (1613749) | about 2 years ago | (#39987353)

The quality of the generated code, however, is significantly worse, at least at this time.

That may not be accurate. My understanding is that on some platforms LLVM/Clang has the advantage.

GPLv3 (5, Insightful)

bonch (38532) | about 2 years ago | (#39986915)

Having all this great open source compiler technology competing with each other is great, but one does wonder if the alienation caused by GPLv3 was worth it, as it is the primary reason both Apple and FreeBSD embraced Clang (in fact, Apple started the Clang project). As a result, GCC wasn't updated past GPLv2 on either platform. Apple couldn't integrate GCC with their IDE like they wanted, nor could FreeBSD's commercial clients work with it. Flexibility and pragmatism usually wins out over rigidness and ideology.

Re:GPLv3 (1)

rev0lt (1950662) | about 2 years ago | (#39987041)

There has been some effort in replacing GCC in BSD systems at least since the 2.95 shift. The GPL licensing of GCC was always obviously a problem, but the discarding of some architectures and the bloat of the latest versions did not help either. A couple of years ago the OpenBSD team did a port of PCC to replace GCC as the base compiler for the system, and for a "big" operating system like FreeBSD, compile times do make a difference.

Clang vs GCC (1)

Anonymous Coward | about 2 years ago | (#39987055)

While both compilers are very good, I find myself preferring Clang both on technical and licensing merits. Putting aside the license for a moment, Clang gives better warnings/errors. They are clearly defined and easier to read. In addition I've found some GCC warnings are not accurate. To date Clang hasn't given me any bad advice.

Re:Clang vs GCC (0)

Anonymous Coward | about 2 years ago | (#39987307)

Clang's warnings are fantastic, especially when dealing with deep templated stuff (STL anyone?), but the performance gap is too great for me to consider using Clang to actually generate production code. I've worked with build chains that compile twice -- Clang for warnings/errors, and gcc for actual code generation.

Re:GPLv3 (1)

Alex Belits (437) | about 2 years ago | (#39987105)

Apple couldn't integrate GCC with their IDE like they wanted

If you can't integrate gcc into an IDE, you have shit IDE. I mean shittier IDE than Eclipse, and that's a shit IDE already.

Re:GPLv3 (2, Insightful)

Anonymous Coward | about 2 years ago | (#39987221)

They can't integrate it because of the GPL not because of any technical reason. Stop being obtuse.

Re:GPLv3 (1)

PhrostyMcByte (589271) | about 2 years ago | (#39987229)

Clang aims for more integration than "compile & debug". IDEs can directly use Clang libraries for syntax highlighting and error diagnostics. It was my understanding that GCC lacked this functionality and an old, large, and complex code base made it unrealistic for such a large feature addition to be worked on by mere mortals.

I'm sure not having to work with GPL is a definite plus for Apple, but this is the first time I've heard of licensing being a big reason for Clang's existence.

Re:GPLv3 (1)

bytesex (112972) | about 2 years ago | (#39987369)

It could be a combined issue; where Apple wanted to integrate those features into GCC, but then keep them for themselves (lest not to supply any 'competition' with it). Given the fact that it would be a large effort, not so strange.

Re:GPLv3 (0)

whoever57 (658626) | about 2 years ago | (#39987115)

Apple couldn't integrate GCC with their IDE like they wanted, nor could FreeBSD's commercial clients work with it. Flexibility and pragmatism usually wins out over rigidness and ideology.

Seriously? I can understand the desire to move to a BSD license from GPLvX, but how do the changes from GPLv2 to GPLv3 make it impossible for Apple to use it? Frankly, it looks like the rigidness and ideology was at 1 Infinite loop, not elsewhere.

Re:GPLv3 (1)

whoever57 (658626) | about 2 years ago | (#39987147)

I should clarify, by "it" (in "how do the changes from GPLv2 to GPLv3 make it impossible for Apple to use it?"), I mean specifically GCC, not the GPL or other GPL-licensed code.

Re:GPLv3 (1)

jonwil (467024) | about 2 years ago | (#39987331)

There are 2 big reasons I can think of why Apple may not want to use GPLv3 GCC:
1.Patents. By using (and releasing) a GPLv3 version of GCC, the extremely patent grant in the GPLv3 kicks in. This would probably require Apple to grant patent rights for things it doesn't want to grant rights for.

and 2.GCC includes a number of libraries and pieces of code that gets hipped alongside gcc-compiled binaries, most notably libgcc and libstdc++

I dont know the official position and I am not a copyright lawyer but I suspect that legally shipping these libraries (libgcc, libstdc++ etc) requires following the GPLv3 including the anti-tivoization clause. This would mean that it would be impossible for Apple (or anyone else) to use the newer GPLv3 GCC and libraries to build any software for an Apple device (iPhone, iPad, iPod, Apple TV) that has software locks.

Re:GPLv3 (1)

laffer1 (701823) | about 2 years ago | (#39987175)

The tivo clause for one. Apple ships DRM and uses EFI. Lock in is part of their ecosystem. It also causes great problems with iPhone and iPad development.

Don't ask yourself why apple switched, ask yourself why the Linux kernel is still GPLv2.

Re:GPLv3 (0)

Anonymous Coward | about 2 years ago | (#39987377)

The linux kernel is still gpl v2 because when Linus released linux he removed the or any other later version of the gpl clause. Since the there's been a few thousand developers who have contributed to the linux kernel, so tracking them all down to get permission to change the license would be pretty much impossible.

Re:GPLv3 (0)

Anonymous Coward | about 2 years ago | (#39987275)

While this explanation sounds good, I think the reality is a bit more subtle. Pragmatism does not create software; programmers (and resources to support them) create software. For many companies, like RedHat, IBM, Intel, etc, the GPL license is fine and they are happy to contribute to GCC development. Clang exists because Apple decided that the GPL was unacceptable (and also that GCC was too clunky) for their purposes and they were willing to use their vast resources to create an alternative. LLVM had a diverse developer base before Apple, but Clang has come into being mostly through the sheer force of Apple's will.

If Apple had not put up the money, I think the pragmatism of the BSD license and *BSD community would still not have created a viable competitor to GCC.

Re:GPLv3 (1)

cheesybagel (670288) | about 2 years ago | (#39987297)

Yes it is worth it. Who cares about Apple anyway. It is only a matter of time until they decide not to contribute anything anymore. Regarding making parts of GCC LGPLed because of things like incremental compilation and such last I heard Stallman was considering it. He probably just doesn't have a clear picture of the use case yet.

FreeBSD's commercial clients... probably more routers, etc, using Linux today than BSDs.

sex w1th a troolkore (-1)

Anonymous Coward | about 2 years ago | (#39987075)

and thaT the flooKr

Please review my source code mods (1)

Anonymous Coward | about 2 years ago | (#39987101)


#include <stdio.h>

#if defined( __GNUC__)
static char* world_type = "free ";
#elsif defined(__clang__)
static char* world_type = "unencumbered ";
#else
static char* world_type = "";
#endif

int main( int argc, char** argv )
{
    printf( "hello, %sworld.\n", world_type );
    return 0;
}

Apple already deprecated GCC too in Xcode 4 (0)

Anonymous Coward | about 2 years ago | (#39987153)

Apple switched to LLVM with Xcode 4 so they could bring Xcode into the modern IDE world. GCC and all its wacky GPL shit makes integrating into an IDE a legal minefield and mostly unworkable. On the other hand they also integrated Linus' git as the preferred version control so it's not an anti-GPL thing on principle but building a full IDE around a GPLed compiler is just not going to work out.

wrong (1)

101percent (589072) | about 2 years ago | (#39987171)

If you're on slashdot and you just discovered that Apple hates the GPL, youre wrong. Your first clue was when they banned GPL from the crap store.

Not a bad idea (5, Insightful)

gman003 (1693318) | about 2 years ago | (#39987207)

I've found that code that will compile properly under a variety of compilers tends to be of better quality.

One of my current projects started out on an old 2.x branch of GCC. When I finally got around to updating to a current GCC, I had to fix quite a few bugs before it would actually work - the different compiler was catching problems I hadn't noticed before.

Same when I tried compiling it under Visual Studio, or Clang - the more compilers I made it work under, the less bugs there were in the code.

Now, if a given program actually uses some special feature of GCC, that's fine - if only one compiler will do what you need, that's fine. Or if it's too much work to maintain a "port" - I stopped maintaining the VS project files a while ago, since I no longer used it. But if you have a chance to at least test it against a different compiler, go ahead and give it a shot.

Re:Not a bad idea (1)

rubycodez (864176) | about 2 years ago | (#39987399)

But in this context we're talking about operating system kernel and system libraries, those ALWAYS need compiler specific features. Just to make Linux compile on another compiler means modifying the code AND/OR the compiler, as Intel did

What can be wrong with Clang! (0)

aglider (2435074) | about 2 years ago | (#39987255)

Run time optimizations can be (are?) a very bad idea in a kernel, where very often the exact predictability of execution paths makes the difference between a working kernel and a misbehaving one.
Clang can be a good solution for application programs, though, where a LLVM failure "just" harms a process.
I am also concerned with different architectures running the same "binary" produced by Clang.
But that's only my opinion.

Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...