News for hackers. Stuff that matters.
Re:When can glibc be built with Clang? by e40 on Wednesday October 13, 2021 @02:48PM (#28855847)
I looked and didn't see any answer to... is there a difference in performance of the gcc vs llvm compiled kernel?
Re:When can glibc be built with Clang? by mjevans on Wednesday October 13, 2021 @03:49PM (#28856715)
They're different compilers so I assume the answer would be yes.

If it isn't possible to build currently I expect minimal clarifying changes wouldn't have much impact on runtime performance (where it compiled previously), but as mentioned in another post would lower the risk of bugs and maintenance burden with clearer code.

Portability, validation, across multiple platforms is one way of exposing bugs and weaknesses in logical description.

Re:When can glibc be built with Clang? by astrange on Thursday October 14, 2021 @05:51PM (#28870662)
> They're different compilers so I assume the answer would be yes.

They have highly similar designs (at least in the middle-end which is the important part), or did, but gcc's remaining large customers care most about optimizations so it's still somewhat ahead there.

Re:When can glibc be built with Clang? by stncls on Wednesday October 13, 2021 @04:25PM (#28857234)
Those are not necessarily comprehensive benchmarks, but it seems clang is doing very well in many workloads:

https://www.phoronix.com/scan.php?page=article&item=clang-lt...

Re:When can glibc be built with Clang? by voldacar on Wednesday October 13, 2021 @04:35PM (#28857346)
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? by tambourine_man on Wednesday October 13, 2021 @05:40PM (#28858035)
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.
Re:When can glibc be built with Clang? by voldacar on Wednesday October 13, 2021 @05:57PM (#28858185)
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? by qalmakka on Saturday October 16, 2021 @04:35AM (#28886406)
These benchmarks also don't reflect how good are the backends for different CPU architectures in GCC and LLVM.

For instance, GCC is by far the dominant compiler on GNU/Linux on x86, while LLVM has a almost total monopoly of AArch64 (think about Android NDK + iOS + macOS). I think it would be quite natural for the GCC AArch64 backend to get less focus compared to its x86 counterpart. It's a complicated landscape that is always full of gotchas, and that's why I don't like these kinds of benchmarks a lot.

Re:When can glibc be built with Clang? by pyler on Wednesday October 13, 2021 @06:41PM (#28858496)
source? llvm 13?
Re:When can glibc be built with Clang? by mhh__ on Thursday October 14, 2021 @03:17PM (#28868706)
It's still true. Basically it's even as makes no difference except for ones where GCC is still way ahead. Real world code has to be measured for each to decide.

The key takeaway is that GCC is still an extremely good compiler.

Re:When can glibc be built with Clang? by hulitu on Thursday October 14, 2021 @10:48AM (#28865004)
That's why they said since 5 years. My experience was that clang seems longer compiling but due to the fact i did not compiled the same program with clang and gcc i would not take it as a rule.
Re:When can glibc be built with Clang? by voldacar on Thursday October 14, 2021 @05:40PM (#28870535)
I was referring to performance of the compiled program, not the time it takes to compile it.