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

TLDR:
I think the licensing becomes an issue when used commercially rather than individual end users.
If you are providing some compiler extensions and keeping the rest of the compiler proprietary then maybe.

However the vast majority of individuals will simply use a compiler to release a potentially closed-source product. This is fine. The GPL doesn't spread to binaries generated by GPL licensed programs.

The only weird spot was the LCC compiler that states "for non-commercial use only" which is awkward because I believe it spreads to output binaries (from some experience of its use in Quake III). I use this compiler a lot for developing extensions / tools (it is the only codebase I truly understand because of this book). However looking through the compiler source code (and the generated machine code)... no-one will tell if I used it or not ;)
 
However the vast majority of individuals will simply use a compiler to release a potentially closed-source product. This is fine. The GPL doesn't spread to binaries generated by GPL licensed programs.
This is interesting: What about parts of the runtime distributed with the compiler (e.g. libgcc) and often linked statically? Are there specific exceptions for them?
 
hardworkingnewbie well, static linking of non-GPL software with LGPL is allowed in principle, but you must provide the user with a way to "re-link" himself, which, in practice, is quite cumbersome… (at least for closed-source stuff. for opensource, it's implicit of course)
(I think this whole GNU idea of "enforcing freedom by imposing restrictions" is an oxymoron and badly flawed…)
 
hardworkingnewbie well, static linking of non-GPL software with LGPL is allowed in principle, but you must provide the user with a way to "re-link" himself, which, in practice, is quite cumbersome… (at least for closed-source stuff. for opensource, it's implicit of course)
(I think this whole GNU idea of "enforcing freedom by imposing restrictions" is an oxymoron and badly flawed…)
I do agree with freebuser ...
TLDR:
I think the licensing becomes an issue when used commercially rather than individual end users.
As for OP, I think his posts are improving as far as striking a decent tone, but could still stand some improvement in how they're written. Best I was able to understand, OP is wondering about how FreeBSD decided to use first its own homegrown C compiler, then switching to GCC, and then dropping GCC in favor of Clang.

My own reaction is that I've seen some info on the Internet about FreeBSD dropping GCC in favor of Clang at least partly due to size and performance issues, and the switch officially happened with 13-RELEASE. But I had no idea that FreeBSD had its own homegrown C compiler prior to adopting GCC as default C/C++ compiler. So, to be honest, I'm kinda interested myself. I tried a quick Google search - but was unable to find that info. 😅
 
People interested in such questions should visit or (if you have a couple of GB spare) download Prof. Diomidis Spinellis' excellent unix history repo @ https://github.com/dspinellis/unix-history-repo -- you can not only see what was shipped in 386BSD-0.1 but go all the way back to the beginning of unix and see how it evolved.
I think this is the only post I ever saw on this forum since 2009 that I'd like to give thanks and like at the same time.
 
gpl 3 is 'freedom with restrictions' in their opinion in order to be free you have to be able to run, modify, distribute code etc, gpl 3 was more strict than 2 and would have possibly prevented freebsd code being used in commercial projects
 
This is interesting: What about parts of the runtime distributed with the compiler (e.g. libgcc) and often linked statically? Are there specific exceptions for them?
I think these are addressed here. The FAQ at the bottom is useful too.

This does mention it came about from GPLv3. I actually don't know about earlier versions. I think they had exceptions too.

Considering Apple used GCC for a time, they must have had something in place so that they could still take their source to the grave with them.
 
Uhm, I'll quote myself here from this very thread:

-> FreeBSD never "adopted" GCC.
Seems like I may need to learn to read in Git...
People interested in such questions should visit or (if you have a couple of GB spare) download Prof. Diomidis Spinellis' excellent unix history repo @ https://github.com/dspinellis/unix-history-repo -- you can not only see what was shipped in 386BSD-0.1 but go all the way back to the beginning of unix and see how it evolved.
I appreciate bakul 's tip, would be nice if I had the expertise to properly take advantage of it.
 
Seems like I may need to learn to read in Git...

I appreciate bakul 's tip, would be nice if I had the expertise to properly take advantage of it.
Well, on PDP-11/VAX, there was probably a different compiler ;) if you're interested, that would be a way to find out…

But on x86, for a long time, GCC was the only sane opensource compiler. It wouldn't have made sense for 386BSD to reinvent the wheel here. Trolls just write nonsense and see who "bites".
 
Which brings me to this related question. Are there interesting c compilers other than clang/llvm & gcc i should try on freebsd ?
I found : ucc,tcc,sdcc,pcc,nwcc,flatcc,bcc
 
Question is: for what purpose? Just to have a look at them and play around with them, or to do real development stuff?
Even playing around with special purpose compilers/assemblers has value. Learning the logic behind their design, and getting it down, and being able to compare the logic patterns - it's that kind of skill that would be valuable for projects like Russia's Elbrus 8C (Discussion right here on these forums) or China's Loongson. Politics aside, this looks like serious brain gymnastics (A term I credit Alain De Vos with inventing ;) ) to keep people busy :p
 
There are of course quite some "special purpose" compilers, like e.g. devel/cc65 targeting machines like the C64 :cool: – I don't program the C64 in C, but use cc65's assembler (ca65).
I was playing with that the other day when testing out this processor emulator:
https://gitlab.com/limdingwen/6502js-but-c

I do like these simple C compilers (and very nice minimal emulators). Everything feels like it is in my grasp of understanding haha.
 
Everything feels like it is in my grasp of understanding haha.
That's why I still enjoy programming the C64, this machine can be understood as a whole by a human being :cool: not that I know every single bit in every memory-mapped register by heart (this machine uses MMIO exclusively, there's an I/O area that can be mapped to 0xd000-0xdfff, I love this simplicity), but that can be looked up quickly if needed.

It's also nice to know it can be programmed in C, although I didn't do that so far.

BTW, sorry for the OT, but here's one of my more recent works:
View: https://www.youtube.com/watch?v=EaeMbr6TuXQ

The interesting thing about it might be that it was created with devel/cc65, especially using its linker (ld65) that's designed as a classic C linker, but works for assembly modules just as well :cool:
 
Which brings me to this related question. Are there interesting c compilers other than clang/llvm & gcc i should try on freebsd ?
I found : ucc,tcc,sdcc,pcc,nwcc,flatcc,bcc
I don't see the point of using older and less well-maintained "just for fun", that's probably a waste of time. Right now, among the free and commonly used compilers for x86 machines (32- and 64-bit), clang is the gold standard, when measured by the efficiency of the generated code. There are compilers that are "better" than gcc and clang in that respect. For example, the Portland Group makes a superb C++ and Fortran compiler. Their main focus is parallel programming, today mostly using GPUs. But even even on non-parallel codes on x86 it generates excellent code, which is typically faster than that from free compilers. But: The PG compilers cost money, I think big money. And buying them just for compiling regular programs for a single CPU would be silly; the small performance benefit has no relation to the large cost. If you have a few tenthousand CPUs and a million GPUs, then it matters greatly.
 
I deal with different non-GCC, non-Clang & non-MSVC compilers a lot (although definitely not as much as a couple of years ago given the "recent" efforts on "modularizing" existing compilers).
For example, TCC is something I work with a lot: https://bellard.org/tcc/
 
Back
Top