Some1NamedNate Posted July 20, 2021 Being a longtime user of Windows, I've always wondered, from a Linux user's standpoint, what the best compiler is these days for building the top Doom source ports from source code in the areas of performance and, if necessary, reliability. I've selected the GNU Compiler Collection and Clang from LLVM as the contenders for this matter. I'd like to know your thoughts. Comment away! 0 Quote Share this post Link to post
chungy Posted July 20, 2021 (edited) As a general rule of thumb, GCC has better a code optimizer and support for a heck of a lot more platforms than Clang does. Still, Clang makes an explicit goal to support all GNU extensions so that compatibility is rarely an issue. GCC also tends to be the default compiler on Linux distros and very few users are going to care enough to change that. It might be noteworthy that FreeBSD 13 changed out GCC for Clang in the base system, so it's more of a reverse situation there. 7 hours ago, Some1NamedNate said: I've selected the GNU Compiler Collection and Clang from LLVM as the contenders for this matter. You've also selected basically the only two compilers that really exist. Yeah there's some more minor ones floating around, but none of them have anywhere close to the features of GCC and Clang. :P Edited July 20, 2021 by chungy 1 Quote Share this post Link to post
ketmar Posted July 25, 2021 just check what compiler sourceport authors recommend. also, as @chungy said, GCC is de-facto standard on GNU/Linux systems, so it's better to try it first, and revert to clang only when the sourceport strictly requires so. 0 Quote Share this post Link to post
LexiMax Posted July 26, 2021 Whichever is installed by default, so long as there are no missing features and it doesn’t trigger a compiler bug. 0 Quote Share this post Link to post
Gibbon Posted July 27, 2021 (edited) On Linux, I would only ever use and support GCC. Clang is great, but on Linux there can be some issues, especially if you use GCC pragmas (Clang tries to run GCC and CLANG pragmas). On Linux, it still feels like a beta compiler, but that is likely due to Linux being so heavily invested in GCC. On a Mac, Clang is my go to compiler. I do test with homebrew's gcc versions but for release builds, always Clang. Windows, I use MSVC. Having three distinct compilers give your code the required versatility to compile cleanly. Some warnings will come with GCC, some with MSVC. In general, using the 'first class citizen' compiler of each platform you support is a good idea. Edited July 27, 2021 by Gibbon 2 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.