Created attachment 202856 [details] log file Hi, In Mk/Uses/cargo.mk there is this, line 65'ish: [...] RUSTC=${LOCALBASE}/bin/rustc \ RUSTDOC=${LOCALBASE}/bin/rustdoc \ RUSTFLAGS="${RUSTFLAGS} -C linker=${CC:Q} ${LDFLAGS:S/^/-C link-arg=/}" [...] RUSTFLAGS will end up being '-C linker=cc -C link-arg=' in case LDFLAGS is empty. This shouldn't be a problem and in fact for clang it is not, it will just ignore the "" parameter passed to the '-C linker' command. But for gcc it is a problem, it will ENOENT because rustc will pass a "", coming from the empty LDFLAGS as explained above. Example (from DragonFly BSD's DPorts) attached to this PR. Regards, Antonio Huete
A commit references this bug: Author: jbeich Date: Thu Mar 14 17:31:46 UTC 2019 New revision: 495724 URL: https://svnweb.freebsd.org/changeset/ports/495724 Log: USES=cargo to omit -C link-arg if LDFLAGS is empty DPorts overrides USE_GCC logic and doesn't opt in into SSP_CFLAGS, so its LDFLAGS are empty by default. PR: 236529 Reported by: Antonio Huete Jimenez Changes: head/Mk/Uses/cargo.mk
Sorry, I was under impression ${LDFLAGS:S/^/foo/} won't expand if LDFLAGS is empty. Try again and reopen if this is still a problem.