Bug in cross-compiling a simple hello world?

I tried (from a Mac M1):

crystal build --target x86_64-apple-darwin src/hello.cr

The result is:

Error: execution of command failed with code: 1: `cc "${@}" -o /Users/sergehulne/Documents/code/Crystal/0_hello/hello/hello  -rdynamic -L/opt/homebrew/Cellar/crystal/1.7.2/libexec/../../../../lib -lgc -L/opt/homebrew/Cellar/libevent/2.1.12/lib -levent -liconv`

Where hello.cr is :

i = 0
while true
  p "next step : #{i+=1}"

This is not cross compiling. You’re just selecting a target which happens to be unable to be built on your host system. For actual cross compiling, you need to pass the --cross-compile flag.


Thank you!