
FreeBSD has removed GCC from its base system - gcoleman
https://github.com/freebsd/freebsd/commit/52fcc2c3146b5875a1ec0fb7460dd382ab0e5b3b
======
lvh
Point 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!)

------
bcaa7f3a8bbc
The 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....](https://github.com/freebsd/freebsd-
ports/blob/master/Mk/bsd.gcc.mk)

~~~
simias
I disagree, for anybody who knows how FreeBSD works the title is perfectly
clear IMO. They removed FreeBSD from the base system. Of course you can still
build GCC from ports, but that's not part of the base OS.

It's as if MacOS decided to stop shipping bash by default. Of course you'll
still be able to install it yourself, but it's not part of the OS anymore and
you can't rely on it being available and supported.

FreeBSD is not Linux, it's a full OS, not just a kernel. There's a very clear
line between what's part of the base system and what's not.

~~~
ori_b
> _I disagree, for anybody who knows how FreeBSD works_

That excludes the bulk of this site's readers.

~~~
simias
Perhaps, but then the distinction between the base system and ports will be
lost on them too, and saying that it's merely been removed from the build
system doesn't do this news justice IMO, it's more significant than that.

Maybe we could compromise with "FreeBSD has removed GCC from its base system"
or something similar.

~~~
amyjess
> Maybe we could compromise with "FreeBSD has removed GCC from its base
> system" or something similar.

I think this would make the best headline.

~~~
JdeBP
> _Otherwise please use the original title, unless it is misleading or
> linkbait; don 't editorialize._
> ([https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html))

Which would make the headline that is most in accordance with the guidelines
here:

"remove GCC 4.2.1 build infrastructure"

------
tyingq
I 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
It'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"

~~~
Someone
Building the kernel with clang has been possible or a while.
[https://releases.llvm.org/9.0.0/tools/clang/docs/ReleaseNote...](https://releases.llvm.org/9.0.0/tools/clang/docs/ReleaseNotes.html#linux-
kernel):

 _" 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
Yes, I consider within the past year to qualify as "now," but I've updated my
post :)

~~~
ndesaulniers
Within 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.

------
ndesaulniers
I removed GCC from AOSP a month ago.

[https://android-
review.googlesource.com/q/topic:%22rm_gcc%22...](https://android-
review.googlesource.com/q/topic:%22rm_gcc%22+\(status:open%20OR%20status:merged\))

~~~
zbowling
We 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.

------
CalChris
So 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
Yes, they are updating it regularly:
[https://svnweb.freebsd.org/base/head/UPDATING?revision=35849...](https://svnweb.freebsd.org/base/head/UPDATING?revision=358497&view=markup)

------
jhoechtl
Can 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
> 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
Google 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
It'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.

------
tannhaeuser
Could someone explain the particular pain points of GPLv3 as it relates to use
of gcc?

~~~
nrclark
The 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
That'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.

------
miguelmota
FreeBSD has removed GCC from base system but GCC is still available as a port

------
johannkokos
What about binutils? Is it removed too?

~~~
emaste
Mostly, 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)

------
anfilt
Well 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.

------
AdmiralAsshat
I 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
Where does it say that it delivers better performance than GCC? AFAIK the main
reason they switched is the license.

~~~
lvh
Regardless 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.

------
peter_d_sherman
In 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...

