Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac M1 fails to build while building tests #140

Open
MarekChleb opened this issue Feb 4, 2022 · 5 comments · May be fixed by #151
Open

Mac M1 fails to build while building tests #140

MarekChleb opened this issue Feb 4, 2022 · 5 comments · May be fixed by #151

Comments

@MarekChleb
Copy link

MarekChleb commented Feb 4, 2022

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.

@dlmanning
Copy link

@ibc, @jmillan : This was actually fixed in catch a couple years ago. Just need to update the version of catch checked into the repo:

catchorg/Catch2@a25c1a2

@ibc
Copy link
Member

ibc commented Dec 22, 2022

Will try to do it today.

@ibc
Copy link
Member

ibc commented Dec 22, 2022

@dlmanning Ive updated libsdptransform with latest Catch and latest jsoncpp. Trying to do the same here.

@ibc
Copy link
Member

ibc commented Dec 22, 2022

But will do another day because Gellert decided that today was a good day to create yet another menubar related PR.

@ibc ibc linked a pull request Dec 22, 2022 that will close this issue
@ibc
Copy link
Member

ibc commented Dec 22, 2022

@dlmanning working on PR #151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants