Toward _FORTIFY_SOURCE Parity Between Clang and GCC
developers.redhat.com
developers.redhat.com
Edit: there is some overlap, of course.
But if Clang is catching up, is that really bad?
I would argue that the pace of C++ compiler development has significantly increased since clang was introduced.
I would surmise that elimination of GCC or Clang -- in the way that Chrome has resulted in the elimination of more than one competing browser -- would be detrimental to C++ as a whole.
And therefore, I would say: yes, it's leading to more features and better compilation that if it was just one compiler toolchain.
https://www.youtube.com/watch?v=pQQTScuApWk
http://dreamsongs.com/Files/Energize.pdf
http://www.edm2.com/index.php/VisualAge_C%2B%2B_4.0_Review
Basically Smalltalk like development experience, just for C++. Too advanced for early 90's computers (it demanded very high end hardware).
GCC can't copy from Clang due to the FSF requiring a copyright assignment.
- Apple platforms
- Android (at least for the NDK used by third-party developers)
- PS4
- Nintendo Switch
- WebAssembly (there's no official "default", but GCC doesn't support it)
- eBPF (at least, GCC didn't support it until a few months ago)
Oh, and Google uses Clang to build Chromium for all of its supported platforms (Windows, Mac, Linux).
There were a couple of talks about it a couple of years ago.
2017 LLVM Developers’ Meeting: “Compiling Android userspace and Linux kernel with LLVM", https://www.youtube.com/watch?v=6l4DtR5exwo
"LPC2018 - Clang+Linux", https://www.youtube.com/watch?v=SSWUrWqnSz0
EDIT: typo and link for the mentioned talks.
Everyone that can move away from basing their toolchains has already moved into clang, or is in process of doing so.
Just have a look at Chrome and Firefox. They already use Clang on all platforms. On Windows they are working on replacing link with lld. Android has deprecated GCC completely. In the future it's gonna be clang + lld + libc++ all the way. And yeah, GDB and WinDbg will also be replaced by LLDB.
https://www.phoronix.com/scan.php?page=article&item=gcc9-cla...
https://medium.com/@alitech_2017/gcc-vs-clang-llvm-an-in-dep...
Remember that these are both Linux benchmarks; GCC on windows is a bit sketchy with MinGW. Things can usually be made to work, but Clang is the only real competitor to MSVC (unless you're counting Intel's crazy-expensive offering, which is not intended for general use).
This is the longest shot of what you mentioned. I can see a future where the llvm toolchain dominates but people still use GDB because of muscle memory. (Unless LLDB changes its commands to match GDB.)
Also GCC is guaranteed to live for at least 50 yrs because of freetards. GNU has die hard users and developers who would rather die than leave. LLVM has money, big money. It remains to be seen which matters more.
That sounds like bad for C++ developers: competition is what made clang as good as it is now, and GCC improved a lot since Clang's threat happened. Also, Clangs bugs would become the de facto standard (this is happening right now on the web with Chrome).
Monocultures are harmful…
So clang detects much more optimization opportunities with constant arguments, making it about 20x faster on the typical memcpy sizeof,... It's even faster than the glibc HW specific vectorized assembler optimizations, because the compiler knows much more than glibc, e.g. alignment, size. asm is an optimization barrier.
This is probably the reason clang has a different bos check than gcc.