Other Cross Compiling Rust from Windows To FreeBSD

I'm trying to cross compile Rust from Windows to FreeBSD.


I am running into this

error: linker cc not found

when I add
[target.x86_64-unknown-freebsd]
linker = "rust-lld"


to my config (searching online led me to believe rust-lld is a cross compiler I could use for this) led to


error: linking with rust-lld failed: exit code: 1
= note: "rust-lld" "-flavor" "gnu" "C:\Users\user\PycharmProjects\day22FREEBSD\target\x86_64-unknown-freebsd\release\deps\day22FREEBSD-3cd52ede534defad.day22FREEBSD.cfd4c7cb-cgu.0.rcgu.o" "--as-needed" "-L" "C:\Users\user\PycharmProjects\day22FREEBSD\target\x86_64-unknown-freebsd\release\deps" "-L" "C:\Users\user\PycharmProjects\day22FREEBSD\target\release\deps" "-L" "C:\Users\user\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-unknown-freebsd\lib" "--start-group" "--end-group" "-Bstatic" "C:\Users\user\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-unknown-freebsd\lib\libcompiler_builtins-d6530f7e306b0f50.rlib" "-Bdynamic" "-lexecinfo" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lrt" "-lutil" "-lexecinfo" "-lkvm" "-lutil" "-lprocstat" "-lrt" "--eh-frame-hdr" "-znoexecstack" "-L" "C:\Users\user\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-unknown-freebsd\lib" "-o" "C:\Users\user\PycharmProjects\day22FREEBSD\target\x86_64-unknown-freebsd\release\deps\day22FREEBSD-3cd52ede534defad" "--gc-sections" "-pie" "-zrelro" "-znow" "-O1"

= note: rust-lld: error: unable to find library -lexecinfo

rust-lld: error: unable to find library -lpthread

rust-lld: error: unable to find library -lgcc_s

rust-lld: error: unable to find library -lc

rust-lld: error: unable to find library -lm

rust-lld: error: unable to find library -lrt

rust-lld: error: unable to find library -lpthread

rust-lld: error: unable to find library -lrt

rust-lld: error: unable to find library -lutil

rust-lld: error: unable to find library -lexecinfo

rust-lld: error: unable to find library -lkvm

rust-lld: error: unable to find library -lutil

rust-lld: error: unable to find library -lprocstat

rust-lld: error: unable to find library -lrt

It looks like I'm missing FreeBSD versions of system libraries, and don't know how to proceed.
 
What's the output of "rustup target add freebsd" and "rustup target list" ?
rustup target list
....
x86_64-apple-darwin
x86_64-apple-ios
x86_64-fortanix-unknown-sgx
x86_64-fuchsia
x86_64-linux-android
x86_64-pc-solaris
x86_64-pc-windows-gnu
x86_64-pc-windows-msvc (installed)
x86_64-sun-solaris
x86_64-unknown-freebsd (installed)
...

rustup target add freebsd
error: toolchain 'nightly-x86_64-pc-windows-msvc' does not contain component 'rust-std' for target 'freebsd'
note: not all platforms have the standard library pre-compiled: https://doc.rust-lang.org/nightly/rustc/platform-support.html
help: consider using `cargo build -Z build-std` instead

Running cargo build -Z build-std (with or without --release) results in the same
...
rust-lld: error: unable to find library -lexecinfo
rust-lld: error: unable to find library -lpthread
...
errors.
 
Top