Open 2opremio opened 1 year ago
musl
Rust compiler targets (which allow linking truly statically) don't seem to allow unwinding Rust panics (See https://github.com/stellar/go/actions/runs/3484488730/jobs/5829099175 , in which you can see the Rust call causing an ABORT signal)
Static linking is useful for non-cgo projects.
However, that doesn't really seem to be the case for CGO (at least when using glibc).
On one hand statically linking glibc (Linux): a. may cause problems when distributing the binaries due to its LGPL license b. isn't fully possible due to NSS. Note that when linking statically we get warnings like:
See https://github.com/2opremio/rust-plus-golang/actions/runs/3424937249/jobs/5705206558 for the full output and https://stackoverflow.com/questions/2725255/create-statically-linked-binary-that-uses-getaddrinfo for more details on the problem.
If we really want to statically link the binaries for linux, we should probably use musl instead of glibc:
aarch64-unknown-linux-musl
andx86_64-unknown-linux-musl
CC=musl-gcc
orCC=aarch64-linux-musl-gcc
(using https://musl.cc/aarch64-linux-musl-cross.tgz )