Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

On the subject of clang

Name: Anonymous 2014-01-16 15:21

My coworker has been burdened with the task of building our product for Apple devices, which, it turns out, means that he has to use clang instead of gcc. On discovering this I did a couple of laps around the room shouting "EXTERMINATE" but when I settled down I wondered if there was a reason they used this. Is this just apple being hipsters or is there a reason to switch compilers?

Name: Anonymous 2014-01-16 15:31

Licensing.

Name: Anonymous 2014-01-16 15:51

gcc is shit

Name: Anonymous 2014-01-16 16:06

apple wants to crush the GPL.

Name: Anonymous 2014-01-16 17:38

I know next to nothing about compilers, but from my experience with clang it has much saner warning and error messages than gcc or others.

Also from what i could gather the idea behind clang is to have a gcc compatible but actually maintainable compiler.

Name: Anonymous 2014-01-16 19:43

Those who use clang say it has good warning messages. They also keep saying things like ``GCC may produce faster executables, but Clang itself compiles the code faster!'', so I don't take their opinions very seriously. That said, competition among compilers is a damn good thing.

Name: Anonymous 2014-01-16 21:00

Clang uses LLVM which is an exposed (i.e. to the user via files and a small executable dictionary (i.e. tools)) intermediate representation which then gets compiled to machine code. It can also be interperted.

Also the target architecture is not a build time thing in LLVM so you don't have to rebuild your compiler if you want to target ARM, AVR, PIC etc. from your x86 or (different executable formats for that matter e.g. ELF, whatever Windows uses). On the other hand, LLVM can't (yet) target even 5% of what GCC can.

It's also easy for languages all compiling to LLVM to communicate with eachother (one O.K sounding one is Julia).

Name: Anonymous 2014-01-16 23:42

Even OpenBSD is moving away from GPL. They are fucking insane. RMS is, I think, literally autistic. Have you heard the man speak?

Name: Anonymous 2014-01-16 23:45

I, by stark contrast, am autistic only figuratively.

Name: Anonymous 2014-01-16 23:49

>>9
He got pissed when I tried to hug him. I didn't even ask him for permission and I know I should have, but that makes me think he's literally autistic, without abusing the meaning of the word "literally" or using it for pure emphasis. I really mean it.

Name: Anonymous 2014-01-16 23:52

>>6
That's hilarious.

>>7
Thanks for the information.

Did you mean you don't have to rebuild your program, rather than "compiler?"

Name: Anonymous 2014-01-17 0:10

>>11
No, I meant compiler.

In the case of GCC, if you want to e.g. target ARM from x86 you have to build a compiler specifically for that from the GCC sources (i.e. the compiler target architecture is a build time option)

In the case of Clang, it always targets LLVM. The target architecture is a per invocation option for LLVM. You do not have to rebuild LLVM to target different architectures, you just invoke it with different options.

Your program will always have to be rebuilt to target a different architecture, in both cases. There have been efforts to make ``fat'' executable formats, (i.e. where the same file has machine code for various architectures and then a pointer for the loader) but AFAIK there has been little agreement between vendors.

Name: Anonymous 2014-01-17 1:13

>>12
Oh right. I've even used the Android gcc compiler. What a fool I am.

It seems like jamming all possible versions into a single executable is a bad idea. I mean, I see why, but there must be a better way.

Name: Anonymous 2014-01-17 6:40

>>13
Compile code into LLVM intermediate representation. Have a LLVM interpreter on each platform to translate the LLVM compiled binary into native code.

Name: Anonymous 2014-01-17 7:14

>>14
Compile code into Java bytecode representation. Have Java bytecode interpreter on each platform to translate the Java bytecode into native code.

I also fixed that last part for you :)

Name: Anonymous 2014-01-17 7:32

>>15
Whoa there, you just can't compare those two.

Name: Anonymous 2014-01-17 13:26

>>14
Yeah, I get that part, but the way >>12 is worded it looks like he's saying they're talking about putting "machine code for various architectures," i.e. totally different compiler output, into a single file, which is appealing but mostly crazy.

Name: Anonymous 2014-01-17 13:31

>>17
It's not really news, but the reason it hasn't caught on is the `mostly crazy' part. https://lwn.net/Articles/359070/

Name: Anonymous 2014-01-17 20:28

>>17
Yes that's what I was saying. However, I did not mean the ``they'' you speak of to refer to the clang and llvm people, just the various efforts to standardize fat binaries throughout the years.

Name: Anonymous 2014-01-19 3:59

ree--re--e--e--ve-cer-se- -e ennecooeroner--rr

Name: Anonymous 2017-01-05 18:25

>>6
What compiler should I use if my main priority is minimal binary size?

>>7
Couldn't they make a modular compiler where the architecture targets are described by some kind of data file external to the compiler program itself? So the compiler itself only knows how to convert from source to IR, but you could "plug in" different configuration files to tell it how to go from the IR to object code?

Name: Anonymous 2017-01-05 18:35

>>21
minimal binary size
Custom libc
https://github.com/lpsantil/rt0

Name: Anonymous 2017-01-05 18:51

>>22
non-portable and doesn't conform to DA STANDARD

Name: Anonymous 2017-01-05 19:02

Who the fuck is bumping old C threads?

Name: Anonymous 2017-01-05 19:08

>>22
202 lines of C is minimal these days? That's bloatware beyond belief.

Name: Anonymous 2017-01-05 21:16

>>25
Cudder is such a Cudder.

Name: x153@live.com 2017-01-06 1:56

>>24
my. so buck yow bluwfagb

Name: Anonymous 2017-01-07 14:06

>>24
Lamba ardur calgus

Name: Anonymous 2017-01-08 7:05

>>27
stop using my email. asshole

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List