snestracker icon indicating copy to clipboard operation
snestracker copied to clipboard

[make] Clang on Linux

Open OPNA2608 opened this issue 5 years ago • 0 comments

Describe the bug

  1. The build system has GNU's g++ hardcoded in several places. That is to say, CC is unconditionally redefined as g++ and some non-standardized variables like magic_CC, magic_CXX and CPP are used for compilation
  2. A Clang-compiled binary crashes with SIGILL. Several non-error warnings during compilation indicate that there are many functions with a declared return type that don't return any value, which generates an ud2 instruction, which causing the aforementioned illegal instruction signal to be emitted.

To Reproduce Steps to reproduce the behavior: 1)

  1. Attempt to compile ST on Linux without GCC
  2. Errors out very quickly on g++: command not found
  3. Use the 0001 patch i posted on the discord server. Additionally pass magic_CC=$CC magic_CXX=$CXX to make (assuming both default to their clang equivalents)
  4. Build succeeds and binaries are being generated
  5. Running either of them results in a SIGILL

Expected behavior

  1. Free choice of compiler, no matter the platform's default / common option
  2. Working binaries with Clang

Screenshots grafik grafik

Desktop (please complete the following information):

  • OS: Linux [NixOS 20.09 (Nightingale) x86_64]
  • Version v0.2.0

Additional context Discussed on the Discord server, WIP patches sent there.

OPNA2608 avatar Dec 03 '20 23:12 OPNA2608