Forgot your password?
typodupeerror
GNU is Not Unix Open Source Unix BSD News

FreeBSD 10 To Use Clang Compiler, Deprecate GCC 711

Posted by timothy
from the squash-it-like-a-figurative-bug dept.
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)."
This discussion has been archived. No new comments can be posted.

FreeBSD 10 To Use Clang Compiler, Deprecate GCC

Comments Filter:
  • by jomcty (806483) on Sunday May 13, 2012 @01:14PM (#39986849)
    What's wrong with GCC?
  • by bonch (38532) * on Sunday May 13, 2012 @01:26PM (#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?

  • by DarkHelmet433 (467596) on Sunday May 13, 2012 @01:34PM (#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:in other words (Score:5, Interesting)

    by bonch (38532) * on Sunday May 13, 2012 @01:36PM (#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.

  • by Alex Belits (437) * on Sunday May 13, 2012 @01:37PM (#39987059) Homepage

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

  • by rubycodez (864176) on Sunday May 13, 2012 @01:45PM (#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.
  • by rubycodez (864176) on Sunday May 13, 2012 @01:47PM (#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....
  • by bonch (38532) * on Sunday May 13, 2012 @01:49PM (#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.

  • by dragisha (788) <dragisha@@@m3w...org> on Sunday May 13, 2012 @01:52PM (#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.

  • by Kjella (173770) on Sunday May 13, 2012 @01:59PM (#39987265) Homepage

    "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?

  • by perpenso (1613749) on Sunday May 13, 2012 @02:06PM (#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 (Score:1, Interesting)

    by bonch (38532) * on Sunday May 13, 2012 @02:12PM (#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.

  • by Anonymous Coward on Sunday May 13, 2012 @02:24PM (#39987447)

    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.

    Quite the opposite from what I've seen. iXsystems, Isilon, Netapp, etc., have found it much better to contribute non-special sauce code back to the project than keeping it in house. Any patches that you don't contribute, you have to maintain, and over time will drift from the mainline development of the public code. Unless the patches are very sensitive and core to your product differentiation, it makes no sense to keep them hidden.

    People will contribute back to BSD projects because it is the most practical thing to do.

    I'm sure you can see similar things with Postgres, which is also BSD-licensed.

  • by turgid (580780) on Sunday May 13, 2012 @02:53PM (#39987679) Journal

    whereas now people are moving to BSD-style licenses with no such benefits.

    This is symptomatic of PHB/MBA thinking: short term gains/benefits that mortgage long term growth.

    In a couple of years time, there will be a proliferation of different, incompatible versions of CLang/LLVM that will be increasingly expensive to maintain. Furthermore, I can foresee vendors making incompatible changes to the code produced by CLang, subtle ABI breakage and the like. The upper levels will suffer too : vendor A's version will not be able to compile source code with vendor B's extensions and vice versa.

    Then in come the patents, and to compile certain code on a certain platform (OS version and hardware) you'll need vendor C's compiler with some new super-duper patented feature that no one else is allowed to implement.

    This sounds like the 1980s/ealy 1990s all over again. Unix wars, balkanisation, and one dominant vedor ... Microsoft, although this time it'll be google.

  • by arth1 (260657) on Sunday May 13, 2012 @03:02PM (#39987769) Homepage Journal

    In a couple of years time, there will be a proliferation of different, incompatible versions of CLang/LLVM that will be increasingly expensive to maintain. Furthermore, I can foresee vendors making incompatible changes to the code produced by CLang, subtle ABI breakage and the like. The upper levels will suffer too : vendor A's version will not be able to compile source code with vendor B's extensions and vice versa.

    Hindsight is invariably more accurate than foresight. And in this case, hindsight tells us that there are plenty of non-GPL free packages that you use every day that haven't succumbed to either of your fears. In fact you use at least a couple of them when you read this.

    This sounds like the 1980s/ealy 1990s all over again

    That wouldn't be bad. The productivity per user has never been higher, and most of what we use now was invented then. I'd rather see that again that these modern days where ideas are scarce and productivity per user base at an all time low.

  • by Altus (1034) on Sunday May 13, 2012 @03:41PM (#39988051) Homepage

    And yet, as so many people here love to point out when it favors them, you still get to have the pig. Apple has taken nothing, the pig still exists as ever and apple has provided you with a sausage as well.

    Maybe you don't like sausage and thats fine, but don't act like someone took away your (or anyone else's) pig.

  • GCC license (Score:4, Interesting)

    by maestroX (1061960) on Sunday May 13, 2012 @04:36PM (#39988603)

    GCC doesn't need GPL, a freeware license would suffice.

    Over the years I've read and analyzed the sources and consistently found the source to be as readable as the binary code, regardless of platform.

    Compiler developer forums seem to confirm my findings with frequent comments and insults on GCC like:

    • "you retard GCC haxxors do macro-ni and spaghetti all day! "
    • "how do I build XXX frontend for GCC?" [first and last post of many aspirant compiler developers]
    • [primordial grunt] "<junk>" [poster last seen on VB forum]

    Nonetheless, I praise the omnipotence of GCC, as long as I'm not the first guy on a new platform.

  • History (Score:5, Interesting)

    by TopSpin (753) on Sunday May 13, 2012 @06:36PM (#39989509) Journal

    At the moment I write this there are 297 comments mostly debating the merits of LLVM/Clang vs. GCC. There is not one mention of EGCS.

    Fifteen years ago GCC was forked [google.com]. A group of people we're frustrated with GCC and its leadership because they had contributions to make and talent to offer that was not welcome. They called their fork EGCS.

    Why are we doing this? It's become increasingly clear in the course of hacking events that the FSF's needs for gcc2 are at odds with the objectives of many in the community who have done lots of hacking and improvment [sic] over the years.

    The GCC you use today is EGCS. A few years later EGCS was adopted as GCC 2.95 after the merits of EGCS became undeniable.

    Looks like we've come full circle. The cool kids are off in the weeds making cool stuff. Better stuff, and the `Powers That Be' are not interested. The `needs' of the FSF today are no longer in sync with the `needs' of the developers of today.

    The bottom line is that GCC as it is with it's leadership, code base and license agenda doesn't cut it for those who have the talent, motivation and capital to create a tool chain that does cut it. You don't get to impede that, however righteous you think you are.

    Freedom. Deal with it.

The test of intelligent tinkering is to save all the parts. -- Aldo Leopold

Working...