snestracker
snestracker copied to clipboard
[make] Clang on Linux
Describe the bug
- The build system has GNU's
g++hardcoded in several places. That is to say,CCis unconditionally redefined asg++and some non-standardized variables likemagic_CC,magic_CXXandCPPare used for compilation - 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 anud2instruction, which causing the aforementioned illegal instruction signal to be emitted.
To Reproduce Steps to reproduce the behavior: 1)
- Attempt to compile ST on Linux without GCC
- Errors out very quickly on
g++: command not found - Use the 0001 patch i posted on the discord server. Additionally pass
magic_CC=$CC magic_CXX=$CXXto make (assuming both default to their clang equivalents) - Build succeeds and binaries are being generated
- Running either of them results in a
SIGILL
Expected behavior
- Free choice of compiler, no matter the platform's default / common option
- Working binaries with Clang
Screenshots

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.