Project

General

Profile

Feature #2037

[Linux] Get Doomsday working with Clang

Added by rhargrave almost 9 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Enhancement
Target version:
-
Start date:
2015-05-05
% Done:

0%

Tags:

Description

Last night, I was using clang to do some analysis. This worked well and generated, without complaint, a binary that would run. I figured that I may as well run the binary to see if anything was broken by Clang. For the most part, things seem to be well behaved. That being said, there is a major blocker to generating a functional binary with Clang: attempting to enter a game results in a segmentation fault. I have only confirmed this for libdoom.

That being said, here's a list of what is working:

  • Ring Zero -- all of it (so far)
  • Main menus
  • Loading a game plugin
  • Settings, etc...
  • Sound

Unfortunately, I do not have a stack trace; however, I will likely try to update this with one when I bother with Clang again.

I think it might not be a bad idea to support Clang if it does not require preprocessor hacking nonsense to maintain GCC compatibility, as does MS Visual Crapper. My reasoning for this is that Clang excels at not only optimization of the program run-time, but also at locating and reporting potential issues in code with output that is both better formatted and more understandable than that of GCC. It also compiles somewhat faster than GCC, which significantly reduced the time it took me to compile Doomsday.

History

#1 Updated by skyjake almost 9 years ago

  • Tags changed from Clang, GCC to Clang, GCC, Unix
  • Subject changed from Get Doomsday working with Clang to [Unix] Get Doomsday working with Clang

It should be noted that Apple's version of Clang works flawlessly. Problems with the regular Clang may be just a matter of some compiler settings being incorrect.

Also, which version of Clang are you using?

#2 Updated by skyjake almost 9 years ago

  • Tags changed from Clang, GCC, Unix to Clang, GCC
  • Subject changed from [Unix] Get Doomsday working with Clang to [Linux] Get Doomsday working with Clang

#3 Updated by skyjake almost 9 years ago

  • Tags changed from Clang, GCC to Clang, GCC, Linux

#4 Updated by rhargrave almost 9 years ago

Ah yes! I forgot to mention the version of Clang I am using.

Here are some stats, including version:

Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0)
Target: x86_64-pc-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/bin/../lib/gcc/i586-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/i586-linux-gnu/4.9.2
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7.4
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.2
Found candidate GCC installation: /usr/lib/gcc/i586-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i586-linux-gnu/4.9.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.2
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Selected multilib: .;@m64

#5 Updated by skyjake almost 9 years ago

aee9fecd may have some impact on this issue.

#6 Updated by rhargrave almost 9 years ago

I saw that, and was somewhat excited.

I'll run off a clang build and post back. This time around, I'll also grab a stack trace if possible.

#7 Updated by rhargrave almost 9 years ago

Build with clang and -O0 earlier. Tried starting a new game and it looks like a stack overflow occurred in map.cpp in the method sortLineOwners which called itself repeatedly with a null list parameter.

#8 Updated by rhargrave almost 9 years ago

  • Status changed from New to Resolved

I just recently produced a build of doomsday using clang that does not immediately appear to have any issues:

I can

  • Start the engine
  • Load a plugin
  • Start a game
  • Play said game normally

I have yet to observe any defects, and as such I am marking this issue resolved.

That build was produced from revision c351b0d. I am unsure at which revision there ceased to be problems. It is also worth noting that the malfunctioning build was produced using Make as the underlying build system, whereas the functioning build was produced with Ninja. I highly doubt that the build system contributed at all to any errors.

#9 Updated by skyjake about 8 years ago

  • Status changed from Resolved to Closed
  • Assignee set to cmbruns

#10 Updated by skyjake about 8 years ago

  • Assignee changed from cmbruns to rhargrave

Also available in: Atom PDF