From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Craven Subject: [PATCH] gnu: rustc: Retain binutils. Date: Mon, 9 Jan 2017 14:45:34 +0100 Message-ID: <20170109134534.15933-1-david@craven.ch> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cQaGp-0007wy-8Z for guix-devel@gnu.org; Mon, 09 Jan 2017 08:45:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cQaGk-0003Uf-CG for guix-devel@gnu.org; Mon, 09 Jan 2017 08:45:55 -0500 Received: from so254-10.mailgun.net ([198.61.254.10]:28399) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cQaGk-0003UU-7f for guix-devel@gnu.org; Mon, 09 Jan 2017 08:45:50 -0500 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/rust.scm (rustc)[arguments]: Retain binutils. Add wrap-rustc phase. Problem reported by Ben Woodcroft . --- gnu/packages/rust.scm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 97d0d7cb0..ae0453004 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -241,6 +241,7 @@ rustc-bootstrap and cargo-bootstrap packages.") (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (gcc (assoc-ref inputs "gcc")) + (binutils (assoc-ref inputs "binutils")) (python (assoc-ref inputs "python-2")) (rustc (assoc-ref inputs "rustc-bootstrap")) (llvm (assoc-ref inputs "llvm")) @@ -250,7 +251,7 @@ rustc-bootstrap and cargo-bootstrap packages.") (string-append "--datadir=" out "/share") (string-append "--infodir=" out "/share/info") (string-append "--default-linker=" gcc "/bin/gcc") - (string-append "--default-ar=" gcc "/bin/ar") + (string-append "--default-ar=" binutils "/bin/ar") (string-append "--python=" python "/bin/python2") (string-append "--local-rust-root=" rustc) (string-append "--llvm-root=" llvm) @@ -261,7 +262,16 @@ rustc-bootstrap and cargo-bootstrap packages.") ;;"--enable-rustbuild" "--disable-manage-submodules"))) ;; Rust uses a custom configure script (no autoconf). - (zero? (apply system* "./configure" flags)))))))) + (zero? (apply system* "./configure" flags))))) + (add-after 'install 'wrap-rustc + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (libc (assoc-ref inputs "libc")) + (ld-wrapper (assoc-ref inputs "ld-wrapper"))) + ;; Let gcc find ld and libc startup files. + (wrap-program (string-append out "/bin/rustc") + `("PATH" ":" prefix (,(string-append ld-wrapper "/bin"))) + `("LIBRARY_PATH" ":" suffix (,(string-append libc "/lib")))))))))) (synopsis "Compiler for the Rust progamming language") (description "Rust is a systems programming language that provides memory safety and thread safety guarantees.") -- 2.11.0