Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-2127

Build fails on macOS on arm64

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.2
    • Affects Version/s: 3.6.1
    • Component/s: Portability
    • None
    • Environment:
      macOS 11.0.1 RC, Xcode 12.2 RC, Apple arm64 Development Test Kit machine

      The error message seen when building on macOS on arm64 (sometimes called aarch64) is:

      src/third_party/catch/include/catch.hpp:8122:13: error: invalid token in expression
                  CATCH_BREAK_INTO_DEBUGGER();
                  ^
      src/third_party/catch/include/catch.hpp:7834:79: note: expanded from macro 'CATCH_BREAK_INTO_DEBUGGER'
          #define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }()
                                                                                    ^
      src/third_party/catch/include/catch.hpp:7813:34: note: expanded from macro 'CATCH_TRAP'
          #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
                                       ^
      <inline asm>:1:6: note: instantiated into assembly here
              int $3
                  ^
      

      catch.hpp contains this code:

       

      #ifdef CATCH_PLATFORM_MAC
      #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
      

       

      Note the absence of any conditional for different assembly code for different architectures or fallback non-assembly code for unknown architectures—which is present in the subsequent CATCH_PLATFORM_LINUX block. (Why do you need different blocks for macOS and Linux?)

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            ryandesign Ryan Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: