guix_mirror_bot pushed a commit to branch rust-team
in repository guix.

commit 121d083875bc73ae50035c159266f98672c0ac0e
Author: Efraim Flashner <[email protected]>
AuthorDate: Fri Nov 20 09:08:52 2026 +0200

    gnu: make-rust-sysroot: Build with cross-gcc for avr.
    
    * gnu/packages/rust.scm (make-rust-sysroot/implementation): Add avr to
    the platforms which use a cross-gcc.
    * guix/build/cargo-build-system.scm (configure): When building for avr
    have the .cargo/config use the cross-gcc as the linker.
---
 gnu/packages/rust.scm             | 3 ++-
 guix/build/cargo-build-system.scm | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index a14088f14ae..6c65471cc07 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -1462,7 +1462,8 @@ exec -a \"$0\" \"~a\" \"$@\""
    (define (with-cross-gcc? target)
      (or (target-linux? target)
          (target-hurd? target)
-         (target-mingw? target)))
+         (target-mingw? target)
+         (target-avr? target)))
    (when (with-cross-gcc? target)
     (unless (platform-rust-target (lookup-platform-by-target target))
       (raise
diff --git a/guix/build/cargo-build-system.scm 
b/guix/build/cargo-build-system.scm
index cb0647bdf31..9b283430eed 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -249,9 +249,11 @@ libraries or executables."
       (display (string-append "\
 [target." (getenv "CARGO_BUILD_TARGET") "]
 "
+;; Keep this synced with the list in make-rust-sysroot/implementation.
 (if (or (string-contains target "linux")    ; (target-linux?)
         (string-suffix? "-gnu" target)      ; (target-hurd?)
-        (string-suffix? "-mingw32" target)) ; (target-mingw?)
+        (string-suffix? "-mingw32" target)  ; (target-mingw?)
+        (string=? target "avr"))            ; (target-avr?)
     (string-append "linker = '" target "-gcc'")
     "linker = 'lld'")
 "\n

Reply via email to