What is the status of cross compilation? When try to compile a linux shared lib on my apple silicon mac, I get this error:
$ roc build hello.roc --lib --output libapp.so --target linux-x64
Couldn't find libgcc_s.so.1!
You may need to install libgcc
Couldn't find the libc development files!
We need the files crti.o, crtn.o, and Scrt1.o
On Ubuntu/Debian execute:
sudo apt install libc-dev
On ArchLinux/Manjaro execute:
sudo pacman -S glibc
On Fedora execute:
sudo dnf install glibc-devel
We looked in the following directories:
/usr/lib/x86_64-linux-gnu
/lib/x86_64-linux-gnu
/usr/lib64
/usr/lib
I've tried installing glibc with brew and mac ports but wasn't able to get either working.
Does it seem theoretically possible to cross compile like this? If so, any suggestions?
Does it help if you use the dev backend maybe? --dev
I can answer my own question... no there is another issue doing that.
An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: https://github.com/roc-lang/roc/issues/new/choose
thread 'main' panicked at 'failed to find data symbol for "panic_msg"', crates/compiler/gen_dev/src/object_builder.rs:1059:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
That error might be unrelated, when I use —dev with the command I used above I get the same error message about libc
Only the surgical linker does cross compiling currently
It only supports Linux and Windows exectutables
Doesn't do shared libraries
Okay gotcha
Last updated: Jul 05 2025 at 12:14 UTC