Subject: [PATCH 2/2] gnu: make-gcc-toolchain: Add 'lib' outputs.

From: Simon Tournier <[email-masked]>
Date: Tue, 9 May 2023 19:04:05 +0200

* gnu/packages/commencement.scm (make-gcc-toolchain): Add 'lib' outputs.
---
 gnu/packages/commencement.scm | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 7ec177e206..94d5884a9c 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -14,6 +14,7 @@
 ;;; Copyright © 2021 Julien Lepiller <[email-masked]>
 ;;; Copyright © 2022 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2022 Ekaitz Zarraga <[email-masked]>
+;;; Copyright © 2023 Simon Tournier <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3444,15 +3445,30 @@ (define* (make-gcc-toolchain gcc
                                     (filter-map (match-lambda
                                                   (("libc-debug" . _) #f)
                                                   (("libc-static" . _) #f)
+                                                  (("gcc-lib" . _) #f)
+                                                  (("gcc-debug" . _) #f)
                                                   ((_ . directory) directory))
                                                 %build-inputs))
 
                        (union-build (assoc-ref %outputs "debug")
                                     (list (assoc-ref %build-inputs
-                                                     "libc-debug")))
+                                                     "libc-debug")
+                                          (assoc-ref %build-inputs
+                                                     "gcc-debug")))
+
                        (union-build (assoc-ref %outputs "static")
                                     (list (assoc-ref %build-inputs
                                                      "libc-static")))
+
+                       (union-build (assoc-ref %outputs "lib")
+                                    (list (assoc-ref %build-inputs
+                                                     "ld-wrapper")
+                                          (assoc-ref %build-inputs
+                                                     "binutils")
+                                          (assoc-ref %build-inputs
+                                                     "gcc-lib")
+                                          (assoc-ref %build-inputs
+                                                     "libc")))
                        #t))))
 
       (native-search-paths
@@ -3474,7 +3490,7 @@ (define* (make-gcc-toolchain gcc
 binaries, plus debugging symbols in the @code{debug} output), and Binutils.  GCC
 is the GNU Compiler Collection.")
       (home-page "https://gcc.gnu.org/")
-      (outputs '("out" "debug" "static"))
+      (outputs '("out" "debug" "static" "lib"))
 
       ;; The main raison d'être of this "meta-package" is (1) to conveniently
       ;; install everything that we need, and (2) to make sure ld-wrapper comes
@@ -3484,8 +3500,9 @@ (define* (make-gcc-toolchain gcc
                 ("binutils" ,binutils-final)
                 ("libc" ,libc)
                 ("libc-debug" ,libc "debug")
-                ("libc-static" ,libc "static"))))))
-
+                ("libc-static" ,libc "static")
+                ("gcc-lib" ,gcc "lib")
+                ("gcc-debug" ,gcc "debug"))))))
 
 (define-public gcc-toolchain-4.8
   (make-gcc-toolchain gcc-4.8))
-- 
2.38.1