JBenda / inkcpp

Inkle Ink C++ Runtime with JSON>Binary Compiler
MIT License
73 stars 15 forks source link

inkcpp_test does not compile on M1 / arm64 #36

Closed weaversam8 closed 2 years ago

weaversam8 commented 2 years ago

While attempting to use this project with inkcpp-python, I followed the instructions listed in the README to build the project. Each of the subprojects builds successfully with the exception of inkcpp_test, which reports an invalid opcode in inline assembly:

[ 77%] Building CXX object inkcpp_test/CMakeFiles/inkcpp_test.dir/Main.cpp.o
In file included from /Users/username/Git/inkcpp/inkcpp_test/Main.cpp:2:
/Users/username/Git/inkcpp/inkcpp_test/catch.hpp:7937:13: error: unrecognized instruction mnemonic, did you mean: bit, cnt, hint, ins, not?
            CATCH_BREAK_INTO_DEBUGGER();
            ^
/Users/username/Git/inkcpp/inkcpp_test/catch.hpp:7651:79: note: expanded from macro 'CATCH_BREAK_INTO_DEBUGGER'
    #define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }()
                                                                              ^
/Users/username/Git/inkcpp/inkcpp_test/catch.hpp:7630:34: note: expanded from macro 'CATCH_TRAP'
    #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
                                 ^
<inline asm>:1:2: note: instantiated into assembly here
        int $3
        ^
1 error generated.
make[2]: *** [inkcpp_test/CMakeFiles/inkcpp_test.dir/Main.cpp.o] Error 1
make[1]: *** [inkcpp_test/CMakeFiles/inkcpp_test.dir/all] Error 2
make: *** [all] Error 2

This is an issue with Catch, and was fixed in this commit: https://github.com/catchorg/Catch2/commit/a25c1a24af8bffd35727a888a307ff0280cf9387 (released as v3.0.0-preview3.)

weaversam8 commented 2 years ago

Actually, it looks like this was fixed in this commit: https://github.com/catchorg/Catch2/commit/bad3c930493d08dd7cca2af57cf355d9b7cddb21 and released in the v2.x track as v2.12.4, which should be an easier upgrade than to the v3.x track.

JBenda commented 2 years ago

Thanks for the research, I will take a look

JBenda commented 2 years ago

Can you try to compile #37, it's contains the v2.12.4.

weaversam8 commented 2 years ago

Yep, #37 fixes the issue!

JBenda commented 2 years ago

Thank you for the input