From: Carl Dong <contact@carldong.me>
To: 36346@debbugs.gnu.org
Cc: Carl Dong <accounts@carldong.me>
Subject: [bug#36346] [PATCH] gnu: Allow building toolchain with non-default libc.
Date: Sun, 23 Jun 2019 20:15:43 +0000 [thread overview]
Message-ID: <fwHqadVUPH-92wbCcmXEdA_4oFs1qI2MdeQOVljG4DcOQDwq16MlQpcw0vaAqX1dwRSbrGA5Qej3MOCn_6vIj8G9FOk-CYMEVZezH1ysoG8=@carldong.me> (raw)
From: Carl Dong <accounts@carldong.me>
* gnu/packages/base.scm (make-gcc-libc): Make public.
* gnu/packages/commencement.scm (make-gcc-toolchain): Add 'libc'
optional argument to specify using a non-default glibc package, also
make public.
---
gnu/packages/base.scm | 2 +-
gnu/packages/commencement.scm | 103 ++++++++++++++++++----------------
2 files changed, 55 insertions(+), 50 deletions(-)
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 15f35009a9..e40b40681b 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1009,7 +1009,7 @@ with the Linux kernel.")
(("/bin/pwd") "pwd"))
#t))))))))
-(define (make-gcc-libc base-gcc libc)
+(define-public (make-gcc-libc base-gcc libc)
"Return a GCC that targets LIBC."
(package (inherit base-gcc)
(name (string-append (package-name base-gcc) "-"
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index a8ec677cee..13912f1352 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -54,7 +54,8 @@
#:use-module (srfi srfi-26)
#:use-module (ice-9 vlist)
#:use-module (ice-9 match)
- #:use-module (ice-9 regex))
+ #:use-module (ice-9 regex)
+ #:export (make-gcc-toolchain))
;;; Commentary:
;;;
@@ -1014,55 +1015,59 @@ COREUTILS-FINAL vs. COREUTILS, etc."
;;; GCC toolchain.
;;;
-(define (make-gcc-toolchain gcc)
+(define* (make-gcc-toolchain gcc
+ #:optional
+ (libc #f))
"Return a complete toolchain for GCC."
- (package
- (name "gcc-toolchain")
- (version (package-version gcc))
- (source #f)
- (build-system trivial-build-system)
- (arguments
- '(#:modules ((guix build union))
- #:builder (begin
- (use-modules (ice-9 match)
- (srfi srfi-26)
- (guix build union))
-
- (let ((out (assoc-ref %outputs "out")))
-
- (match %build-inputs
- (((names . directories) ...)
- (union-build out directories)))
-
- (union-build (assoc-ref %outputs "debug")
- (list (assoc-ref %build-inputs
- "libc-debug")))
- (union-build (assoc-ref %outputs "static")
- (list (assoc-ref %build-inputs
- "libc-static")))
- #t))))
-
- (native-search-paths (package-native-search-paths gcc))
- (search-paths (package-search-paths gcc))
-
- (license (package-license gcc))
- (synopsis "Complete GCC tool chain for C/C++ development")
- (description
- "This package provides a complete GCC tool chain for C/C++ development to
-be installed in user profiles. This includes GCC, as well as libc (headers
-and binaries, plus debugging symbols in the @code{debug} output), and Binutils.")
- (home-page "https://gcc.gnu.org/")
- (outputs '("out" "debug" "static"))
-
- ;; 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
- ;; before Binutils' ld in the user's profile.
- (inputs `(("gcc" ,gcc)
- ("ld-wrapper" ,(car (assoc-ref %final-inputs "ld-wrapper")))
- ("binutils" ,binutils-final)
- ("libc" ,glibc-final)
- ("libc-debug" ,glibc-final "debug")
- ("libc-static" ,glibc-final "static")))))
+ (let ((gcc (if libc (make-gcc-libc gcc libc) gcc))
+ (libc (if libc libc gcc-final)))
+ (package
+ (name (string-append (package-name gcc) "-toolchain"))
+ (version (package-version gcc))
+ (source #f)
+ (build-system trivial-build-system)
+ (arguments
+ '(#:modules ((guix build union))
+ #:builder (begin
+ (use-modules (ice-9 match)
+ (srfi srfi-26)
+ (guix build union))
+
+ (let ((out (assoc-ref %outputs "out")))
+
+ (match %build-inputs
+ (((names . directories) ...)
+ (union-build out directories)))
+
+ (union-build (assoc-ref %outputs "debug")
+ (list (assoc-ref %build-inputs
+ "libc-debug")))
+ (union-build (assoc-ref %outputs "static")
+ (list (assoc-ref %build-inputs
+ "libc-static")))
+ #t))))
+
+ (native-search-paths (package-native-search-paths gcc))
+ (search-paths (package-search-paths gcc))
+
+ (license (package-license gcc))
+ (synopsis "Complete GCC tool chain for C/C++ development")
+ (description
+ "This package provides a complete GCC tool chain for C/C++ development to
+be installed in user profiles. This includes GCC, as well as libc (headers
+an d binaries, plus debugging symbols in the @code{debug} output), and Binutils.")
+ (home-page "https://gcc.gnu.org/")
+ (outputs '("out" "debug" "static"))
+
+ ;; 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
+ ;; before Binutils' ld in the user's profile.
+ (inputs `(("gcc" ,gcc)
+ ("ld-wrapper" ,(car (assoc-ref %final-inputs "ld-wrapper")))
+ ("binutils" ,binutils-final)
+ ("libc" ,libc)
+ ("libc-debug" ,libc "debug")
+ ("libc-static" ,libc "static"))))))
(define-public gcc-toolchain-4.8
(make-gcc-toolchain gcc-4.8))
--
2.22.0
next reply other threads:[~2019-06-23 20:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-23 20:15 Carl Dong [this message]
2019-07-05 22:46 ` [bug#36346] [PATCH] gnu: Allow building toolchain with non-default libc Marius Bakke
2019-07-07 14:42 ` Carl Dong
2019-07-08 15:34 ` Marius Bakke
2019-07-08 19:41 ` Carl Dong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='fwHqadVUPH-92wbCcmXEdA_4oFs1qI2MdeQOVljG4DcOQDwq16MlQpcw0vaAqX1dwRSbrGA5Qej3MOCn_6vIj8G9FOk-CYMEVZezH1ysoG8=@carldong.me' \
--to=contact@carldong.me \
--cc=36346@debbugs.gnu.org \
--cc=accounts@carldong.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).