Or is this only for cross-compiling from Mac OS to Linux?
Using these two, we can compile a program in a Mac that will run on that Linux like this:
crystal build your_program.cr --cross-compile --target "x86_64-unknown-linux-gnu"
This will generate a .o (Object file) and will print a line with a command to execute on the system we are trying to cross-compile to. For example:
cc your_program.o -o your_program -lpcre -lrt -lm -lgc -lunwind