title: How to install valgrind on macOS Big Sur?
body: <p>I have recently purchased an M1 MacBook Pro and I am having issues installing valgrind on macOS Big Sur.
  What I have tried so far is:</p>
  <ul>
  <li>brew install valgrind which pops the error (brew is updated)</li>
  </ul>
  <p><code>Error: invalid attribute for formula 'valgrind': version (nil)</code></p>
  <ul>
  <li>edited head as indicated <a href="https://www.gungorbudak.com/blog/2018/04/28/how-to-install-valgrind-on-macos-high-sierra/" rel="nofollow noreferrer">here</a></li>
  <li>download manually from <a href="https://github.com/LouisBrunner/valgrind-macos/tree/feature/macos_11pp" rel="nofollow noreferrer">GitHub</a> following all indications listed but I get</li>
  </ul>
  <pre><code>Last 15 lines from /Users/homeuser/Library/Logs/Homebrew/valgrind/03.make:
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/i386/thread_status.h:254:9: error: unknown type name '_STRUCT_X86_DEBUG_STATE64'
  typedef _STRUCT_X86_DEBUG_STATE64 x86_debug_state64_t;
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/i386/thread_status.h:260:9: error: unknown type name '_STRUCT_X86_PAGEIN_STATE'
  typedef _STRUCT_X86_PAGEIN_STATE x86_pagein_state_t;
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/i386/thread_status.h:266:9: error: unknown type name '_STRUCT_X86_INSTRUCTION_STATE'
  typedef _STRUCT_X86_INSTRUCTION_STATE x86_instruction_state_t;
          ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  make[2]: *** [fixup_macho_loadcmds] Error 1
  make[2]: *** Waiting for unfinished jobs....
  make[1]: *** [all-recursive] Error 1
  make: *** [all] Error 2
  </code></pre>
  <ul>
  <li>looked into this older <a href="https://stackoverflow.com/questions/29667759/error-installing-valgrind-on-mac">fix</a> that used to work</li>
  </ul>
  <p>Unfortunately none of the methods work so I would really appreciate a solve to this problem as I need to use valgrind on a daily basis for university homework.</p>