distro: Configure ld and GCC to not look under /usr & co.

This fixes impurities with non-chroot builds on LFS-style distros.

* distro/packages/base.scm (binutils): Pass `--with-lib-path'.
  (gcc-4.7): Pass `--with-local-prefix'.
* distro/packages/make-bootstrap.scm (%binutils-static): Pass
  `--with-lib-path'.
This commit is contained in:
Ludovic Courtès 2012-11-16 00:23:06 +01:00
parent ec4d308a9e
commit 01d45404f6
2 changed files with 9 additions and 4 deletions

View file

@ -320,10 +320,12 @@ (define-public binutils
`(("patch/new-dtags" ,(search-patch "binutils-ld-new-dtags.patch")))) `(("patch/new-dtags" ,(search-patch "binutils-ld-new-dtags.patch"))))
(arguments (arguments
`(#:patches (list (assoc-ref %build-inputs "patch/new-dtags")) `(#:patches (list (assoc-ref %build-inputs "patch/new-dtags"))
#:configure-flags '(;; Add `-static-libgcc' to not retain a dependency
;; on GCC when bootstrapping.
"LDFLAGS=-static-libgcc"
;; Add `-static-libgcc' to not retain a dependency on GCC when ;; Don't search under /usr/lib & co.
;; bootstrapping. "--with-lib-path=/no-ld-lib-path")))
#:configure-flags '("LDFLAGS=-static-libgcc")))
(synopsis "GNU Binutils, tools for manipulating binaries (linker, (synopsis "GNU Binutils, tools for manipulating binaries (linker,
assembler, etc.)") assembler, etc.)")
@ -358,6 +360,9 @@ (define-public gcc-4.7
`("--enable-plugin" `("--enable-plugin"
"--enable-languages=c,c++" "--enable-languages=c,c++"
"--disable-multilib" "--disable-multilib"
"--with-local-prefix=/no-gcc-local-prefix"
,(let ((libc (assoc-ref %build-inputs "libc"))) ,(let ((libc (assoc-ref %build-inputs "libc")))
(if libc (if libc
(string-append "--with-native-system-header-dir=" libc (string-append "--with-native-system-header-dir=" libc

View file

@ -225,7 +225,7 @@ (define %binutils-static
(package (inherit binutils) (package (inherit binutils)
(name "binutils-static") (name "binutils-static")
(arguments (arguments
`(#:configure-flags '("--disable-gold") `(#:configure-flags '("--disable-gold" "--with-lib-path=/no-ld-lib-path")
#:strip-flags '("--strip-all") #:strip-flags '("--strip-all")
#:phases (alist-cons-before #:phases (alist-cons-before
'configure 'all-static 'configure 'all-static