Skip to content

Mac M1 fails to build while building tests #140

@MarekChleb

Description

@MarekChleb

Steps to reproduce

OSX_VERSION: 12.1 Monterey

Via tutorial first install depot tools and then:

cd /home/foo/src
mkdir webrtc-checkout
cd webrtc-checkout
fetch --nohooks webrtc
gclient sync
cd src
git checkout -b m94 refs/remotes/branch-heads/4606
gclient sync
gn gen out/m94 --args='is_debug=false is_component_build=false is_clang=true rtc_include_tests=false rtc_use_h264=true use_rtti=true mac_deployment_target="10.11" use_custom_libcxx=false'

ninja -C out/m94

cd /home/foo/src/libmediasoupclient

cmake . -Bbuild \
  -DLIBWEBRTC_INCLUDE_PATH:PATH=/home/foo/src/webrtc-checkout/src \
  -DLIBWEBRTC_BINARY_PATH:PATH=/home/foo/src/webrtc-checkout/src/out/m94/obj

make -C build/

Where is the bug

While doing make -C build/ we get:

[ 84%] Building CXX object libsdptransform/test/CMakeFiles/test_sdptransform.dir/tests.cpp.o
In file included from /Users/marekwawreniuk/Desktop/repos/c/libmediasoupclient/deps/libsdptransform/test/tests.cpp:4:
/Users/marekwawreniuk/Desktop/repos/c/libmediasoupclient/deps/libsdptransform/test/include/catch.hpp:8165:13: error: unrecognized instruction mnemonic, did you mean: bit, cnt, hint, ins, not?
            CATCH_BREAK_INTO_DEBUGGER();
            ^
/Users/marekwawreniuk/Desktop/repos/c/libmediasoupclient/deps/libsdptransform/test/include/catch.hpp:7877:79: note: expanded from macro 'CATCH_BREAK_INTO_DEBUGGER'
    #define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }()
                                                                              ^
/Users/marekwawreniuk/Desktop/repos/c/libmediasoupclient/deps/libsdptransform/test/include/catch.hpp:7855: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]: *** [libsdptransform/test/CMakeFiles/test_sdptransform.dir/tests.cpp.o] Error 1
make[1]: *** [libsdptransform/test/CMakeFiles/test_sdptransform.dir/all] Error 2
make: *** [all] Error 2

What worked

Based on different issue replacing #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */ with #define CATCH_TRAP() asm(".inst 0xd4200000") in libmediasoupclient/deps/libsdptransform/test/include/catch.hpp:7855 worked!

Solution

I have no idea, I don't really know C++, but this might help someone smarter create a sufficient solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions