summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-06-07 17:23:53 +0200
committerLudovic Courtès <ludo@gnu.org>2014-06-07 17:23:53 +0200
commit1c93be5600fb90a64cbbdf7a55061902d2ff150a (patch)
treefa80b05979d3499cf98b78cc798be36f63f98cd7 /gnu/packages
parent3d78d51d8e069c7f1cb61e201fc072819930ff88 (diff)
downloadguix-1c93be5600fb90a64cbbdf7a55061902d2ff150a.tar.gz
gnu: glibc: Make sure the bootstrap libc is not in $CPATH.
This fixes a bug whereby the bootstrap-glibc headers could be picked up
when building libc.so, which could be noticed by the fact that the
.debug files contained references to bootstrap-glibc.

* gnu/packages/base.scm (glibc-final-with-bootstrap-bash)[arguments]:
  Add 'pre-configure' phase.
  [inputs]: Remove 'alist-delete' call.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/base.scm29
1 files changed, 22 insertions, 7 deletions
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 937579b7d7..1755ba17e6 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -827,22 +827,37 @@ identifier SYSTEM."
                             ;; Build Sun/ONC RPC support.  In particular,
                             ;; install rpc/*.h.
                             "--enable-obsolete-rpc")
-                      ,flags)))))
+                      ,flags))
+            ((#:phases phases)
+             `(alist-cons-before
+               'configure 'pre-configure
+               (lambda* (#:key inputs #:allow-other-keys)
+                 ;; Don't clobber CPATH with the bootstrap libc.
+                 (setenv "NATIVE_CPATH" (getenv "CPATH"))
+                 (unsetenv "CPATH")
+
+                 ;; 'rpcgen' needs native libc headers to be built.
+                 (substitute* "sunrpc/Makefile"
+                   (("sunrpc-CPPFLAGS =.*" all)
+                    (string-append "CPATH = $(NATIVE_CPATH)\n"
+                                   "export CPATH\n"
+                                   all "\n"))))
+               ,phases)))))
      (propagated-inputs `(("linux-headers" ,(linux-libre-headers-boot0))))
      (native-inputs
       `(("texinfo" ,texinfo-boot0)
         ("perl" ,perl-boot0)))
      (inputs
-      `( ;; A native GCC is needed to build `cross-rpcgen'.
+      `(;; The boot inputs.  That includes the bootstrap libc.  We don't want
+        ;; it in $CPATH, hence the 'pre-configure' phase above.
+        ,@%boot1-inputs
+
+        ;; A native GCC is needed to build `cross-rpcgen'.
         ("native-gcc" ,@(assoc-ref %boot0-inputs "gcc"))
 
         ;; Here, we use the bootstrap Bash, which is not satisfactory
         ;; because we don't want to depend on bootstrap tools.
-        ("static-bash" ,@(assoc-ref %boot0-inputs "bash"))
-
-        ,@%boot1-inputs
-        ,@(alist-delete "static-bash"
-                        (package-inputs glibc))))))) ; patches
+        ("static-bash" ,@(assoc-ref %boot0-inputs "bash")))))))
 
 (define (cross-gcc-wrapper gcc binutils glibc bash)
   "Return a wrapper for the pseudo-cross toolchain GCC/BINUTILS/GLIBC