When can glibc be built with Clang?
11–20 of 30 posts
Re: When can glibc be built with Clang?
#12Earlier quoted context omitted.
GCC with max optimization still generally produces faster binaries than clang, but clang is constantly improving and in a few years they will probably be very similar.
Is that still true though? It was definitely the case some 5-10 years ago, but last time I checked they were pretty comparable, losing some, winning others.
If I were writing a program that needed to be really fast I would just compile with both on max optimizations and pick whichever was best. Most software isn't the linux kernel and will work fine with both compilers
Re: When can glibc be built with Clang?
#13Earlier quoted context omitted.
Is that still true though? It was definitely the case some 5-10 years ago, but last time I checked they were pretty comparable, losing some, winning others.
clang wins on some benchmarks, but gcc wins on over 50% of benchmarks, at least this always seems to be the case whenever I look it up. If I were writing a program that needed to be really fast I would just compile with both on max optimizations and pick whichever was best. Most software isn't the linux kernel and will work fine with both compilers
Re: When can glibc be built with Clang?
#14Zig builds its own copy of glibc with clang on a whole bunch of architectures: https://andrewkelley.me/post/zig-cc-powerful-drop-in-replace...
> And finally, we certainly do not ship the build system of glibc with Zig! I manually inspected, audited, and analyzed glibc's build system, and then by hand wrote code in the Zig compiler which hooks into Zig's caching system and performs a minimal build of only these start files, as needed.
It sounds to me like they build glibc using its own build system, but they use Zig to build the statically-linked glue code necessary to dynamically link to a system glibc. This allows cross-compiling to a glibc target without having glibc installed locally. Certainly very impressive.
Re: When can glibc be built with Clang?
#15Glibc has always been a whole rigamarole of nasty GCC-isms. I've been interested in building entire GNU/Linux systems with Clang for years, but I have always found a general lack of interest from both maintainers and the community. It's nice to see that finally something is moving, especially now that Linux is also finally buildable with LLVM.
A lot of the GNU tools have had dependencies on GNU-specific versions of classic tools because, for decades, the non-GNU versions sucked . Lots of hard-coded arbitrary limits (line lengths, file sizes, command line option counts), quadratic behaviours, crashes, weird corner cases. Edit - also, lack of updates. POSIX added a new feature to a tool 5 years ago? Well, the built-in tool that came with your classic Unix pr…
It has been a generation since it was common for people to pay for Unix, and then pay more for shitty developer tools.
That gcc has gone from savior to legacy in that time is a huge testament to the value the open source world has created. But I think people forget the bad old days pretty quickly.
Re: When can glibc be built with Clang?
#16Earlier quoted context omitted.
A lot of the GNU tools have had dependencies on GNU-specific versions of classic tools because, for decades, the non-GNU versions sucked . Lots of hard-coded arbitrary limits (line lengths, file sizes, command line option counts), quadratic behaviours, crashes, weird corner cases. Edit - also, lack of updates. POSIX added a new feature to a tool 5 years ago? Well, the built-in tool that came with your classic Unix pr…
> Similarly, the bundled `cc`s with classic Unices (if they were provided at all It has been a generation since it was common for people to pay for Unix, and then pay more for shitty developer tools. That gcc has gone from savior to legacy in that time is a huge testament to the value the open source world has created. But I think people forget the bad old days pretty quickly.
Re: When can glibc be built with Clang?
#17Earlier quoted context omitted.
A lot of the GNU tools have had dependencies on GNU-specific versions of classic tools because, for decades, the non-GNU versions sucked . Lots of hard-coded arbitrary limits (line lengths, file sizes, command line option counts), quadratic behaviours, crashes, weird corner cases. Edit - also, lack of updates. POSIX added a new feature to a tool 5 years ago? Well, the built-in tool that came with your classic Unix pr…
> Similarly, the bundled `cc`s with classic Unices (if they were provided at all It has been a generation since it was common for people to pay for Unix, and then pay more for shitty developer tools. That gcc has gone from savior to legacy in that time is a huge testament to the value the open source world has created. But I think people forget the bad old days pretty quickly.
Additionally, embedded also has plenty of POSIX like OSes that arent' Linux based.
Re: When can glibc be built with Clang?
#18Earlier quoted context omitted.
I looked and didn't see any answer to... is there a difference in performance of the gcc vs llvm compiled kernel?
GCC with max optimization still generally produces faster binaries than clang, but clang is constantly improving and in a few years they will probably be very similar.
Re: When can glibc be built with Clang?
#19Zig builds its own copy of glibc with clang on a whole bunch of architectures: https://andrewkelley.me/post/zig-cc-powerful-drop-in-replace...
Are you sure about that? > And finally, we certainly do not ship the build system of glibc with Zig! I manually inspected, audited, and analyzed glibc's build system, and then by hand wrote code in the Zig compiler which hooks into Zig's caching system and performs a minimal build of only these start files, as needed. It sounds to me like they build glibc using its own build system, but they use Zig to build the stat…
Re: When can glibc be built with Clang?
#20Earlier quoted context omitted.
GCC with max optimization still generally produces faster binaries than clang, but clang is constantly improving and in a few years they will probably be very similar.
Is that still true though? It was definitely the case some 5-10 years ago, but last time I checked they were pretty comparable, losing some, winning others.
The key takeaway is that GCC is still an extremely good compiler.