compiler question: why bsd disowned BSD's C? Gcc, and clang

debguy

Well-Known Member

Reaction score: 24
Messages: 275

My belief is GCC became convoluted needed "gold" and recipes to cross compile. Clang ... has a legal message saying "it should be free but some authors need to contact them" (saying that 15 yrs now). c++ ? I don't trust it compared to C version 2: it can't compile itself wholey relies on gcc? Runs real slow? Says it cross compiles but cannot get itself on to the compiled machine? Is C portable?? Meanwhile MS compilers now support only intel fastcall and if you access another users folder it days 10 minutes to open the folder (why??), but MS is machining for ARM for pc store sale of touch notebooks profits.

MS hacked BFD and LD, and clang is still working on making LDD so it has linker scripts like LD but I'm unsure why they are redoing those. Meanwhile, apparently clang has to re-release AS(1) to be clang-ish. I can't say I ever liked GAS(1) syntax I was a fan of TASM.

So these are misconceptions maybe. I'd like to hear the history from anyone who knows about how FreeBSD disowned their own fast C compiler (was/is it a cross compiler???) and went for GCC (and so has Intel, including vulkan aware gcc), and then later FreeBSD has disowned GCC to use CLANG++ instead of gcc (clang to me looks like hacky c++ from people whodon't understand what a parsing issue they are creating and slow compile speed issue they are creating). More misconceptions I'm sure.

What is the history of FreeBSD's compiler choices and cross compiling ability impacts? Why should people use contribute to CLANG (which I think requires gcc in it's chain)? Why did apple choose clang?
 

obsigna

Daemon

Reaction score: 858
Messages: 1,253

Clang can very well build LLVM and itself without GCC. For example, this is how I setup a cross-building environment including the complete toolchain on a fast x86_64 system (i7 @ 4GHz, 4 core) for my BeagleBone Black - ARMv7.

# mkdir -p ~/install/BBB
# cd ~/install/BBB
# git clone https://git.freebsd.org/src.git src
# cd src
# setenv BASEDIR /root/install/BBB
# setenv MAKEOBJDIRPREFIX $BASEDIR/obj
# make -j4 buildworld TARGET_ARCH=armv7 WORLD_FLAGS="MK_LLDB=yes"
# ee sys/arm/conf/BBBCustom
# make -j4 buildkernel TARGET_ARCH=armv7 KERNCONF=BBBCustom

On said i7 system, having yet a spinning HDD, building the ARM world takes about 2 hours. This inludes the bootstrap phase, where the system toolchain builds the cross-building tool chain from the sources, and the ARMv7 tool-chain as well which can be readily deployed to the BBB. Then cross-building the custom BBB kernel takes less than half an hour.

Again, in the course of buildworld, the LLVM/Clang x86_64/ARMv7 cross-building tool chain including the linker and debugger is produced, and that on a system which even remotely didn't see/know anything about GCC.
 

leebrown66

Well-Known Member

Reaction score: 167
Messages: 440

I thought the move away from GCC was just another step in getting rid of GNU licensed things in base.
 

Alain De Vos

Daemon

Reaction score: 547
Messages: 1,892

I'm not a legal specialist but i installed linux on a zfs filesystem. The linux-kernel and the zfs-kernel-module have different licenses.
Yet it is ok ?
 

Zirias

Daemon

Reaction score: 1,341
Messages: 2,362

  • Posting ridiculously wrong claims
  • by the dozen
  • chosen so they might provoke emotional reactions
  • and hidden behind best-innocent "ignorance"
  • while not ever reacting on the actual content of any reply
… rings a bell? Yes, you guys are falling for it. Just ignore that nonsense thread.
 

Zirias

Daemon

Reaction score: 1,341
Messages: 2,362

That's pretty close to the kind of answer someone on here is obviously hoping for…

(btw, very first nonsensical take is the "own fast C compiler". Even 386BSD 1.0 – and of course FreeBSD 1.0 – shipped with GCC… and more gibberish follows. should really be obvious to anyone)
 

kpedersen

Son of Beastie

Reaction score: 1,853
Messages: 2,730

That's pretty close to the kind of answer someone on here is obviously hoping for…

(btw, very first nonsensical take is the "own fast C compiler". Even 386BSD 1.0 – and of course FreeBSD 1.0 – shipped with GCC… and more gibberish follows. should really be obvious to anyone)
Yep, it was the "why bsd disowned BSD's C?" that convinced me the whole premise was daft and I stayed quiet.

But the best thing to do with these kinds of threads is... to turn them into a history lesson! ;)

In particular it is interesting that as early as 1.0 shipped with GCC. I don't suppose you know what the system compiler was before that? I recall looking for this info before but came up blank.
 

ralphbsz

Son of Beastie

Reaction score: 2,186
Messages: 3,138

