[CXX-2127] Build fails on macOS on arm64 Created: 09/Nov/20  Updated: 28/Oct/23  Resolved: 11/Nov/20

Status: Closed
Project: C++ Driver
Component/s: Portability
Affects Version/s: 3.6.1
Fix Version/s: 3.6.2

Type: Bug Priority: Major - P3
Reporter: Ryan Schmidt Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

macOS 11.0.1 RC, Xcode 12.2 RC, Apple arm64 Development Test Kit machine



 Description   

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?)



 Comments   
Comment by Githook User [ 11/Nov/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CXX-2127 upgrade Catch2 to v2.13.4 (#748)
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/f5d84229ce86d6edaaa72c7b160b4d7f45688897

Comment by Kevin Albertson [ 11/Nov/20 ]

PR: https://github.com/mongodb/mongo-cxx-driver/pull/748

Comment by Kevin Albertson [ 11/Nov/20 ]

Hi ryandesign, thank you for bringing this to our attention. We vendor in a copy of Catch2 v2.10.2, which appears to have fixed this bug in v2.12.4. We'll look into fixing this soon.

Generated at Wed Feb 07 22:04:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.