On 12/03/2022 14:22, Nikos Chantziaras wrote:
On 12/03/2022 10:43, Dale wrote:
https://bugs.gentoo.org/767700
Is that the one? It mentions the target but I don't quite understand
the why. The biggest thing, will this break something if I let it do
it?
No. Unlike GCC, LLVM/Clang is always a cross-compiler. This just enables
some extra targets. It won't actually affect anything other than perhaps
the binaries becoming a bit larger.
I don't fully understand it (and I thought gcc was moving in the same
direction), but Clang is a front-end, compiling C to "Intermediate
Representation". LLVM is a middle/back end which calls optimisation
modules on the IR which finally end up spitting out machine code - for
whatever definition of machine code floats your boat.
So I guess adding these extra targets just adds another LLVM module that
just happens to spit out these extra different machine codes.
But that's how LLVM can compile so many different languages - it simply
converts IR to machine code. There's a whole bunch of different front
ends, it's just that Clang is the most well known because the world and
his dog work in C/C++. I believe there's a rust front end, amongst
others, but it feels like other languages are a bit "second class". Not
intentionally, but the C guys have so much input into the IR that the
other languages get swamped, and people take a while to realise that
what was a good decision for C was not a good decision for languages in
general, and the other guys are playing catch-up because nobody noticed.
That's not a dig at anybody, it's just life.
I used to follow this on the LLVM mailing list, but that's now migrated
to discourse, and I think I'm amongst a lot of people who didn't follow
it ...
Cheers,
Wol