Search for "Ken Thompson compiler". I think somewhere on the web you can find a writeup by Dennis Ritchie on the early history of C, and how it evolved (in terms of compiler technology) from BCPL via B.

I was going to say "Google for Ken Thompson compiler", but Ken works for Google, so that would be self-referential. If you want to learn some language history, also read about Bliss (another BCPL derivative), which became the language VMS was mostly implemented in. And if you want to have even more historical fun, look up PL/S: It is a small and restricted derivative of PL/1, which was used (roughly at the same time, the early to mid 70s) at IBM for OS development.

Anyone remember who wrote PCC, the portable C compiler (which I think also came out of Bell Labs)? I think that was the compile that was in use when BSD started at Berkeley. I vaguely remember using pcc, but I don't remember on which machine (Sun? Next?). By the way, the first letter of BSD is neither G nor F, so flame wars about licenses are wholly pointless.

And obviously debguy is just posting a troll thread here.
 

kpedersen

Son of Beastie

Reaction score: 1,853
Messages: 2,730

Anyone remember who wrote PCC, the portable C compiler (which I think also came out of Bell Labs)? I think that was the compile that was in use when BSD started at Berkeley. I vaguely remember using pcc, but I don't remember on which machine (Sun? Next?).
Hmm, I have used both Ken's C compiler and PCC (I think) as part of Plan 9. Unless the PCC there is not quite the same. Maybe that is to do with the APE Posix compat layer.
 

bakul

Member

Reaction score: 42
Messages: 92

pcc was by Steve C. Johnson. What was used on v7. BSD also used it until 4.4BSD when it was replaced by gcc. plan9's pcc has a different pedigree. I think Ken's C compiler debuted on plan9. It is one of the fastest compilers and cross-compiling needs no more than setting an environment variable. I once cross-compiled i386 plan9 userland + kernel on the original raspberryPI where it took 4 minutes! Half of it was for compiling ghostscript.
 

Zirias

Daemon

Reaction score: 1,341
Messages: 2,362

But the best thing to do with these kinds of threads is... to turn them into a history lesson! ;)
Yeah probably. I don't know enough about Unix/BSD history to tell anything about compilers used on PDP-11/VAX.

But when the system should target i386, well, you needed a compiler targeting it. And it seems that GCC was for a long time the only decent (free / opensource) compiler for that purpose. So, sure it was used. Although GNU never completed the operating system project (yep, that HURDs *scnr*, the rest is [Linux] history), they did complete a decent compiler for i386.
 

ralphbsz

Son of Beastie

Reaction score: 2,186
Messages: 3,138

I think Ken's C compiler debuted on plan9.
Who wrote the original B and C compilers, using BCPL on the old Bell labs mainframe? Was that Dennis or Ken? Most likely, that's sort of a meaningless question: They probably both contributed, although only one was doing the typing.
 
OP
debguy

debguy

Well-Known Member

Reaction score: 24
Messages: 275

Thank you. It'd be very difficult to track down why these things happened.

"Clang can very well build LLVM and itself without gcc"

did you say BBC custom? :) well I was (trying to) build LLVM bootstrapping earlier to later, recently. i had to first upgrade my gcc to compile LLVM. llvm compiled but clang failed. i eventually ran into the fact even had i succeeded that RECENT GCC BUILDS are required to build parts of LLVM+CLANG, since clang "doesn't make all of these products itself" (if forget what, was it gas or bfd or ld? i forget. but you CANNOT build LLVM+CLANG and build a cross compiler and go from 32bit to 64bit linux "just like that". it's way more involved than that. and it's scary really because these knots in the base systems have only been getting worse not better).

your free to disagree!

"Should an enduser care about licenses. If it works it's ok ?" I will not argue with that. However suprise lawsuits are bad: meaning many GPL sources have SUED users of their code and won the lawsuits while other GLP'ers who never had the lawsuit clout: got 0. That's not ok: getting a surprise lawsuit for warez you thought were free, or paying some and ... punishing others. But licenses I think are "ok".

  • "Posting ridiculously wrong claims"
That's why i disclaimed they might be wrong. However: from my perspective, a lowly end user not in the know, that's what I had collected by experience.

===============

I have to say no one answered any of the FreeBSD history question: why PCC was shot down replaced with gcc then gcc was dismissed for llvm (which in the back end requires gcc for parts of the build according to me!)

thank you very much for discussing
 

Zirias

Daemon

Reaction score: 1,341
Messages: 2,362

There was never any "pcc" in FreeBSD. You continue blabbering.

As for switching to llvm, licensing is important, but it has a few other advantages as well. And OF COURSE it can bootstrap, that's what every FreeBSD build is doing. Plus it can cross-compile without the need of building it specifically for each target platform.

Now stop the nonsense please.
 
Top