From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: [PATCH] gnu: gcc-static: Remove -lgcc_s from GNU_USER_TARGET_LIB_SPEC Date: Wed, 07 Jan 2015 10:30:45 -0500 Message-ID: <87k30y1uca.fsf_-_@netris.org> References: <87lhln7mlk.fsf@netris.org> <87a9225o3z.fsf@netris.org> <8761cp6i17.fsf@netris.org> <871tnd6as5.fsf@netris.org> <87k314gael.fsf@gnu.org> <87mw5zyakn.fsf@netris.org> <87ppaq68af.fsf@gnu.org> <87vbki1v2i.fsf@netris.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8sZ5-0006n5-Ov for guix-devel@gnu.org; Wed, 07 Jan 2015 10:30:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y8sYz-0007fr-N9 for guix-devel@gnu.org; Wed, 07 Jan 2015 10:30:31 -0500 In-Reply-To: <87vbki1v2i.fsf@netris.org> (Mark H. Weaver's message of "Wed, 07 Jan 2015 10:15:01 -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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain Here's my proposed patch to fix our generated bootstrap gcc to not try to link with the nonexistent -lgcc_s. I used this to create the current set of 'armhf-linux' bootstrap tarballs and to bootstrap my initial system (including 'emacs'). What do you think? Mark --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-gcc-static-Remove-lgcc_s-from-GNU_USER_TARGET_LI.patch Content-Description: [PATCH] gnu: gcc-static: Remove -lgcc_s from GNU_USER_TARGET_LIB_SPEC >From 108a59f3b2ec5d3551c54d5f713a7ed34171acb3 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 1 Jan 2015 22:53:55 -0500 Subject: [PATCH] gnu: gcc-static: Remove -lgcc_s from GNU_USER_TARGET_LIB_SPEC. * gnu/packages/make-bootstrap.scm (%gcc-static): Add 'remove-lgcc_s phase. * gnu/packages/gcc.scm (gcc-4.7): Add comment. --- gnu/packages/gcc.scm | 5 +++++ gnu/packages/make-bootstrap.scm | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index a510af4..02de128 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -207,6 +207,11 @@ where the OS part is overloaded to denote a specific ABI---into GCC ;; libgcc_s.so when pthread_cancel support is needed, but ;; having it in the application's RUNPATH isn't enough; see ;; .) + ;; + ;; NOTE: The '-lgcc_s' added below needs to be removed in a + ;; later phase of %gcc-static. If you change the string + ;; below, make sure to update the relevant code in + ;; %gcc-static package as needed. (format #f "#define GNU_USER_TARGET_LIB_SPEC \ \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib -lgcc_s}} \" ~a" libc libc libdir libdir suffix)) diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index f6ef2e3..88fad0e 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -430,7 +430,19 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." "--disable-libquadmath" "--disable-decimal-float") (remove (cut string-match "--(.*plugin|enable-languages)" <>) - ,flags)))))) + ,flags))) + ((#:phases phases) + `(alist-cons-after + 'pre-configure 'remove-lgcc_s + (lambda _ + ;; Remove the '-lgcc_s' added to GNU_USER_TARGET_LIB_SPEC in + ;; the 'pre-configure phase of our main gcc package, because + ;; that shared library is not present in this static gcc. See + ;; . + (substitute* (find-files "gcc/config" + "^gnu-user.*\\.h$") + ((" -lgcc_s}}") "}}"))) + ,phases))))) (native-inputs (if (%current-target-system) `(;; When doing a Canadian cross, we need GMP/MPFR/MPC both -- 2.1.2 --=-=-=--