FreeBSD Removes GCC From Default Base System
An anonymous reader writes "With the LLVM/Clang migration, FreeBSD developers have now disabled building GCC and the GNU C++ standard library (libstdc++) as part of the FreeBSD base system. GCC and libstdc++ have been superseded by LLVM's Clang and libc++, respectively, on primary architectures for FreeBSD 10.0."
You can still flip a few switches to get GCC, but the system compiler will still be clang. Update: 09/11 14:50 GMT by U L : Reader Noryungi noted that the What's Cooking for FreeBSD 10 page is also worth a look, adding "I have to say, this is shaping up to be a very interesting release. Bhyve [the BSD hypervisor], in particular, sounds very promising."
"the system compiler will still be clang"
Or the Onionequse version: FreeBSD's move to revolutionary new swording system adds a whole new meaning to compiling
Can LLVM's Clang build the Linux kernel and QT/KDE?
I would love to have a Linux system,(not android), completely free of GNU.
Try this one: https://wiki.freebsd.org/WhatsNew/FreeBSD10
I have to say, this is shaping up to be a very interesting release. Bhyve, in particular, sounds very promising...
The right to offend is far more important than the right not to be offended. (Rowan Atkinson)
See this link for an explanation:
http://unix.stackexchange.com/questions/49906/why-is-freebsd-deprecating-gcc-in-favor-of-clang-llvm/49970#49970
In short, mostly it's due to FreeBSD's issues with the GPL, not all of which are purely philosophical (it affects their funding, for one thing). On the other hand, if you don't have a beef with the GPL, it's probably best to stick with GCC, which produces more performant code.
A world where we can call it Linux and the nerd who immediately corrects you with GNU/Linux will have to shut up for once?
Especially GPLv3 which they don't want to include in their base OS. Ports are fine thouh since they are not part of the operating system itself. GPLv2 was never a problem.
For many reasons.
Clang is faster
Clang produces faster code
Clang's license is BSD (and hence more in line with FreeBSD's philosophy)
Clang has built in static analysis tools
Clang's error messages are easier to understand than gcc's
Clang has better support for C++11 than gcc
Clang's code base is much less convoluted than gcc's, and easier to work on
Clang's code base is more modular, which allows you to easily use separate stages of the compiler in other tools
Probably a bunch of reasons I've forgotten too
The real question is actually, why are so many people stubbornly sticking to gcc when clang has surpassed it in pretty much every way.
Licensing.
GCC in the FreeBSD base is stuck at v4.2.1 as that was the last version licensed under the GPLv2. As this is about 7 years old by GCC standards a newer compiler is a welcomed change and since CLANG is BSD-licensed it is more in line with the project's goals anyway.
Fully licensed blockchain psychiatrist
Clang is faster
Clang produces faster code
Really?
Clang has better support for C++11 than gcc
They had almost equal support for C++11 when I check earlier this year.
Clang's code base is much less convoluted than gcc's, and easier to work on
Clang's code base is more modular, which allows you to easily use separate stages of the compiler in other tools
I think that depends on the reader.
The real question is actually, why are so many people stubbornly sticking to gcc when clang has surpassed it in pretty much every way.
Because it's a good compiler. Both gcc and clang are good compilers. They didn't stop developing gcc just because clang came around and started to make progress.
Sorry, but it's you that looks like a douche.
By inspecting the source code.
Execution speed is not necessarily the only metric used to judge a compiler. As a developer for embedded platforms I mostly look at code size, and you could also judge it on how well it handles various CPU architecture varieties.
Then again, your argument still stands. He could've written "better". ;)
c++;
For many reasons.
Clang is faster...
No its slower. Phoronix benchmark GCC vs Clang all the time. http://www.phoronix.com/scan.php?page=article&item=llvm_clang33_3way&num=1
I don't think I've seen Ken Thompson's Reflections on Trusting Trust come up more in the past decade than it has in the past week. Right now seems like a particularly inauspicious time to switch to a one-compiler-to-rule-them-all strategy.
I'm particularly interested in trying to build the gcc phase-1 bootstrap compiler with llvm to see how that works out (TODO list...).
My God, it's Full of Source!
OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
I'd have to agree with the "anti-performant" sentiment. It isn't cromulent to say "performant" if don't want to sound like a douche. It makes it seem like you're trying to embiggen yourself.
Yet another reason not to say 'performant', it's ambiguous.
John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
It's faster because it doesn't support as much optimization. Some analysis simply isn't implemented. That isn't to say it won't be faster when it's on even footing; just that right now huge swaths of algorithms are missing, so the output code doesn't perform as well but it does get produced in much less time.
Support my political activism on Patreon.
Redundant, keep reading the whole "What's New" page and the conspiracy klaxon attached to your tin-foil hat will go into hyper-overdrive...
"
Support for the RDRAND random number generator
Status: ...although it would seem more likely that Konstantin Belousov would be working for the FSB rather than the NSA really. ;^)
Committed to -CURRENT, MFC-ed to 9-stable
Author:
Konstantin Belousov
Web:
http://svn.freebsd.org/changeset/base/240135
RDRAND is the new Intel's CPU instruction for accessing its hardware random number generator, also known as the code-name Bull Mountain. It is present in Ivy Bridge and newer CPUs.
"
Regards, Phil
Your MOM is a riposte
Because GCC is a total mess internally and Clang/LLVM is neat, clean, maintainable, adjustable.
GCC is a dead end. LLVM is the future.
The real question is actually, why are so many people stubbornly sticking to gcc when clang has surpassed it in pretty much every way.
I'm all for replacing GCC.
Does clang handle all the GCC extensions to C yet? Or is the (better) approach of getting rid of them being taken instead? The last I heard it was still a bit of a mess.
It's exactly as vague and ambiguous as 'better', while sounding pseudo technical. Something a PHB would parrot.
John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
And a more performant one at that.
That is insufficient, as Ken Thompson demonstrated decades ago.
I am officially gone from
I'm fuzzy on licensing. I know you can take FreeBSD and Clang/LLVM and make a proprietary product out of it. But can you fork them and release your fork under the GPLv3?
Maybe in all seriousness the best option for the Free Software Foundation and GNU Project in a few years would just be to make a GPLv3 fork of the most recent LLVM. The Phoronix benchmark put highly optimized GCC code as slightly faster than optimized LLVM code in a few cases, but in return for dramatically slower compile times. You're already working with C and C++, is a 4% performance improvement worth losing an extra few hours to week waiting for your compiler to finish?
The two dictionaries I checked, including Merriam-Webster, don't list "performant" as a word.
Trying so hard to use "big words" that you resort to using non-words that sound big = douche. Of course "douche" is actually a word.
Support for the RDRAND random number generator
Now you can go "WHY????"
Python: 'And then suddenly you have a language which says "we're all stuck with whatever the whiniest coder wants".'
Because RMS made it!!!
I think it is most likely due to the large set of OpenSource Apps written in GCC and people really don't want to risk trying a different compiler.
If something is so important that you feel the need to post it on the internet... It probably isn't that important.
OpenBSD leader Theo states that there are 7000 users of GCC.
I'd like to see how de Raadt came up with THAT number. Seems very low to me. Accross the world? Or is that a blanket, unqualified statement? 7K users of GCC? Come on...
Python: 'And then suddenly you have a language which says "we're all stuck with whatever the whiniest coder wants".'
GPL2 was also a problem, that was the current license when the various BSD started to explore alternate compilers. The BSD want the license for all wares in the core install to be BSD
I've not had that experience when reading the gcc source code. Maybe that used to be the case, gcc has been around for some time.
it's origin is Microsoft wank speak.
It is a French word, maybe that Microsoft weenie also said things were tres this or that. eurotrash wannabe.
Not if all you want to do is verifying the source code. If your compiler is compromised then that's your problem.
People are using BSD (and BSD code) in devices and products (consumer products and otherwise) where there is a requirement (might be a requirement specified by some law or regulation, might be a requirement specified by a content provider or other entity, might be a business requirement, might be something else) to ensure the software on the device can't be changed by the end user. And using a gplv3 version of GCC (and libstdc++/libgcc/etc) creates a conflict between the anti-tivoization clauses in gplv3 and the requirements of the software developers to prevent tampering with the software.
The AC used to be correct, but gcc have been trying to clean up more recently. (Most likely, at least partly because competition from clang meant that trying to lock out third-party closed-source plugins wasn't a particularly useful thing to do anyway.)
(1)DOCOMEFROM!2~.2'~#1WHILE:1<-"'?.1$.2'~'"':1/.1$.2'~#0"$#65535'"$"'"'&.1$.2'~'#0$#65535'"$#0'~#32767$#1"
I'm deeply disappointed that this issue was decided over philosophical instead of technical merits. If Clang was superior to GCC in the majority of benchmarks, then I would support this decision. But that’s not the case, GCC is still leading in most benchmarks and can be an order of magnitude faster when the popular OpenMP library is used.[1] Sadly, BSD users are the losers here.
[1] http://www.phoronix.com/scan.php?page=article&item=llvm_33svn_competes&num=5
My reason not to use clang: clang produces larger code than gcc. 10-20% larger, in many cases. For some reason gcc developers are much better at size optimization.
Faster isn't the same as higher performance.
Think of me when you shave your legs...
Did you try a computer jargon dictionary? Formal dictionaries do not add jargon until it is no longer jargon.
'Performant' is not jargon because it is not used to communicate a specific technical meaning within a particular field of knowledge. It is slang: an unrecognised synonym for 'better', used by people who want to make a vaguely positive but non-specific claim. In this case, suggesting that GCC 'produces more performant code' could imply that it produces an output that executes faster, or is smaller, or is a more exact interpretation of the source with respect to the official language standards or a host of other possible claims. In other words, it's equivalent to saying 'produces better code'.
Trying so hard to use "big words" that you resort to using non-words that sound big = douche.
So what you mean to say is, "durr, people who are smarter than me are douches."
Using made-up words is not a sign of intelligence. Smart people know how, when and whether to use the more obscure parts of the English language.
The two dictionaries I checked, including Merriam-Webster, don't list "performant" as a word.
What was the other dictionary?
I'm deeply disappointed that this issue was decided over philosophical instead of technical merits. If Clang was superior to GCC in the majority of benchmarks, then I would support this decision. But that’s not the case, GCC is still leading in most benchmarks and can be an order of magnitude faster when the popular OpenMP library is used.[1] Sadly, BSD users are the losers here.
[1] http://www.phoronix.com/scan.php?page=article&item=llvm_33svn_competes&num=5
So what would you prefer? That BSD threw out their entire licensing policy and adopted the GPL3? Or that they stuck with an old version of GCC that was licensed under the just about permissible to them GPL2 but that got no updates.
Maybe they could have forked GCC then tried to maintain a version that was licensed under GPL2 and backported GPL3 GCC fixes into their fork but that strikes me as being a legal nightmare to be honest.
It would have been more useful it phoronix compared LLVM/Clang 3.3 to GCC 4.2.1 and you posted that as that is the only thing the BSD community could use instead.
This decision was forced by the GCC adopting the GPL3 but was probably always going to happen sooner or later. The BSD community and the FSF have VERY different ideas of what constitutes "free" software with the FSF actually wanting their code to be less free in order to make sure that if you use it you have to let other people see how you use it and keep any derivatives free.
I dont read
Note to self: Using words that aren't words is an excellent way to troll.
I (unknowingly) used something that isn't actually an english word. You took the time to look it up in two separate dictionaries basically just so you could be pedantic. If you're that kind of person, I'm glad I could waste your time. :)
True. I should have written that it wasn't a problem to include it in the distribution, even if it wasn't optimal.
Isn't hard to read code more or less the same as closed source code?
I'm seeing a lot of "there might be" but none of that is actually possible.
The output of GCC is not GPL'd any more than the output of Microsoft Visual Studio is licensed under the Microsoft Closed Source license.
The output of the GCC cannot cause the code produced to be under the GPL restrictions.
CAN.
NOT.
"And using a gplv3 version of GCC (and libstdc++/libgcc/etc)"
There is not GPL3 libstc/libgcc/etc.
And again, that doesn't any of those "might" to "ensure the software on the device can't be changed by the end user." cannot be applied.
Moreover, those requirements that "might" exist are also illegal restraints on first sale/ownership doctrine/etc of many countries, so by insisting so, the BSD clause is enabling criminal acts.
" the anti-tivoization clauses in gplv3 " DO NOT APPLY to the output of the GCC.
They DO NOT APPLY to the product that merely aggregates the GCC in the product.
Indeed, if the GCC OR ANY COMPILER is included in the product, then how the HELL are you supposed to expect you are going to have restrictions to "ensure the software on the device can't be changed by the end user." WHEN THE ONLY USE FOR INCLUDING A COMPILER IS TO DO THIS???
Again, I ask "Why?"
Your response is nonsensical paranoic nutbar wordsalad.
Appropriate captcha "Cobblers". Precisely what I think.
The freedom to not offer freedom. No one is forced to use your software.
That "reason" is no better than "FreeBSD is not using Clang because of licensing" because it isn't using an earlier version of the BSD license that asked for included attribution.
They're entitled not to like it, but that doesn't mean they have a REASON not to use it.
BSD are just pissed off that they don't get the adulation they feel they deserve for sucking the cock of private industry.
And neocons applaud them for the service.
OK, really: do you seriously expect BSD not to stick with BSD Licensed code? It's pretty much the point of the exercise. YouBetterSayGNULinux is there if you want it - you can have all the GNUs you want. BSD is not and should not be a Linux distro - it's its own thing, older and with a different mindset.
Socialism: a lie told by totalitarians and believed by fools.
Cheaper is a performance metric with money as the denominator. The others are reaches that would be excluded by context.
John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
"The goal of the FreeBSD Project is to provide a stable and fast general purpose operating system that may be used for any purpose without strings attached."
So, yes, more in line with the project's goals. But I'm still waiting for FreeBSD to switch to WTFPL, since clearly the whole disclaimer of warranty is a very-much strings attached component of BSD licensing that I don't see ever going away. After all, given that a big part of FreeBSD support is corporate funding and corporations just love suing each other over all sorts of ridiculous things, included things like implied warranty.... Really, the BSD licensing is just tying their hands.
Eurohacker European paranoia, gun rights, and h
You can't relicense somebody else's code. You can use the code however you like, but you're required to use the code only with the license intact.
It gets a little bit odd when you mix GPL code into the mix. But, the GPL code is usually segregated to keep it from contaminating the rest of the code. So, when you compile it the resultant binaries would be GPL, but only the portion of the source code that was GPL is GPL. Or at least that's how it was under the GPLv2, not sure what GPLv3 really does there.
Using APIs and ABIs that are based upon GPL code does not require that the binaries be GPLed either. I'm not quite sure as to what the problem here is with the GPL, but it's a GPLv3 specific problem.
However, if you compile the LLVM/Clang in another compiler (say GCC) then you should be good, injecting "compile into" backdoors into all compilers, to target all compilers, would definitely be noticeable.
DEMETRIUS: Villain, what hast thou done?
AARON: Villain, I have done thy mother.
Shakespeare invents 'your mom'
tl;dr Apple is allergic to the GPL v2, and really allergic to the GPL v3. They were never happy about gcc being their base compiler, so they've been funding the hell out of LLVM/Clang so they can use that as their base compiler instead. Apple is also the main backer of FreeBSD.
http://rocknerd.co.uk
Is it not?
In the long run this is really going to suck for the Sony engineers, maintaining a fork with a different system compiler.
Microsoft will give you a "single pane of glass" for "future stars" to view all the "innovations" and "mentorship" in a "major paradigm shift" to "foster success"
This would only be an issue if the "consumer device" were shipped with GCC on it. The complied result ("binary") from GCC is not bound by GCC's license -- if that were true, the entire world is violating the GPL.
The simple truth is FreeBSD purists have always had their panties in a wad from anything and everything that wasn't "BSD licensed". The changes in GPLv3 have been enough of bad taste to get the rest of the gang to agree enough is enough.
BSD think of the freedom of the distributor, the GPL thinks of the freedom of the user. I see myself as a user, you see yourself as a proprietary distributor.
FFS, I have had it with the "USER" bullshit. Real end users "use" the system and care more about usability than access to the source code. Most of them would not know how to write any code let alone audit it. Stop confusing yourself, an interested third party, with end users. You might also be a user but not all users are interested third parties with coding skills.
The end user's "freedom" is actually limited when nerds argue over licensing terms and are unable to include some software because of it. I am a developer and a user and I find BSD for be free enough. It offers me the choice of proprietary implementation of a BSD project's code, open source BSD implementations and the ability to create my own proprietary implementation for me and my friends without having to hire a lawyer. I can also choose to contribute some or all of my modifications back to the community if I so choose. That is true freedom. The GPL is actually a form of slavery that you agree to enter into in order be able to modify the code. I would rather "pay" money and keep my freedom thank you very much. The price that the GPL imposes is too high a price.
Jesus was a compassionate social conservative who called individuals to sin no more.
I voted for Clodos
“He’s not deformed, he’s just drunk!”
FreeBSD/amd64
FreeBSD/ARM
FreeBSD/i386
FreeBSD/ia64
FreeBSD/MIPS
FreeBSD/pc98
FreeBSD/ppc
FreeBSD/sparc64
FreeBSD/xbox
I guess they dropped 68k...
Since the FreeBSD Kernel is BSD licensed, it only makes sense to have the entire base toolchain BSD licensed as well. This is a big step in that direction. There is also a broader project to create BSD licensed versions of all of the core Unix utilities as well. Hopefully we will see this happen soon.
FreeBSD is a fully open source operating system, with source code everyone can read and freely share. it is a "Free Software" system. If you mean that it doesnt have a license that tells you that you cannot link FreeBSD code to code under other licenses, then yes you are correct about that, and FreeBSD has always been this way, being a BSD licensed OS, which is why many people choose to use it. FreeBSD already has a BSD licensed kernel and always has.
It's clearly stating some basic facts:
1) XKCD isn't funny.
2) References to XKCD aren't needed here at /., nor anywhere else.
Someone who doesn't know the difference between a "fact" and a "subjective opinion" has no business bitching about anyone else's English comprehension or probability of a learning disability...
There may be some undiagnosed medical condition preventing you from thinking in a clear, rational manner.
Luckily, in you're case, it was identified years ago. I believe the current nomenclature is "recto-cranial inversion." Please, seek the help you need.
They're better at optimization - period. The only people that do it better are the people who built the processor. (read: intel -- icc, but don't try building the linux kernel with it, as there's way too much "gcc-ness" in the source code.)
(Also, Sun made a better sparc compiler than gcc, back in the day)
And yes, I typoed your/you're. I am now aware of this.
In that case, I think you CAN shoot the messenger...
Tomorrow is another day...
I will take a compiler that optimize less and make sure code is correct against one that try roo hard and break the software.
Tomorrow is another day...
now if we could only move Fotran too.
They say in their attempt to justify not wanting any GPL licensed stuff near their stuff that they believe that free code should have NO STRINGS ATTACHED.
IF this were actually the case (note: it is NOT), then they would be 100% fine with slapping a GPL license on the BSD code.
After all, the ORIGINAL code is still available under BSD, right? That's the line about BSD code being taken propriatory, isn't it? That the original is still there for you to have?
Not, apparently, when you take it GPL.
Why?
Because they have a rabid hate for GPL because they are first, foremosed and only developers and they think users should just fucking sit back and take what they have or be a developer themselves if they want any rights.
Technically not true. There is lots of BSD-originated code in proprietary systems. The Windows version of the command-line FTP client that ships with Windows is a good example.
Not mutually exclusive. The algorithms can be implemented correctly, but will still take more time. The output will be of better quality, of course.
GCC suffers a lot from trying to change the underlying behavior into a static single assignment model when it was already mature. This is a good model, easy to analyze and ensure correctness; but rewriting a hell of a lot of complex code that does complex analysis to instead do the same analysis on a different type of data can result in errors. Initial implementation means understanding the internal representation, understanding the optimization, and understanding manipulation; re-implementation means understanding the old and new internal representations, understanding the optimization, understanding how the optimization is implemented, and understanding the old and new manipulation, and then figure out how to rewrite one piece of code to bring in different data and operate the same logic on it and then perform the same manipulation via a different mechanism.
When you think about it, GCC is a really hard core piece of software and showcases some excellent work. Clang will probably be better quality because they're doing it the best way to start with, and so they can focus on getting it correct the first time instead of trying to rewrite existing correct code into new code that uses a different mechanism without breaking it.
Support my political activism on Patreon.
I'm deeply disappointed that this issue was decided over philosophical instead of technical merits. If Clang was superior to GCC in the majority of benchmarks, then I would support this decision. But that’s not the case, GCC is still leading in most benchmarks and can be an order of magnitude faster when the popular OpenMP library is used.[1] Sadly, BSD users are the losers here.
[1] http://www.phoronix.com/scan.php?page=article&item=llvm_33svn_competes&num=5
So what would you prefer? That BSD threw out their entire licensing policy and adopted the GPL3? Or that they stuck with an old version of GCC that was licensed under the just about permissible to them GPL2 but that got no updates.
Maybe they could have forked GCC then tried to maintain a version that was licensed under GPL2 and backported GPL3 GCC fixes into their fork but that strikes me as being a legal nightmare to be honest.
It would have been more useful it phoronix compared LLVM/Clang 3.3 to GCC 4.2.1 and you posted that as that is the only thing the BSD community could use instead.
This decision was forced by the GCC adopting the GPL3 but was probably always going to happen sooner or later. The BSD community and the FSF have VERY different ideas of what constitutes "free" software with the FSF actually wanting their code to be less free in order to make sure that if you use it you have to let other people see how you use it and keep any derivatives free.
gcc being gpl v3 does not effect the output of the complier only code linked to or borrowed from it
---Saying gnome 3 is better than windows 8 not so much a compliment as it is damning with light praise.
[Clang] is also has much better diagnostics and c++ support so it is a positive change.
It's also a lot more modular, reputedly (I've not verified that myself), and seems pretty fast to build. Mind you, I'd only really be interested if they were to work more on the stability of the ABIs of critical support libraries. Having to recompile for each version of libstdc++ was really annoying, given that maintaining a whole Linux distribution was never a desired personal goal of mine. Being able to ship the same binary to all users is nice, but even just one version per broad platform is better than what happens all too often.
I think it's a shame that open compiler projects can't share more, even if just their techniques and not the code itself. I can see that the difference in license and philosophies behind them would push the camps apart though.
"Little does he know, but there is no 'I' in 'Idiot'!"
If you took one line of microsoft code and put it in your BSD project, you'd be in jail!
And, here's a weird idea: if you want the code, you can ask for permission.
You know, ASK.
Alternatively you can license YOUR code as GPL. That's free according to the FSF too, which you appeal to as authority on freeness.
And guess what: that code you made GPL that was yours: YOU CAN STILL RELEASE IT BSD! Just not with that one line of GPL code.
If you don't like this, then get copyrights ruled null and void.
This would only be an issue if the "consumer device" were shipped with GCC on it. The complied result ("binary") from GCC is not bound by GCC's license -- if that were true, the entire world is violating the GPL.
So what happens with OpenGL or OpenCL, where code is compiled at runtime? That's the real reason why Apple found gcc 4.3 and later unacceptable, and I have some suspicion that was actually a reason for the license change. There are plenty of other places where compilation happens at runtime, like JavaScript.
Several reasons:
1) GCC dropping support for so called Obsolete Hardware that Freebsd still supports. This makes it impossible to use the same compiler version across all hardware.
2) GCC optimizations do not 100 percent produce identical binaries due to optimizations chosen by the compiler. This is a critical Security Issue that has been addressed with LLVM/Clang - speed isn't important at this time. A toolchain that produces 100 percent duplicate binaries was the requirement on all hardware that BSD supports.
3) GPL issues - don't know/don't care as the Second issue is critical while the first was very important. Some of the hardware that BSD still supports isn't supported by anything later then GCC 2 (that's 15-20 year old hardware) think it's some mission critical systems they're being paid to support so worth the time/effort to solve the hardware support removal issue by the GCC devs.
Guess what, you can't even use i386 for GCC anymore because they're supposedly obsolete yet they're still mission critical for the U.S. Government and Miltiary systems, meaning it is not obsolete but the GCC team removed support for the hardware anyway. Well since the Government isn't paying for support to GCC, Guess we can remove hardware that's a pain to support and isn't "Oh Shiny!" That was one of the big reasons given for the LLVM/Clang project 5-7 years ago AfaiR - found it interesting at the time and hoped they'd succeed as it apears they did.
Mod me up/Mod me down: I wont frown as I've no crown
It's faster because it doesn't support as much optimization. Some analysis simply isn't implemented. That isn't to say it won't be faster when it's on even footing; just that right now huge swaths of algorithms are missing, so the output code doesn't perform as well but it does get produced in much less time.
On the other hand, the Clang static analyzer alone is worth burying gcc in a big, big hole and leaving it there forever.
We aren't talking about OpenWhatver, or JavaShit. We're talking about GPLv3 versions of GCC. It's all but unheard of for gcc to be included on a shipping consumer product -- DVR, NAS, router, switch, access point, cellphone, voip phone, pocket watch, coffee maker, network card, and so forth.
FreeBSD has a passable compiler toolchain that isn't beholden to GPL, and they're running with it. Go for them. Someday it might produce code as small, fast, and efficient as gcc. (it you've ever worked with gcc source, you know what it's like to claw your eyeballs out. I don't practice that voodoo anymore.)
I sort of have to stick with it, since I need it as a cross compiler, LLVM is not very tried and true with non-Intel processors. Plus it's a lot of code to patch up to make it work. Inline assembler and stuff like that. The "gcc" on MacOS was completely bonkers since it claims with preprocessor macros that it's GCC and yet it uses LLVM on the backend which broke code (again, inline assembler).
Utlimately so many systems rely on GCC because it's been the de-facto standard for so long. Build scripts that parse for errors and warnings, "well known" command line options, and so forth. Be interesting to see how much stuff breaks.
Cranial Rectomitus is the term for this affliction that I learned. Has it been updated?
Agent K: A *person* is smart. People are dumb, stupid, panicky animals, and you know it.
In practice, if you want to install a port on FreeBSD that needs to be compiled with gcc instead of clang, the installation will just pull gcc in as a build dependency. Other than the fact that the compilation will take a little while longer, you probably won't even notice it.
That applies in all cases. Even with public domain software. You cannot add a license unless you own the copyright to it.
Sure it's true. And that's why for years MS Windows had that BSD advertisement clause included in the software.
So you think we should scrap GCC all-together as well, and all switch over to Intel's C Compiler (ICC), since it's technically better?
After all, you think philosophy doesn't matter...
And GPLv3 incompatibilities with the project are more than just abstract "philosophical" differences, as it can impact use and distribution of FreeBSD.
Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
Useful error messages are a technical merit. It makes development much easier. So they traded run-time vs. development time here.
Clang produces faster code
Except according to all benchmarks.
Clang's error messages are easier to understand than gcc's
If you compare current Clang to old GCC then yes. If you use a new GCC, you'll see that it has much improved the error messsages.
Clang has better support for C++11 than gcc
Well known fact: clang supports 110% of C++11 compared to GCC's 100%.
The real question is actually, why are so many people stubbornly sticking to gcc when clang has surpassed it in pretty much every way.
Because GCC has a more complete frontend, better extensions, a better optimizer and much better OpenMP support.
SJW n. One who posts facts.
I don't really care about the philosophical implications. What I want to know is if I'll still need to download Xcode from the App Store to get a copy of GCC.
The Gospel according to lolcat
The LLVM toolchain, especially clang, is also way better than gcc for Objective-C code. I think the ease of modification is the true reason that Apple prefers it over gcc.
Most OS X and iOS programmers have been using llvm/clang for the past year or so, on both x86 and ARM. Xcode 5 (GM seed available now) only supports clang. GCC is officially out for Apple development.
That. It's also way better for plugging into an IDE, generates way better compiler error messages, etc.
I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
Yes, but you can use Apple computers for stuff other than Apple development. I am not a MacOS or iOS programmer, except as far as creating in-house tools.
The real problem though is the weird hybrid that Apple added. /usr/bin/gcc is not GCC and is also not LLVM, but a mix of the two. If you use "gcc" it claims to be GCC-4.2.1 even though it rejects some code that should work for gcc 4.2.1. I'd have been happier if they just got rid of gcc altogether rather than leave around a legacy version that doesn't work as it caused a lot of wasted time and confusion.
Benchmarks are nothing to do with it. CLANG is more modular, generates better compiler warnings, plays nicely with IDEs and works better with Objective-C, for a start.
Benchmark performance can be improved with time. CLANG was started mostly because the GCC maintainer(s) were not interested in improving the objective-c support.
I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
Have you read the CLANG source to compare?
I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
Sun's compilers are still available (last I checked) for Solaris on SPARC, Solaris on Intel, and Linux on Intel.
I'm starting to think GNU is the problem with "GNU/Linux" these days.
I've just decided I'm going to remove the license for the software I have on my machine because I don't like it. I'm sure Microsoft and Apple will be just fine with this, as the precedent has been set by somebody doing this with BSD code and replacing it with GPL.
for the sarcasm impaired: you can't REMOVE somebody's license simply because you don't like it.
I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
The real problem though is the weird hybrid that Apple added. /usr/bin/gcc is not GCC and is also not LLVM, but a mix of the two. If you use "gcc" it claims to be GCC-4.2.1 even though it rejects some code that should work for gcc 4.2.1. I'd have been happier if they just got rid of gcc altogether rather than leave around a legacy version that doesn't work as it caused a lot of wasted time and confusion.
Standard GCC 4.0, GCC 4.2, and 4.2 with LLVM backend are installed with XCode - at least the current version. Calling "gcc" executes the version with the LLVM backend. If you want the standard GCC backend, just call "gcc-4.2" in place of "gcc".
Complaining that Apple has provided too many compiler options is a little ridiculous. Developers should be able to figure these things out. One expects Apple to simplify things for regular users; but as a developer, I appreciate that various options were made available.
Microsoft will give you a "single pane of glass" for "future stars" to view all the "innovations" and "mentorship" in a "major paradigm shift" to "foster success"
But only if you proactively leverage your synergies.
gcc being gpl v3 does not effect the output of the complier only code linked to or borrowed from it
So? This is about them including the compiler in the base system. Or are you suggesting they include a completely different complier as part of the base install to the one they actually use internally to build the system?
I dont read
TdR is the Gordon Ramsey of UNIX. Mad Skilled but he goes APESHIT whenever he sees something he doesn't approve of.
But if you take code and change the authors license that's stealing. Just because you don't like their license to begin with doesn't make it OK. Unless the license was written in such a way that it was permitted to permanently relicense the code and derivative works Theo was in the right here.
Which sure as hell doesn't mean ftp.exe is licensed under the BSD license.
Trolls and anti-trolls have a symbiotic relationship. Two faces of the same coin.
Because you can make changes to GPL'd code and distribute the binary without the code you used to compile it with?
Kind of like saying the drunk driver didn't kill that person, excessive g-forces did. Just a technicality with no practical merit.
BSD gets imported into Linux quite often. The only requirements for BSD 2 clause are these
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Since GPL already requires the source distributed and the BSD clause just requires the copyright notice, it plays nicely.
No developers, no software, except in the case where you define the developer as the user, but then GPL says it does not care about the freedom of the developer.. I'm so confused.
Optimizers try to keep correct code correct, and in my experience do a good job of it. If a program works with Clang, and doesn't on g++ with optimization turned up, I'd suspect there was undefined behavior in the program.
There's tradeoffs here. An optimizer that assumes it's working on correct code can do better, but C and C++ have a lot of undefined behavior, and in some circumstances a compiler that doesn't optimize as aggressively and accepts some undefined behavior may be more useful. On the third hand, you don't know if the less aggressive optimizer is interpreting the undefined code the way you'd expect, so there's advantages to simply and obviously failing.
"When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
That benchmark is old. OpenMP support for Clang was announced last week.
http://openmp.org/wp/2013/09/clang/
OpenBSD 10 hasn't been released yet, so it is premature to say that "BSD users are the loser here".
I have written a truly remarkable program which this sig is too small to contain.
Lots of our downstream consumers (especially embedded systems companies) have a policy of 'no GPLv3 on the premises'. They don't want the potential liability, and they especially don't want to make it easy for them to accidentally distribute GPLv3 code. Even if they're not planning on shipping GCC in their product (and, by the way, a lot of them do ship toolchains - embedded also includes companies like NetApp and Juniper - as it makes servicing easier), there's the potential to do it accidentally if the code is sitting there on developers' machines.
I am TheRaven on Soylent News
Apple doesn't directly fund FreeBSD, but they do sometimes contribute code. For example, most of the MAC framework (SEBSD) was funded by Apple and developed for both FreeBSD and OS X (the pluggable policy stuff in that makes the sandboxing for iOS and Mac App Store apps possible). When Apple wants kernel code written, they often contract work to FreeBSD devs, and are sometimes willing to fund the FreeBSD version at the same time because code that's generic enough to work on both kernels.
I am TheRaven on Soylent News
Performance isn't the only metric by which you judge compilers, although I agree that it's an important one. OpenMP support affects a very small number of programs. Intel has just open sourced (BSDL) their OpenMP runtime and is pushing patches into clang, so that support should appear soon. The rest of the benchmarks show very little performance difference between clang 3.3 (which is in FreeBSD 10.0) and gcc 4.8, and neither is a clear winner in all cases. In comparison to the last GPLv2 GCC (4.2.1), which FreeBSD currently ships, both are significantly faster. If you need OpenMP today, gcc 4.8 is in ports, so just install the lang/gcc48 port and use it.
However, as I said, performance is not the only metric. Clang has full support for C++11 and supports more of C11 than GCC (for example, it correctly supports _Atomic and it supports _Generic). In FreeBSD, we're now using _Generic in a number of system headers and so you get better error reporting if your compiler supports them (fallback code exists if it doesn't). We found a few logic bugs in ports as a result of this, some of which have existed on other platforms and compiled without warnings for years. So, if you want to use the latest versions of C, C++, or Objective-C, clang is a better choice for you. We're also now shipping libc++ as the default C++ standard library, so we have a complete C++11 stack.
If you're developing C-family code and don't have a Coverity license, then having the clang static analyser around is also very helpful (it's built into clang, so you get it as part of the default install).
I am TheRaven on Soylent News
I was a clang committer before I joined the FreeBSD project. I became a clang committer because I wanted an Objective-C compiler that supported a modern dialect of the language for non-Apple platforms. I took a look at the Objective-C code in gcc. It mingles parsing, semantic analysis and code generation in a convoluted knot. After a week of failing to understand it, I took at look at clang. At the time, Clang has parsing support for Objective-C, but no code generation support at all. Within a week, having never looked at the Clang codebase before, I had it generating code for a superset of the language that GCC supported.
I've also use clang to do syntax highlighting, to inspect files for type information for use in an FFI for a JIT-compiled language, and as a static analyser. How many tools have you seen that are based on GCC and aren't compilers?
I am TheRaven on Soylent News
Yes, well known and accepted. The craptastic GCC developers have been hurting its improvements for years. They have serious control freak issues and as such, GCC has fallen well behind the curve. This isn't a new topic of discussion.
I'm a clang developer and you're a troll. Clang is faster than GCC on some benchmarks. GCC is faster than clang on others. The new autovectorisation code in Clang is usually faster than GCC, sometimes a lot faster, occasionally slower. Clang doesn't yet have the OpenMP support upstream. In most real-world code you won't see a difference of more than 10% between them, and even then you won't see a consistent winner.
I don't like GCC, and I don't use GCC (except on MIPS, where clang isn't quite ready), but GCC is not 'well behind the curve', it still gives acceptable performance. It was never the fastest player (ICC, XLC and Open64 were all faster), but it's pretty respectable.
I am TheRaven on Soylent News
And (at least legally, there may be some exceptions), none of the code in these proprietary products was relicensed. It is built and shipped in accordance with the terms of the license, which permits redistribution in proprietary form as long as you provide attribution, don't sue the original developers if it doesn't work, and don't use their names to advertise your product. The fact that the overall work may have a different license from its components is a different issue. This is why detractors call the GPL 'viral', in that it (more or less) requires any work that contains GPL'd components to be GPL'd.
I am TheRaven on Soylent News
RDRAND is not used directly, it's 'whitened' by Yarrow or a similar algorithm (there are now a few pluggable options, although I'm not sure they made it into 10.0). It's one entropy source, and things like interrupt timings and so on are others. If RDRAND is produces non-deterministic data in a way that are easy for the NSA to predict then there are some possible network attacks involving TCP sequence numbers early on in the boot. After that, there are other entropy sources (e.g. interrupt timings) that make it much harder to predict the inputs to Yarrow (and, unless Yarrow is also broken, you need all of the inputs to be able to predict the output).
I am TheRaven on Soylent News
With my LLVM dev hat on, please can you point to some analyses that are implemented in GCC and not LLVM? I have some masters' students in need of interesting projects in a few months...
I am TheRaven on Soylent News
Seriously, the core devs hate free software
Speaking as a member of the FreeBSD Core Team, who contributes code to a GNU project (GNUstep) and has signed an FSF copyright assignment for the purpose, and who was the one to make the disable-gcc-by-default commit, I have to say: What?
I am TheRaven on Soylent News
Thank you for your lengthy response to what I said. I have to agree with you. I used the words true/free based upon my own bias and I shouldn't do that. Good point, I will take that into account for the future. Especially since it's such a 'holy' (as in vi vs emacs) subject. About the ps: I personally don't see it as stealing what Apple did. I consider the BSD license as sort of saying: Here, you can have this. It's a gift. Do what you want with it. And albeit not being too keen on Apple for other reasons, they had every right to use the codebase under the BSD. So no stealing as far as I am concerned. It's funny you mention RMS. I have great respect for him and consider him to be one of the pioneers of the tech-world. When he speaks, I listen. I don't always agree with him 100%, but most of the time I think he's right. To be honest, when I started reading your post for a moment there I thought I got AC'd by him. Again, thank you for this very interesting response. I wasn't expecting such a post from an AC.
Thanks for the thorough pieces of information. I learned a few things, and with the stuff I didn't learn I agree on most. However, I'm going to disagree with your last paragraph.
I think a fundamental reason most modern websites are written in languages like Perl, PHP, Python, Ruby, or even Java is that those languages have a much faster compilation cycle than C or C++ for complex applications. Of course the scripting languages are compile-and-run in one fast step. For certain classes of applications where speed is essential, you can't escape the need for C or C++ or something similar. Otherwise, I think the speed of the change-save-run cycle trumps the speed of the execution in importance by a wide margin.
A company with a big war chest of money like Google, Microsoft, Oracle, or IBM can pick (or build) the compiler that lets their 100 servers serve the results as quickly as possible because they're battling costs associated with thousands of servers. But for some company that's looking at 50 servers, or 20, or 3, the company with the quicker compiler probably has his product on sale while the other company is twiddling its thumbs. Whenever I've had to stop what I'm doing to wait for something to finish at work, inevitably I switch from being productive to wasting my time doing something else (like, just for the sake of argument, posting to Slashdot).
GCC tends to overoptimize things to the point where the optimizations become self-defeating.
-Matt