On Thu, Apr 20, 2017 at 07:46:00PM +0000, Christian Weisgerber wrote: > On 2017-04-20, Heiko <bd09c6fmxoq2...@intermezzo.net> wrote: > > > So I guess the main advantage is the license? > > Or is clang technically (binaries, debug) better? > > OpenBSD does not live in a bubble. If it did, we could still be > using gcc 2.95. But it turns out people, including OpenBSD developers, > want to run third-party software. And the ecosystem requires a > modern compiler. > > You know what an amd64 package bulk build looks like? First, we > use our system compiler to build gcc 4.9. Then we use gcc 4.9 to > build clang. And then we use clang to build interesting stuff, > like web browsers. Stages like a moonshot rocket. > > If we want to continue to be able to run third-party software, we > need a newer compiler.
The reason for having both compilers in base is that the "transition" is not easy. There is a lot of stuff in the ports tree that's rather old and doesn't compile with a newer compiler (pre-ANSI C for instance, GNU-C89 inlines, lots of stuff that thinks C++ templates are macros, thus is happy with totally out-of-order definitions... and so on and so forth) Some adventurous souls are currently figuring out how to prepare stuff for clang/clang++, while not breaking it for base gcc. (some other souls run arm64, so they don't really have a choice in that matter). This is by no means finished. clang is a challenge, lld is another, arm64 is a third one. But there is some modicum of progress...