cosmopolitan: M1 Ventura 13.4.1 zsh bus error

Hi, Darkest Hour is halloween text adventure made with C89. https://github.com/xet7/darkesthour

I added only this one line to source code for Cosmopolitan support:

#include <cosmo.h>

All various changes related to added Cosmopolitan to build scripts, readme etc:

Here is binary. It work on Linux and Windows, but not at M1.

I built it like this at Ubuntu 23.04 64bit:

cosmocc -o build/Cosmopolitan/darkest-hour-cosmo.com darkest-hour-cosmo.c

https://github.com/xet7/darkesthour/blob/main/Source/menu.sh#L127-L135

I installed Rosetta to M1 Ventura 13.4.1 and rebooted:

softwareupdate --install-rosetta --agree-to-license

But I get this error at M1:

$ arch -x86_64 ./darkest-hour-cosmo.com
zsh: bus error  arch -x86_64 ./darkest-hour-cosmo.com

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

After removing broken ape, redbean does run.

Do you mean “without assimilate”, or something else?

And was the broken ape installed by a previous run, or something else? Maybe apeinstall.sh?

I’ll try to figure out how to get my C code built correctly.

I’m interested in hearing how it goes!

For what it’s worth, I was able to use the README instructions to cross-compile redbean.com for aarch64 on an x86_64 machine, and then execute it on an M1 using ape.

Aside from that, #429 describes a patch that was made a year ago to support running x86 executables on M1 Macs using Rosetta. One difference, maybe, compared to what you tried: they assimilated their executables. (I don’t have access to the M1 anymore, so I can’t try that myself.)