Linker Issue on FreeBSD
⚓ Rust 📅 2026-05-13 👤 surdeus 👁️ 1Hi! I have recently shifted from EndeavourOS to FreeBSD, and I am having an interesting problem with building packages.
If I am to cargo install a crate, it builds well enough, and I can run the resultant executable just fine. However, if I am to cargo build a crate, I get a linker error of the following flavour
= note: ld: error: undefined symbol: main
>>> referenced by crt1_s.S:64 (/usr/src/lib/csu/amd64/crt1_s.S:64)
>>> /usr/lib/Scrt1.o:(_start)
This was from an empty crate produced with cargo new, with no dependencies whatsoever. I could reproduce it from both the rustc installed from the FreeBSD ports tree, as well as that installed by rustup.
How can I circumvent this?
1 post - 1 participant
🏷️ Rust_feed