Subject: [bug#41579] [PATCH 1/2] utils: Add 'cc-for-target'.

From: Marius Bakke <[email-masked]>
Date: Thu, 28 May 2020 19:13:08 +0200

* guix/utils.scm (cc-for-target): New procedure.
---
 guix/utils.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/guix/utils.scm b/guix/utils.scm
index d7b197fa44..69e3f0a934 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -6,7 +6,7 @@
 ;;; Copyright © 2016 Mathieu Lirzin <[email-masked]>
 ;;; Copyright © 2015 David Thompson <[email-masked]>
 ;;; Copyright © 2017 Mathieu Othacehe <[email-masked]>
-;;; Copyright © 2018 Marius Bakke <[email-masked]>
+;;; Copyright © 2018, 2020 Marius Bakke <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -78,6 +78,8 @@
             target-aarch64?
             target-arm?
             target-64bit?
+            cc-for-target
+
             version-compare
             version>?
             version>=?
@@ -506,6 +508,11 @@ a character other than '@'."
                                                (%current-system))))
   (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "ppc64")))
 
+(define* (cc-for-target #:optional (target (%current-target-system)))
+  (if target
+      (string-append target "-gcc")
+      "gcc"))
+
 (define version-compare
   (let ((strverscmp
          (let ((sym (or (dynamic-func "strverscmp" (dynamic-link))
-- 
2.26.2