Skip to content

Commit

Permalink
Fix build issue on Apple M1 with AppleClang
Browse files Browse the repository at this point in the history
 - Currently catch2 is header directly added in the project
 - Before switching to submodule (in separate PR), copying
   minimal fix from the upstream: catchorg/Catch2#1971
 - Update INSTALL.md for Apple M1

Fixes #527
  • Loading branch information
pramodk committed Mar 5, 2021
1 parent 6e81fe5 commit 6359fea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ Make sure to have latest flex/bison in $PATH :
export PATH=/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:/usr/local/bin/:$PATH
```

On Apple M1, corresponding brew paths are under `/opt/homebrew/opt/`:

```sh
export PATH=/opt/homebrew/opt/flex/bin:/opt/homebrew/opt/bison/bin:$PATH
```

### On Ubuntu

On Ubuntu (>=16.04) flex/bison versions are recent enough and are installed along with the system toolchain:
Expand Down
6 changes: 5 additions & 1 deletion ext/catch/catch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,11 @@ namespace Catch {

#ifdef CATCH_PLATFORM_MAC

#define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
#if defined(__i386__) || defined(__x86_64__)
#define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
#elif defined(__aarch64__)
#define CATCH_TRAP() __asm__(".inst 0xd4200000")
#endif

#elif defined(CATCH_PLATFORM_LINUX)
// If we can use inline assembler, do it because this allows us to break
Expand Down

0 comments on commit 6359fea

Please sign in to comment.