guix_mirror_bot pushed a commit to branch rust-team
in repository guix.
commit 0056d529bb481fd44e909fc2d641468b28c8ad07
Author: Efraim Flashner <[email protected]>
AuthorDate: Sun Nov 8 16:36:54 2026 +0200
build-system/cargo: Don't unconditionally link with gcc.
* guix/build/cargo-build-system.scm (configure): Only use the
cross-compiled gcc as the linker on supported platforms.
---
guix/build/cargo-build-system.scm | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/guix/build/cargo-build-system.scm
b/guix/build/cargo-build-system.scm
index 86a9ccbb13b..9a82fca85fe 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -248,8 +248,13 @@ libraries or executables."
(when target
(display (string-append "\
[target." (getenv "CARGO_BUILD_TARGET") "]
-linker = '" target "-gcc'
-
+"
+(if (or (string-contains target "linux") ; (target-linux?)
+ (string-suffix? "-gnu" target) ; (target-hurd?)
+ (string-suffix? "-mingw32" target)) ; (target-mingw?)
+ (string-append "linker = '" target "-gcc'")
+ "linker = 'lld'")
+"\n
[build]
target = ['" (getenv "CARGO_BUILD_TARGET") "']\n") port))
(display (string-append "