Can't build Rack from source on M1 Mac

I’m attempting to build Rack from source on my M1 Mac but have been so far unsuccessful. (It seems I have to do this in order to be able to debug my plugin.)

I’ve followed the development instructions and currently getting the following error when running make dep for Rack:

ld: warning: ignoring file .libs/utf.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64
Undefined symbols for architecture x86_64:
  "_utf8_check_first", referenced from:
      _lex_scan in load.o
      _lex_unget_unsave in load.o
      _stream_get in load.o
  "_utf8_check_full", referenced from:
      _stream_get in load.o
  "_utf8_check_string", referenced from:
      _read_string in pack_unpack.o
      _json_object_set_new in value.o
      _json_string in value.o
      _json_stringn in value.o
      _json_string_set in value.o
      _json_string_setn in value.o
      _json_vsprintf in value.o
      ...
  "_utf8_encode", referenced from:
      _lex_scan in load.o
  "_utf8_iterate", referenced from:
      _dump_string in dump.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [libjansson.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [lib/libjansson.a] Error 2
make: *** [dep] Error 2

Full output: gist:f1428d297a63e5f230d7ada17d50cfe8 · GitHub

Other notes:

  • I installed the x86 version of brew (in /usr/local) and installed all the dependencies with it.
  • I am switching to x86 in the terminal before running make (ie arch -x86_64 zsh).
  • I’m on macOS 13.4.1
  • Using Rack source v2.4.1

I haven’t been able to find a solution—any suggestions welcome. Thanks!

It compiles for me with the native brew and without the “arch -x86_64”