Hacker News new | ask | show | jobs
by mhd 1342 days ago
If this hasn't changed recently, the two official compilers for OpenBSD are clang and gcc 4.2, the latter for some more obscure architectures unsupported by clang. The specific version is used because gcc changed its license after that, and I think this was before the C99 support of gcc was basically finished (4.5?).

So technically speaking, it would sound possible, if such a large code base doesn't trigger various compiler bugs and undefined standard issues, never mind some low level gcc extensions (asm etc.) probably being used.

Haven't heard of someone doing that, though.

1 comments

The last attempt I'm aware of was over a decade ago now, at the time there was some interest in building the system (kernel+userland) with pcc (Portable C Compiler), ultimately LLVM/clang won out in the end.

https://undeadly.org/cgi?action=article;sid=20091228231142

so mostly clang then gcc.

Totally unable to compile without such grotesquely and absurdely massive c++ coded compilers like linux.

sad.

Well, projects like the BSDs need a lot of platform support, where even LLVM is still lacking. You wouldn’t want a different compiler for each arch. There simply aren’t that many candidates.
eat the bullet: cleanup syscalls, write a full kernel using risc-v assembly with a conservative usage of the preprocessor. Get done with compilers for good... and only for that it would be even worth maintaining full assembly code for the few major ISAs and a generic C implementation which compiles with naive, small and simple C compilers and certainly not gcc or clang.

I know what to do now.