7 ms·
FreeBSD has removed GCC from its base system
- tyingq 7y agoI don't know the whole space well, but there are posts about FreeBSD and IBM today moving to clang. Is there some tipping point where gcc has too few significant end users to stay relevant? I'd hate to lose the diversity.
- ComputerGuru 7y agoIt's unlikely as up until now it was the only compiler capable of building the Linux kernel (due to its reliance on some GCC extensions to the language). It is primarily non-GPL platforms/systems/companies that are switching to clang for it's much friendlier license. Edit: "~now" rather than "now"
- tyingq 7y agoThat's part of why I ask. As of late last year, clang can compile x86_64 Linux 5.x kernels.
- Someone 7y agoBuilding the kernel with clang has been possible or a while. https://releases.llvm.org/9.0.0/tools/clang/docs/ReleaseNotes.html#linux-kernel https://releases.llvm.org/9.0.0/tools/clang/docs/ReleaseNote...: "With support for asm goto, the mainline Linux kernel for x86_64 is now buildable (and bootable) with Clang 9. Other architectures that don’t require CONFIG_JUMP_LABEL=y such as arm, aarch64, ppc32, ppc64le, (and possibly mips) have been supported with older releases of Clang (Clang 4 was first used with aarch64). The Android and ChromeOS Linux distributions have moved to building their Linux kernels with Clang, and Google is currently testing Clang built kernels for their production Linux kernels." That was in September 2019
- ComputerGuru 7y agoYes, I consider within the past year to qualify as "now," but I've updated my post :)
- ndesaulniers 7y agoWithin the past year is more nuanced. Clang was building working kernels since clang-4. X86 developers decided to require asm goto around Linux 4.20, which regressed clang builds for one architecture, until clang-9 implemented it. You could still build LTS kernels without asm goto.
- marcthe12 7y agoClang can't compile glibc which actually a bigger problem.
- jsjddbbwj 7y agoIn my opinion it's also time to move on from glibc.
- fullstop 7y agoWithout clang we would still have terrible compile error messages. As clang implements more and more of GCC's extensions, though, I could see things reaching that tipping point.
- pjmlp 7y agoAnd without a GPL compiler, we will be back to the PD and *ware days. Sony, Apple, IBM, and plenty of other embedded vendors don't contribute 100% their improvements back to LLVM.
- loeg 7y agoApple does like 80% of the open source development of LLVM; I don't really see a valid angle to criticize their participation in LLVM at this time.
- pjmlp 7y agoExcept that they happen to have an actual portable variant of bitcode for watchOS, their clang implementation different enough from mainline clang to warrant its own column on cppreference compiler listing, and Objective-C and Swift related changes are on "just what you need to know" basis and the community should put the missing pieces. Personally I don't care, as I am mostly a commercial software user nowadays. Just making the point that LLVM victory over GCC, might not turn out as FOSS supporters expect.
- bigcheesegs 7y agoApple Clang gets its own column because it doesn't align with the official LLVM release schedule, which is also why it doesn't use the upstream version numbers.
- jfkebwjsbx 7y agoThat does not make sense. They could simply use the LLVM version, even if it was an old one.
- beezle 7y agoFreeBSD has been using Clang as the default build system for x86/64 since.. 2012? Version 10.0 IIRC. Not sure about mips, sparc, power but think they moved previously as well?
- kevans91 7y agopowerpc64 switched over in late December; sparc64 never made the switch (unfortunately), and mips will make the switch with the introduction of llvm 10. IIRC powerpc32 is currently using clang with old bfd ld, but lld in llvm 10 may be quickly reaching the point where it's suitable for powerpc32 as well.
- cbmuser 7y ago> sparc64 never made the switch (unfortunately) Care to elaborate? We're maintaining sparc64 in Debian Ports and we have smashed quite a number of bugs in the SPARC backend in LLVM. Are there any issues you are seeing?
- loeg 7y ago10.0, 2014 for amd64/i386. Much later for MIPS and Power (within the last year). Sparc was deorbited as part of the GCC4.2.1 retirement effort — no one showed up to implement Sparc support in Clang, and the version of Sparc hardware FreeBSD ran on was extremely obsolete anyway.
- dannypgh 7y agoWe used to celebrate alternatives to gcc in the name of compiler diversity, and now we're wondering about gcc preservation in the name of compiler diversity. This is mostly just an observation, I'm not sure how I feel about it. Compiler diversity doesn't seem more important than OS diversity to me, and none of these feel particularly important. As a user I was happy to switch to clang for the better error messages.
- Sean1708 7y agoAs other top-level posts have pointed out they're only removing it from the build process, it's still available to users. I wouldn't worry too much about about GCC going away, it's still the default compiler for most (all?) Linux distros.
- umanwizard 7y agoIt was removed from the operating system. As with most operating systems, nothing prevents users from installing third-party software including GCC.
- deleted 7y ago[deleted]
- bregma 7y agoClang would gave to start having better support for floating point. Right now it's at the "eh, whatever, it works for my limited case" level of support, which is not near good enough for safety-critical applications. They're starting work on that, so maybe in a few years time.
- umanwizard 7y agoDo you have a reference for this, out of curiosity?
- cat199 7y agoare you saying this in respect to GCC or in regards to commercial compilers, or both?
- lmm 7y agoWhat does that "diversity" actually gain you? LLVM is very modular so a clang monoculture won't stop competing optimisations etc. being developed, and its license is suitable for most uses.
- justinmeiners 7y ago- The GPL license for GCC is valuable for free software rights. - just like chrome becoming the only browser, one compiler isn't good either. The implementation starts to define the language instead of the standard - separate projects can use different methodologies and tradeoffs. - if there is a bug or exploit that only applies to that complier and not all programs I don't think we should have 20 major C++ compilers but we shouldn't have one.
- umanwizard 7y ago> The GPL license for GCC is valuable for free software rights Apparently not in practice, because LLVM's copyleft license hasn't stopped large amounts of free software from being created (for example, rustc).
- monocasa 7y agoThe ObjC frontend was only released because Apple got sued for infringing on the GPL.
- chrisseaton 7y agoFewer people suing each other seems better in my opinion.
- monocasa 7y agoHow about you comply with the terms of the licence if you don't want to be sued?
- umanwizard 7y agoGcc is still the default on GNU/Linux systems which are orders of magnitude more mainstream than FreeBSD.
- anthk 7y agoSo what? Clang under OSX compiling both OSX and iOS projects is far more widespread.
- samatman 7y agoOn computers-with-keyboards, maybe, probably even. On a per-kernel basis, absolutely not, even before we consider Androids.
- andoriyu 7y ago> The Android and ChromeOS Linux distributions have moved to building their Linux kernels with Clang, and Google is currently testing Clang built kernels for their production Linux kernels." https://en.wikipedia.org/wiki/List_of_products_based_on_FreeBSD https://en.wikipedia.org/wiki/List_of_products_based_on_Free... You have no idea how many places FreeBSD actually runs in.
- favorited 7y agoGoogle uses Clang to build the kernel for Android.
- samatman 7y agoWhich is interesting but hardly relevant. To quote: > > Gcc is still the default on GNU/Linux systems which are orders of magnitude more mainstream than FreeBSD. > So what? Clang under OSX compiling both OSX and iOS projects is far more widespread. I'm asserting that there are more Linux kernels compiled under GCC than there are OSX kernels running Clang (so macOS) compiling OSX and iOS projects. I think that's on pretty solid ground.
- ksec 7y ago>Is there some tipping point where gcc has too few significant end users to stay relevant? I'd hate to lose the diversity. Yes. There will be a tipping point, as with any economic theory of sustainability. No, we wont reach that tipping point in the foreseeable future. It is still extremely widely used, and continue to be actively developed. LLVM and GCC will likely enjoy duopoly in the Open Source Space for a very long time.
- ksangeelee 7y agoI don't think your question is meaningful in light of why GCC exists at all. It was created to enable people to write free software and, along with binutils, it's hard to imagine any software that's been so profoundly influential in the free and open source software that we have today. I think GCC will remain relevant for as long as there are people who care about free software.
- AdmiralAsshat 7y agoI guess we shouldn't be surprised. BSD has no philosophical reason to keep GCC over Clang, and if Clang is delivering better performance for them, obviously they're gonna use it.
- Narishma 7y agoWhere does it say that it delivers better performance than GCC? AFAIK the main reason they switched is the license.
- lvh 7y agoRegardless of what the situation was back in 2007, one tends to imply the other over time: the version of GCC is ancient now (because of licensing issues) and of course clang will do better: it has an extra decade of compiler development.
- bcaa7f3a8bbc 7y agoThe title is highly misleading. First, it's the ancient GCC 4.2.1 from 2007. Next, it's removed from the FreeBSD build system, which means it's no longer used in the internal development of FreeBSD and you can no longer build FreeBSD with GCC. Meanwhile, GCC is still maintained for userspace and the latest GCC 9 is included in the FreeBSD Port [0], you can install it on your machine for your personal use. Finally, the commit message said "At this time all supported architectures either use in-tree Clang, or rely on external toolchain (i.e., a contemporary GCC version from ports)", so I assume even with GCC support removed, you can still build FreeBSD, if you insist, with an external copy of modern GCC. Suggested alternative title: FreeBSD has Removed GCC from Build Infrastructure. [0] https://github.com/freebsd/freebsd-ports/blob/master/Mk/bsd.gcc.mk https://github.com/freebsd/freebsd-ports/blob/master/Mk/bsd....
- ianai 7y agoIs it all licensing making the push away from gcc?
- ethelward 7y agoIIRC, yes; it was the last version under GPLv2.
- alerighi 7y agoWhat is the problem of using a GPLv3 compiler? Only political reason, since FreeBSD is still an open source project and they can use GPLv3 software without any problem. Not only that, but even proprietary software can be built with a GPL compiler, the binaries produced by the compiler are not considered derived work that must be covered by the same GPL license, so if Microsoft wanst to build Windows with GCC for example they can do that, provided that they don't link in the executable produced GPL code (e.g. glibc).
- lazyier 7y agoThe legal subject of licensing GPLv3 is a lot more nuanced then you are indicating. One example of this is that while the license can explicitly allow proprietary software to link to a library it cannot explicitly deny proprietary software linking to a library. Copyright law defines what is and what isn't derivative works, not licenses. And copyright licenses are fundamentally limited to copyright law. But there are technical reasons to avoid using GCC nowadays as well. The GNU people have built in shitty anti-features into GCC suite, ostensibly to limit the ability of proprietary software to incorporate GCC into their products. LLVM, which is what CLang uses, was partially a response to the artificial technical limitations intentionally imposed on users by the GNU GCC authors.
- lvh 7y agoPoint of order: removed GCC /from the base system/. Ports still have a range of GCCs and some ports still depend on GCC. The GCC in base was well over a decade old, and it was that particular version for the same reason macOS shipped an ancient version of bash for a decade: it was the last one licensed under GPLv2. This is effectively an administrative change. (Not to downplay the work!)
- tannhaeuser 7y agoCould someone explain the particular pain points of GPLv3 as it relates to use of gcc?
- tagrun 7y agoThey've been trying to achieve this for decades, mainly for perceived ideological differences.
- nrclark 7y agoThe main issue with GPLv3 is the so-called Tivoization clause. It basically states that if you have a product that ships with any GPLv3 software, you need to give your users the ability to install a modified version of anything you included that's GPLv3. Which basically means you can't lock down your device. That's totally fine if you're talking about a workstation, laptop, or server. But it's a big security risk on an embedded system like a smart TV, mobile phone, or game console - both from an IP protection point of view, and also from a botnet/pwning point of view. FreeBSD (and others presumably) don't want their users to need to worry about accidentally installing something from the core system and finding themselves in violation of the GPL.
- tagrun 7y agoThat's a rationalization though, not the reason. FreeBSD's GPL "exorcism" efforts had been going on long before FSF started floating ideas about GPL 3.0.
- peter_d_sherman 7y agoIn the future, gcc will be remembered (fondly!) as historically significant between the time periods of simple unix-based K&R C compilers of many years ago -- and Clang, of the past few recent years...
- miguelmota 7y agoFreeBSD has removed GCC from base system but GCC is still available as a port
- anfilt 7y agoWell from my understanding FreeBSD was using an old version of GCC mainly because licensing reasons. What's so annoying about the licensing around GCC is I see a lot cases where the code generation is still better than clang. Although clang matches GCC in most cases.
- johannkokos 7y agoWhat about binutils? Is it removed too?
- emaste 7y agoMostly, we still have a couple of binutils hanging around: - ld.bfd on 32-bit powerpc (should go when lld 10.0 is in FreeBSD) - GNU as on i386 and amd64 (expected by some ports, and needed to assemble one file in the base system on amd64) - objdump (expected by some ports, but not used in the base system) These should be removed in FreeBSD 13.0. More details are on our Wiki, https://wiki.freebsd.org/GPLinBase https://wiki.freebsd.org/GPLinBase
- jhoechtl 7y agoCan anybody explain the hate/aversion towards GCC? As I see it clang used to generae more meaningful error messages thats why many people turned toward clang. But it seems those days are gone. Gcc still produces better=faster machine code. So why the hate? Are there political reasons involved?
- zelly 7y ago> Are there political reasons involved? GCC is more spaghetti than Clang, less modular. But yeah, it's mostly political/business/legal related. A lot of people hate copyleft with a passion like Apple and Google, who hire lots of people to work on LLVM. The idea seems to be that LLVM will eventually catch up to GCC on quality of generated code.
- thedance 7y agoGoogle didn't move to clang/llvm because they hate copyleft. They moved because people who work on compilers prefer to work on clang/llvm, and if you have a compiler group you need to keep them happy.
- loeg 7y agoIt's probably also true that the FSF is more of a pain to work with than absolutely necessary — they want copyright assignment, have some abhorrent code style, and still insist on tracking useless diff summaries in ChangeLog files long after the invention of RCS systems.
- bityard 7y agoHate is probably too strong a word but there is a contingent within the BSD community who perceive the GPL as "viral" and actively work to make as much of the project BSD-licensed (or similar) as possible.
- deleted 7y ago[deleted]
- deleted 7y ago[deleted]
- CalChris 7y agoSo FreeBSD was supporting GCC 4.2.1 but not upgrading to newer GCCs over the years. GCC is currently at 9.2. Apparently the reason for this is GCC's move to GPL v3. So FreeBSD was forced to remain using GCC 4.2.1, GPL v2. As far as Clang goes, is FreeBSD tracking/upgrading to newer Clang versions? I assume the answer is yes but I don't know.
- takeda 7y agoYes, they are updating it regularly: https://svnweb.freebsd.org/base/head/UPDATING?revision=358497&view=markup https://svnweb.freebsd.org/base/head/UPDATING?revision=35849...
- loeg 7y agoYes, GCC 4.2.1 for tier 2 and 3 architectures only (like MIPS or PPC) for quite some time. Clang/LLVM was imported into FreeBSD base in FreeBSD 9, released in 2012[1]. I don't believe it was the system compiler for any arch at that time, but could be wrong. In FreeBSD 10 (2014) it became the default compiler for amd64/i386[2]. [1]: https://www.freebsd.org/releases/9.0R/announce.html https://www.freebsd.org/releases/9.0R/announce.html [2]: https://www.freebsd.org/releases/10.0R/relnotes.html https://www.freebsd.org/releases/10.0R/relnotes.html
- thescriptkiddie 7y ago"Forced" is a bit of an overstatement. Other BSDs ship with newer versions of GCC, FreeBSD just disagreed with the GPLv3 tivoization clause.
- ndesaulniers 7y agoI removed GCC from AOSP a month ago. https://android-review.googlesource.com/q/topic:%22rm_gcc%22+(status:open%20OR%20status:merged) https://android-review.googlesource.com/q/topic:%22rm_gcc%22...
- zbowling 7y agoWe never had it in Fuchsia being LLVM/Clang only from day one. Technically zircon had a GCC builder for a bit though to compare kernel builds.