gnu: guile-static: Use libgc build with `USE_LIBC_PRIVATES'.

* gnu/packages/make-bootstrap.scm (%guile-static): Use libgc build with
  CPPFLAGS=-DUSE_LIBC_PRIVATES.
* gnu/packages/bdw-gc.scm (libgc): Add TODO to always do it.
master
Ludovic Courtès 2013-02-13 21:42:34 +01:00
parent ab744c1af5
commit ddff766e38
2 changed files with 46 additions and 34 deletions

View File

@ -35,6 +35,7 @@
(base32 (base32
"05jwadjbrv8pr7z9cb4miskicxqpxm0pca4h2rg5cgbpajr2bx7b")))) "05jwadjbrv8pr7z9cb4miskicxqpxm0pca4h2rg5cgbpajr2bx7b"))))
(build-system gnu-build-system) (build-system gnu-build-system)
;; TODO: Build with -DUSE_LIBC_PRIVATES (see make-bootstrap.scm).
(synopsis "The Boehm-Demers-Weiser conservative garbage collector (synopsis "The Boehm-Demers-Weiser conservative garbage collector
for C and C++") for C and C++")
(description (description

View File

@ -28,6 +28,7 @@
#:use-module (gnu packages compression) #:use-module (gnu packages compression)
#:use-module (gnu packages gawk) #:use-module (gnu packages gawk)
#:use-module (gnu packages guile) #:use-module (gnu packages guile)
#:use-module (gnu packages bdw-gc)
#:use-module (gnu packages linux) #:use-module (gnu packages linux)
#:use-module (gnu packages multiprecision) #:use-module (gnu packages multiprecision)
#:use-module (ice-9 match) #:use-module (ice-9 match)
@ -399,44 +400,54 @@
;; A statically-linked Guile that is relocatable--i.e., it can search ;; A statically-linked Guile that is relocatable--i.e., it can search
;; .scm and .go files relative to its installation directory, rather ;; .scm and .go files relative to its installation directory, rather
;; than in hard-coded configure-time paths. ;; than in hard-coded configure-time paths.
(let ((guile (package (inherit guile-2.0) (let* ((libgc (package (inherit libgc)
(inputs (arguments
`(("patch/relocatable" ;; Make it so that we don't rely on /proc. This is
,(search-patch "guile-relocatable.patch")) ;; especially useful in an initrd run before /proc is
("patch/utf8" ;; mounted.
,(search-patch "guile-default-utf8.patch")) '(#:configure-flags '("CPPFLAGS=-DUSE_LIBC_PRIVATES")))))
,@(package-inputs guile-2.0))) (guile (package (inherit guile-2.0)
(arguments (inputs
`(;; When `configure' checks for ltdl availability, it `(("patch/relocatable"
;; doesn't try to link using libtool, and thus fails ,(search-patch "guile-relocatable.patch"))
;; because of a missing -ldl. Work around that. ("patch/utf8"
#:configure-flags '("LDFLAGS=-ldl") ,(search-patch "guile-default-utf8.patch"))
,@(package-inputs guile-2.0)))
(propagated-inputs
`(("bdw-gc" ,libgc)
,@(alist-delete "bdw-gc"
(package-propagated-inputs guile-2.0))))
(arguments
`(;; When `configure' checks for ltdl availability, it
;; doesn't try to link using libtool, and thus fails
;; because of a missing -ldl. Work around that.
#:configure-flags '("LDFLAGS=-ldl")
#:phases (alist-cons-before #:phases (alist-cons-before
'configure 'static-guile 'configure 'static-guile
(lambda _ (lambda _
(substitute* "libguile/Makefile.in" (substitute* "libguile/Makefile.in"
;; Create a statically-linked `guile' ;; Create a statically-linked `guile'
;; executable. ;; executable.
(("^guile_LDFLAGS =") (("^guile_LDFLAGS =")
"guile_LDFLAGS = -all-static") "guile_LDFLAGS = -all-static")
;; Add `-ldl' *after* libguile-2.0.la. ;; Add `-ldl' *after* libguile-2.0.la.
(("^guile_LDADD =(.*)$" _ ldadd) (("^guile_LDADD =(.*)$" _ ldadd)
(string-append "guile_LDADD = " (string-append "guile_LDADD = "
(string-trim-right ldadd) (string-trim-right ldadd)
" -ldl\n")))) " -ldl\n"))))
%standard-phases) %standard-phases)
;; Allow Guile to be relocated, as is needed during ;; Allow Guile to be relocated, as is needed during
;; bootstrap. ;; bootstrap.
#:patches #:patches
(list (assoc-ref %build-inputs "patch/relocatable") (list (assoc-ref %build-inputs "patch/relocatable")
(assoc-ref %build-inputs "patch/utf8")) (assoc-ref %build-inputs "patch/utf8"))
;; There are uses of `dynamic-link' in ;; There are uses of `dynamic-link' in
;; {foreign,coverage}.test that don't fly here. ;; {foreign,coverage}.test that don't fly here.
#:tests? #f))))) #:tests? #f)))))
(package-with-explicit-inputs (static-package guile) (package-with-explicit-inputs (static-package guile)
%standard-inputs-with-relocatable-glibc %standard-inputs-with-relocatable-glibc
(current-source-location)))) (current-source-location))))