Slashdot Mirror


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

39 of 333 comments (clear)

  1. Oblig, appropriate XKCD by PSVMOrnot · · Score: 5, Funny

    "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

  2. More interesting page for FreeBSD 10... by Noryungi · · Score: 5, Interesting

    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)
    1. Re:More interesting page for FreeBSD 10... by MatthiasF · · Score: 5, Informative

      I think the updates to ZFS are more impressive. The addition of LZ4 compression (50-80% faster), SSD TRIM support and the new NOP-write that reduces the need to write to compressed disks will all mean commodity hardware SANs running FreeBSD will be able to give the big boys a run for their money.

      So, better compression, SSD speed-up and less need to write to changed files, means there will be a huge performance increase.

    2. Re:More interesting page for FreeBSD 10... by SuricouRaven · · Score: 2

      Can we take drives out yet? ZFS makes it nice and easy to just add a new drive to a storage pool, but taking one out (ie, freeing up port for a larger drive, or turning your 16x1TB drives into 8x2TB drives to reduce the frequency of failures) is a different matter.

    3. Re:More interesting page for FreeBSD 10... by Bengie · · Score: 2

      Not yet, that requires pointer re-writes, which has been talked about for a long time by the ZFS devs.

      Essentially, ZFS does not currently allow data to be moved once written. Supports Delete and Insert, but no Update. A big reason for this is if you move the data, you need to update all points that address that data, and to do so in an atomic way that doesn't leave the system in an unstable state.

    4. Re:More interesting page for FreeBSD 10... by MatthiasF · · Score: 2

      I do not think there is a safe way to do that in regards to any storage array system, besides setting up the two arrays in parallel and copying the data.

      ZFS will allow you to migrate up to larger drives, but I believe it has to be the same number of drives and it is still fairly risky (requiring you to degrade the array for a rather lengthy period).

      Here's a blog explaining some.

      https://www.dan.me.uk/blog/2012/11/14/increase-capacity-of-freebsd-zfs-array-by-replacing-disks/

      I think you can also use the mirror capabilities to migrate to a newer set of drives, but I have not seen anyone explain the process well.

  3. Re:Just one question by Lendrick · · Score: 5, Informative

    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.

  4. Re:can it build the linux kernel? by kthreadd · · Score: 3, Insightful

    The Linux kernel itself is not GNU. Removing all GNU software will not remove the kernel.

  5. Re:Just one question by Anonymous Coward · · Score: 3, Informative

    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.

  6. Re:Just one question by lactose99 · · Score: 5, Informative

    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
  7. Re:can it build the linux kernel? by kthreadd · · Score: 2

    Can LLVM's Clang build the Linux kernel and QT/KDE?

    They are getting close to building the Linux kernel according to these slides. Qt has been able to use Clang for a long time now, but I don't know about the entire KDE.

  8. Re:Just one question by Anonymous Coward · · Score: 2, Insightful

    Sorry, but it's you that looks like a douche.

  9. Clang is Slower by tuppe666 · · Score: 4, Informative

    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

    1. Re:Clang is Slower by tlhIngan · · Score: 5, Informative

      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

      Except FreeBSD is not using GCC 4.8. They're using GCC 4.2.1, the last version that was GPLv2.

      While the current version of GCC may be faster than Clang/LLVM, that doesn't mean Clang/LLVM isn't faster than what is in use now, so the switch may even boost performance compared to the ancient version of GCC in use.

  10. on Single Compilers by bill_mcgonigle · · Score: 2

    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)
    1. Re:on Single Compilers by phoenix_rizzen · · Score: 4, Informative

      FreeBSD (and Linux) were already in a "one compiler to rule them all" situation, aka GCC. At least with FreeBSD 9 there were two compilers in the base install (GCC, LLVM), and you have the option of keeping GCC in 10 if you really want.

      IOW, you're complaint is baseless and backwards.

  11. Re:Just one question by Anonymous Coward · · Score: 5, Funny

    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.

  12. Re:can it build the linux kernel? by andreicristianpetcu · · Score: 2

    They broke it of from the community. They made changes but they did not commit the diffs. This after huge pressure from KDE devs. I prefere to have my code eaten up by other GPL projects and remain free forever than get assimilated in Apple's pretty iShit.

  13. Re:Just one question by 1s44c · · Score: 3, Insightful

    Because GCC is a total mess internally and Clang/LLVM is neat, clean, maintainable, adjustable.

    GCC is a dead end. LLVM is the future.

  14. Re:Just one question by 1s44c · · Score: 2

    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.

  15. Re:Just one question by HornWumpus · · Score: 2

    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'
  16. Re: Just one question by Anonymous Coward · · Score: 3, Funny

    And a more performant one at that.

  17. Re:can it build the linux kernel? by santax · · Score: 3, Insightful

    Which I and probably about every other BSD-style coder respects. However, this debate is really old. I think there is something to be said for both license-models and it is good they both exist. I however do feel that true free code, is well... really free. Also to be used without giving the source. It's a choice I made and I can perfectly understand why people don't want to have Big Ol' Apple stealing their stuff and making heaps of money from it. But, I can also understand why people want to really give the code away. It's all about perspective and there is no right or wrong here. It all depends on the personal views of the coder/owner of the code and what that person/org wants to let others do with their code. BSD has the advantage that it can become closed source. That makes it easier to generate profit, but also (especially in the commercial world) there are other good reasons why people want to protect their product. GPL has the advantage that every time someone uses your code, that code will become available also. Just don't ever think that because your code is GPL'd, no one will dare to use it in close source. As much as I would love such a world, that would be very naive.

  18. Re:can it build the linux kernel? by andreicristianpetcu · · Score: 2

    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. BSD code helps build DRMed jails for Sony and Apple. I prefer a license that disallows this. I want to share my code with anyone in the world who does not to build proprietary stuff (for building new software). And share my software with anyone for usage, regardless of the purpose.

  19. Re:can it build the linux kernel? by marcello_dl · · Score: 2

    And that is one of the worst justifications ever. In fact, it's so bad, it lends credence to the "GPL is viral" belief - because the GPL can take and take and take, and not give back

    it takes what IT IS ALLOWED to take, it gives back everything as long as you redistribute it keeping it free.

    There are two civilizations, the Babbling Software Developers (BSD) and the Grooming Prevented by Law (GPL). The first has a law: "do what you want". The other has a law "Do what you want as long as it doesn't prevent others to do the same". Simple, no?

    I don't see why a dev that allows everybody, commercial entities wielding software patents included, the freedom to use his code would be bothered by the GPL, but then, I am not one of them.

    --
    ---- MISSING MISCELLANEOUS DATA SEGMENT --- [sigdash] trolololol
  20. Re:Just one question by slacka · · Score: 3, Interesting

    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

  21. Re:two dictionaries say "no such word" by Anonymous Coward · · Score: 2, Interesting

    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.

  22. Re:Just one question by Ash+Vince · · Score: 2

    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 /. to RTFA, I read /. to offend people in ignorance.
  23. Re:Ah, the BSD "freedom" by kthreadd · · Score: 2

    The freedom to not offer freedom. No one is forced to use your software.

  24. Re:Just one question by lgw · · Score: 3, Insightful

    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.
  25. Re:Why? by David+Gerard · · Score: 5, Interesting

    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
  26. Re:Why? by Cramer · · Score: 2

    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.

  27. USER? Karma be damned. by aristotle-dude · · Score: 2

    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.
    1. Re:USER? Karma be damned. by Microlith · · Score: 2

      Real end users "use" the system and care more about usability than access to the source code.

      Ah, so you get to define who a "Real end user" is I take it?

      Most of them would not know how to write any code let alone audit it.

      Which is beside the point, really.

      The end user's "freedom" is actually limited when nerds argue over licensing terms and are unable to include some software because of it.

      Nonsense. You just don't like that the argument doesn't go 100% your way and others disagree.

      The GPL is actually a form of slavery that you agree to enter into in order be able to modify the code.

      I see we're back to hyperbole. No, you can modify the code all you see fit. You simply can't redistribute without complying with the GPL. Which isn't slavery by a long shot.

      The price that the GPL imposes is too high a price.

      For you maybe, but you're already acting unreasonably.

  28. Entirely BSD toolchain soon by Eravnrekaree · · Score: 2

    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.

  29. Re:Just one question by lister+king+of+smeg · · Score: 2

    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.
  30. Re:Why? by gnasher719 · · Score: 2

    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.

  31. Re:Why? by Cramer · · Score: 2

    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.)

  32. Re:Just one question by evilviper · · Score: 2

    I'm deeply disappointed that this issue was decided over philosophical instead of technical merits.

    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