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

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?
 
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.
 
I thought the move away from GCC was just another step in getting rid of GNU licensed things in base.

Yes, of course, everybody knows this. Only some don't want to accept the fact that the name of FreeBSD does not start with 'GEEEH', but with an 'EFF'.

The actual incentive was, the switch of the GCC license to the GPLv3, which is completely incompatible with the BSD license. GCC 4.2.1 was the last version which was GPLv2 licensed, but this one came to age after all.
 
Should an enduser care about licenses. If it works it's ok ?
License complications do not start when the enduser simply uses software. Complications start when somebody distributes software. GPLv3 stuff may not be intermixed with BSD stuff in the base and be distributed in the whole package. Therefore, the latest GCC with the GPLv3 may be in the ports as a separate entity, and there is no problem in simply using it from the endusers point of view.

Anyway, you as the enduser, be careful when you setup a system not for you but for somebody else, e.g. your grandma. She can sue you, if you shipped (kind of a distribution) the system to her with GCC installed, but forgot to leave the sources and the license on the platters.
 
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 ?
 
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 ?
Yes, it is OK, as long as you do not distribute it as a whole. If you do distribute GPL'ed stuff together with something else, you better consult legal specialists before. Usually, you are safe, if you leave the source code and the licence on a prominent place.

Like Hamlet:
To distribute, or not to distribute, that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take Arms against a Sea of troubles,
And by opposing end them: to die, to ...
 
  • 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.
 
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)
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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
 
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.
 
... did you say BBC custom?
No, read again. Anyway, now I am no more surprised at all, since it is well known that dyslexics run into all sorts of problems when following written installation instructions.

... but you CANNOT build LLVM+CLANG and build a cross compiler and go from 32bit to 64bit linux
Just another fault caused by dyslexia, these forums are called FreeBSD and you want to discuss your Linux problem on a Linux support forum.

PoC of building LLVM without GCC on a vanilla FreeBSD 13.0-RELEASE (x86-64):
which gcc
Code:
gcc: Command not found.
cc --version
Code:
FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3fe)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin
cd /usr/ports/devel/llvm
make install clean

A few hours later you have another version of LLVM/Clang and its toolchain under /usr/local/(bin|lib).
 
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?
FreeBSD used gnu's c since inception, because it was the only one around at the time. They kept using it until gnu changed the licence from gpl2 to gpl3, which is contrary to views held by bsd-style licences, but couldn't dump it without an alternative, obviously.

Once clang came along, with the correct licence and a mature product, with better error emitting and less bloat, it was a no-brainer.

Gcc is still a better choice for cross-compiling and supports far more languages and architectures and that is why it's in ports (oh and some programs depend on it - possibly because of a compiler language not support by clang among other reasons).

Lldb is still inferior to gdb. But that part of the tool chain is getting better.
 
Back
Top