Closed iav closed 4 years ago
When cross-compiling Rust code using an Ubuntu host and a musl-libc target, rustc
actually needs to compile code for two different architectures.
build.rs
and macro code are compiled for the host Ubuntu system.Carefully setting up environment variables to support (1) and (2) is tricky. In this case, pg_config
is needed by build.rs
scripts which run at build time on the host. This is why there's a X86_64_UNKNOWN_LINUX_GNU
in the variable PG_CONFIG_X86_64_UNKNOWN_LINUX_GNU
. That information specified that when running pg_config
in the host environment, to use the copy in /usr/bin
.
Why set PG_CONFIG_X86_64_UNKNOWN_LINUX_GNU=/usr/bin/pg_config , not just builded /usr/local/musl/bin/pg_config?