Jump to content

GCC or Clang for building the top Doom source ports on Unix-like systems?


Recommended Posts

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!

Share this post


Link to post

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 by chungy

Share this post


Link to post

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.

Share this post


Link to post

Whichever is installed by default, so long as there are no missing features and it doesn’t trigger a compiler bug.

Share this post


Link to post

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 by Gibbon

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...