From 0d12bc744ee4fa7860b16a555d73dfc6f463ba57 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 27 Dec 2014 00:17:43 +0100 Subject: gnu: gcc-4.8: Update to 4.8.4. * gnu/packages/gcc.scm (gcc-4.8): Update to 4.8.4. Remove patch. * gnu/packages/patches/gcc-fix-pr61801.patch: Remove. * gnu-system.am (dist_patch_DATA): Adjust accordingly. --- gnu/packages/gcc.scm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gnu/packages/gcc.scm') diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 6dfdcea131..4b715f495e 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -261,15 +261,14 @@ (define-public gcc-4.7 (define-public gcc-4.8 (package (inherit gcc-4.7) - (version "4.8.3") + (version "4.8.4") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/gcc/gcc-" version "/gcc-" version ".tar.bz2")) (sha256 (base32 - "07hg10zs7gnqz58my10ch0zygizqh0z0bz6pv4pgxx45n48lz3ka")) - (patches (list (search-patch "gcc-fix-pr61801.patch"))))))) + "15c6gwm6dzsaagamxkak5smdkf1rdfbqqjs9jdbrp3lbg4ism02a")))))) (define-public gcc-4.9 (package (inherit gcc-4.7) -- cgit v1.2.3 From af07095516b56dcdd38bf1874da27de9c4c841f6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 27 Dec 2014 23:22:08 +0100 Subject: packages: Add 'file-type' field to 'search-path-specification'. Fixes . * guix/packages.scm (): Rename 'directories' field to 'files'. Add 'file-type'. (search-path-specification->sexp): Honor 'file-type'. * gnu/packages/autotools.scm, gnu/packages/bootstrap.scm, gnu/packages/cross-base.scm, gnu/packages/games.scm, gnu/packages/gcc.scm, gnu/packages/glib.scm, gnu/packages/guile.scm, gnu/packages/man.scm, gnu/packages/perl.scm, gnu/packages/pkg-config.scm, gnu/packages/python.scm, gnu/packages/ruby.scm, gnu/packages/xfce.scm: Change 'directories' to 'files'. * tests/packages.scm ("search paths"): Change 'directories' field to 'files'. * guix/scripts/environment.scm (for-each-search-path): Likewise. --- gnu/packages/autotools.scm | 2 +- gnu/packages/bootstrap.scm | 4 ++-- gnu/packages/cross-base.scm | 4 ++-- gnu/packages/games.scm | 2 +- gnu/packages/gcc.scm | 4 ++-- gnu/packages/glib.scm | 4 ++-- gnu/packages/guile.scm | 6 +++--- gnu/packages/man.scm | 2 +- gnu/packages/perl.scm | 2 +- gnu/packages/pkg-config.scm | 3 +-- gnu/packages/python.scm | 4 ++-- gnu/packages/ruby.scm | 7 +++---- gnu/packages/xfce.scm | 2 +- guix/packages.scm | 10 +++++----- guix/scripts/environment.scm | 3 +-- tests/packages.scm | 4 ++-- 16 files changed, 30 insertions(+), 33 deletions(-) (limited to 'gnu/packages/gcc.scm') diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm index 0094577210..a3afcdcfff 100644 --- a/gnu/packages/autotools.scm +++ b/gnu/packages/autotools.scm @@ -178,7 +178,7 @@ (define-public automake (native-search-paths (list (search-path-specification (variable "ACLOCAL_PATH") - (directories '("share/aclocal"))))) + (files '("share/aclocal"))))) (arguments '(#:modules ((guix build gnu-build-system) (guix build utils) diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index 854d97bcfb..5a19783bb6 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -409,10 +409,10 @@ (define %bootstrap-gcc (native-search-paths (list (search-path-specification (variable "CPATH") - (directories '("include"))) + (files '("include"))) (search-path-specification (variable "LIBRARY_PATH") - (directories '("lib" "lib64"))))) + (files '("lib" "lib64"))))) (synopsis "Bootstrap binaries of the GNU Compiler Collection") (description #f) (home-page #f) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 74809d08f9..0f32c9fab9 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -234,10 +234,10 @@ (define* (cross-gcc target (search-paths (list (search-path-specification (variable "CROSS_CPATH") - (directories '("include"))) + (files '("include"))) (search-path-specification (variable "CROSS_LIBRARY_PATH") - (directories '("lib" "lib64"))))) + (files '("lib" "lib64"))))) (native-search-paths '()))) (define* (cross-libc target diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index db878b033d..99a4a78c11 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -706,7 +706,7 @@ (define-public minetest (native-search-paths (list (search-path-specification (variable "MINETEST_SUBGAME_PATH") - (directories '("share/minetest/games"))))) + (files '("share/minetest/games"))))) (native-inputs `(("pkg-config" ,pkg-config))) (inputs diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 4b715f495e..e795f9749f 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -245,10 +245,10 @@ (define-public gcc-4.7 (native-search-paths (list (search-path-specification (variable "CPATH") - (directories '("include"))) + (files '("include"))) (search-path-specification (variable "LIBRARY_PATH") - (directories '("lib" "lib64"))))) + (files '("lib" "lib64"))))) (properties `((gcc-libc . ,(assoc-ref inputs "libc")))) (synopsis "GNU Compiler Collection") diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index 486cdb6add..93b465b130 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -183,7 +183,7 @@ (define glib ;; by 'glib-compile-schemas'. (list (search-path-specification (variable "XDG_DATA_DIRS") - (directories '("share"))))) + (files '("share"))))) (search-paths native-search-paths) (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME") @@ -225,7 +225,7 @@ (define gobject-introspection (native-search-paths (list (search-path-specification (variable "GI_TYPELIB_PATH") - (directories '("lib/girepository-1.0"))))) + (files '("lib/girepository-1.0"))))) (search-paths native-search-paths) (arguments `(#:phases diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 6a76bafe84..7e3b5f847d 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -95,7 +95,7 @@ (define-public guile-1.8 (native-search-paths (list (search-path-specification (variable "GUILE_LOAD_PATH") - (directories '("share/guile/site"))))) + (files '("share/guile/site"))))) (synopsis "Scheme implementation intended especially for extensions") (description @@ -155,10 +155,10 @@ (define-public guile-2.0 (native-search-paths (list (search-path-specification (variable "GUILE_LOAD_PATH") - (directories '("share/guile/site/2.0"))) + (files '("share/guile/site/2.0"))) (search-path-specification (variable "GUILE_LOAD_COMPILED_PATH") - (directories '("share/guile/site/2.0"))))) + (files '("share/guile/site/2.0"))))) (synopsis "Scheme implementation intended especially for extensions") (description diff --git a/gnu/packages/man.scm b/gnu/packages/man.scm index 028403ce74..712622aee8 100644 --- a/gnu/packages/man.scm +++ b/gnu/packages/man.scm @@ -105,7 +105,7 @@ (define-public man-db (native-search-paths (list (search-path-specification (variable "MANPATH") - (directories '("share/man"))))) + (files '("share/man"))))) (home-page "http://man-db.nongnu.org/") (synopsis "Standard Unix documentation system") (description diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 03cad3e25f..699fe751de 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -66,7 +66,7 @@ (define-public perl %standard-phases))) (native-search-paths (list (search-path-specification (variable "PERL5LIB") - (directories '("lib/perl5/site_perl"))))) + (files '("lib/perl5/site_perl"))))) (synopsis "Implementation of the Perl programming language") (description "Perl 5 is a highly capable, feature-rich programming language with over diff --git a/gnu/packages/pkg-config.scm b/gnu/packages/pkg-config.scm index dc4905a271..dd5120c474 100644 --- a/gnu/packages/pkg-config.scm +++ b/gnu/packages/pkg-config.scm @@ -44,8 +44,7 @@ (define-public %pkg-config (native-search-paths (list (search-path-specification (variable "PKG_CONFIG_PATH") - (directories '("lib/pkgconfig" "lib64/pkgconfig" - "share/pkgconfig"))))) + (files '("lib/pkgconfig" "lib64/pkgconfig" "share/pkgconfig"))))) (home-page "http://www.freedesktop.org/wiki/Software/pkg-config") (license gpl2+) (synopsis "Helper tool used when compiling applications and libraries") diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index adb84fc5b7..90e1f8948c 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -198,7 +198,7 @@ (define-public python-2 (native-search-paths (list (search-path-specification (variable "PYTHONPATH") - (directories '("lib/python2.7/site-packages"))))) + (files '("lib/python2.7/site-packages"))))) (home-page "http://python.org") (synopsis "High-level, dynamically-typed programming language") @@ -237,7 +237,7 @@ (define-public python (native-search-paths (list (search-path-specification (variable "PYTHONPATH") - (directories '("lib/python3.3/site-packages"))))))) + (files '("lib/python3.3/site-packages"))))))) (define-public python-wrapper (package (inherit python) diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm index 4b6665cb6b..f8276db698 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm @@ -77,10 +77,9 @@ (define-public ruby (native-search-paths (list (search-path-specification (variable "GEM_PATH") - (directories - (list (string-append "lib/ruby/gems/" - (version-major+minor version) - ".0")))))) + (files (list (string-append "lib/ruby/gems/" + (version-major+minor version) + ".0")))))) (synopsis "Programming language interpreter") (description "Ruby is a dynamic object-oriented programming language with a focus on simplicity and productivity.") diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm index 2b15c3e35c..17b2b4d9f7 100644 --- a/gnu/packages/xfce.scm +++ b/gnu/packages/xfce.scm @@ -267,7 +267,7 @@ (define-public xfce4-panel (native-search-paths (list (search-path-specification (variable "X_XFCE4_LIB_DIRS") - (directories '("lib/xfce4"))))) + (files '("lib/xfce4"))))) (home-page "http://www.xfce.org/") (synopsis "Xfce desktop panel") (description diff --git a/guix/packages.scm b/guix/packages.scm index ed9a565dc6..b375895785 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -172,16 +172,16 @@ (define-record-type* search-path-specification make-search-path-specification search-path-specification? (variable search-path-specification-variable) - (directories search-path-specification-directories) - (separator search-path-specification-separator (default ":"))) + (files search-path-specification-files) + (separator search-path-specification-separator (default ":")) + (file-type search-path-specification-file-type (default 'directory))) (define (search-path-specification->sexp spec) "Return an sexp representing SPEC, a . The sexp corresponds to the arguments expected by `set-path-environment-variable'." (match spec - (($ variable directories separator) - ;; TODO: Allow other values of TYPE. See . - `(,variable ,directories ,separator directory)))) + (($ variable files separator type) + `(,variable ,files ,separator ,type)))) (define %supported-systems ;; This is the list of system types that are supported. By default, we diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index c388b0c52c..412b8be658 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -54,8 +54,7 @@ (define (for-each-search-path proc inputs derivations pure?) value))))) (cons* (search-path-specification (variable "PATH") - (directories '("bin" "sbin")) - (separator ":")) + (files '("bin" "sbin"))) (delete-duplicates (append-map package-native-search-paths inputs)))))) diff --git a/tests/packages.scm b/tests/packages.scm index 98fa9b5698..b2f09c6d6c 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -335,10 +335,10 @@ (define read-at search-paths))))))) (x (list (search-path-specification (variable "GUILE_LOAD_PATH") - (directories '("share/guile/site/2.0"))) + (files '("share/guile/site/2.0"))) (search-path-specification (variable "GUILE_LOAD_COMPILED_PATH") - (directories '("share/guile/site/2.0"))))) + (files '("share/guile/site/2.0"))))) (a (package (inherit (dummy-package "guile")) (build-system s) (native-search-paths x))) -- cgit v1.2.3 From 91c47befb889ec2242078776cf58541eba8f938a Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 6 Jan 2015 19:37:04 -0500 Subject: gnu: gcc: Improve dynamic linker patching code. * gnu/packages/gcc.scm (gcc-4.7): Join multi-line definitions of GLIBC_DYNAMIC_LINKER* before attempting substitutions. (gcc-4.9)[arguments]: Remove arguments override. --- gnu/packages/gcc.scm | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) (limited to 'gnu/packages/gcc.scm') diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 4733fc1af6..a510af48a0 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -178,6 +178,16 @@ (define-public gcc-4.7 ;; The following is not performed for `--without-headers' ;; cross-compiler builds. + ;; Join multi-line definitions of GLIBC_DYNAMIC_LINKER* into a + ;; single line, to allow the next step to work properly. + (for-each + (lambda (x) + (substitute* (find-files "gcc/config" + "^linux(64|-elf)?\\.h$") + (("(#define GLIBC_DYNAMIC_LINKER.*)\\\\\n$" _ line) + line))) + '(1 2 3)) + ;; Fix the dynamic linker's file name. (substitute* (find-files "gcc/config" "^linux(64|-elf)?\\.h$") @@ -279,29 +289,7 @@ (define-public gcc-4.9 version "/gcc-" version ".tar.bz2")) (sha256 (base32 - "1pbjp4blk2ycaa6r3jmw4ky5f1s9ji3klbqgv8zs2sl5jn1cj810")))) - - ;; TODO: In core-updates, improve the 'pre-configure phase of the main - ;; 'gcc' package so that the 'join-two-line-dynamic-linker-defns phase is - ;; no longer needed here. Then the entire 'arguments' override below can - ;; be removed. - (arguments - (substitute-keyword-arguments (package-arguments gcc-4.7) - ((#:phases phases) - `(alist-cons-before - 'pre-configure 'join-two-line-dynamic-linker-defns - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((libc (assoc-ref inputs "libc"))) - (when libc - ;; Join two-line definitions of GLIBC_DYNAMIC_LINKER* into a - ;; single line, to allow the 'pre-configure phase to work - ;; properly. - (substitute* (find-files "gcc/config" - "^linux(64|-elf)?\\.h$") - (("(#define GLIBC_DYNAMIC_LINKER[^ ]*.*)\\\\\n$" _ line) - line))) - #t)) - ,phases)))))) + "1pbjp4blk2ycaa6r3jmw4ky5f1s9ji3klbqgv8zs2sl5jn1cj810")))))) (define* (custom-gcc gcc name languages #:key (separate-lib-output? #t)) "Return a custom version of GCC that supports LANGUAGES." -- cgit v1.2.3 From 9097e666d48c9b6c0263dcbe60b5af69ff7689f4 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 1 Jan 2015 22:53:55 -0500 Subject: gnu: gcc: Add '-lgcc_s' only when '-pthread' is given. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggested by Ludovic Courtès . * gnu/packages/gcc.scm (gcc-4.7): In our modified GNU_USER_TARGET_LIB_SPEC, add '-lgcc_s' only when '-pthread' is given. --- gnu/packages/gcc.scm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'gnu/packages/gcc.scm') diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index a510af48a0..df161193c1 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -201,14 +202,15 @@ (define-public gcc-4.7 (substitute* (find-files "gcc/config" "^gnu-user.*\\.h$") (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix) - ;; Help libgcc_s.so be found (see also below.) Always use - ;; '-lgcc_s' so that libgcc_s.so is always found by those - ;; programs that use 'pthread_cancel' (glibc dlopens - ;; libgcc_s.so when pthread_cancel support is needed, but - ;; having it in the application's RUNPATH isn't enough; see + ;; Help libgcc_s.so be found (see also below.) When + ;; -pthread is given, use '-lgcc_s' so that libgcc_s.so is + ;; always found by those programs that use 'pthread_cancel' + ;; (glibc dlopens libgcc_s.so when pthread_cancel support + ;; is needed, but having it in the application's RUNPATH + ;; isn't enough; see ;; .) (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" +\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib %{pthread:-lgcc_s}}} \" ~a" libc libc libdir libdir suffix)) (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line) (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\" -- cgit v1.2.3 From fa1e2f3d0d04a2d8e841c6d77244739c00176e9a Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 7 Jan 2015 09:51:23 -0500 Subject: Revert "gnu: gcc: Add '-lgcc_s' only when '-pthread' is given." This reverts commit 9097e666d48c9b6c0263dcbe60b5af69ff7689f4. This turned out not to be a good strategy. Some build system, e.g. tcl's, do not pass -pthread on GNU/Linux by default, but merely link with -lpthread. Also, Ludovic found other cases where libgcc_s is dlopened by libc that have nothing to do with pthreads, e.g. to walk the stack. --- gnu/packages/gcc.scm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'gnu/packages/gcc.scm') diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index df161193c1..a510af48a0 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -1,6 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès -;;; Copyright © 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -202,15 +201,14 @@ (define-public gcc-4.7 (substitute* (find-files "gcc/config" "^gnu-user.*\\.h$") (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix) - ;; Help libgcc_s.so be found (see also below.) When - ;; -pthread is given, use '-lgcc_s' so that libgcc_s.so is - ;; always found by those programs that use 'pthread_cancel' - ;; (glibc dlopens libgcc_s.so when pthread_cancel support - ;; is needed, but having it in the application's RUNPATH - ;; isn't enough; see + ;; Help libgcc_s.so be found (see also below.) Always use + ;; '-lgcc_s' so that libgcc_s.so is always found by those + ;; programs that use 'pthread_cancel' (glibc dlopens + ;; libgcc_s.so when pthread_cancel support is needed, but + ;; having it in the application's RUNPATH isn't enough; see ;; .) (format #f "#define GNU_USER_TARGET_LIB_SPEC \ -\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib %{pthread:-lgcc_s}}} \" ~a" +\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib -lgcc_s}} \" ~a" libc libc libdir libdir suffix)) (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line) (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\" -- cgit v1.2.3 From 270b501ee2b1b4ea4003a60b5568fc4dcb09d9db Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 1 Jan 2015 22:53:55 -0500 Subject: 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 | 6 ++++++ gnu/packages/make-bootstrap.scm | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'gnu/packages/gcc.scm') diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index a510af48a0..c9f9ab007a 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -207,6 +208,11 @@ (define-public gcc-4.7 ;; 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 f6ef2e326a..88fad0e604 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -430,7 +430,19 @@ (define %gcc-static "--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 -- cgit v1.2.3 From 76e639a00fecb194e2fefc267e2e97c5845434b2 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 7 Jan 2015 15:00:44 +0000 Subject: gnu: gcc: Use 'gcc-configure-flags-for-triplet' for native compilers too. * gnu/packages/gcc.scm (gcc-configure-flags-for-triplet): Do not export it. (gcc-4.7): Pass the result of 'gcc-configure-flags-for-triplet' to configure for all builds, including native ones. * gnu/packages/cross-base.scm (cross-gcc-arguments): Do not add the result of 'gcc-configure-flags-for-triplet' here, since it is now included in the configure-flags inherited from gcc-4.8. --- gnu/packages/cross-base.scm | 1 - gnu/packages/gcc.scm | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'gnu/packages/gcc.scm') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 0f32c9fab9..a9ae5ee333 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -88,7 +88,6 @@ (define (cross-gcc-arguments target libc) (substitute-keyword-arguments (package-arguments gcc-4.8) ((#:configure-flags flags) `(append (list ,(string-append "--target=" target) - ,@(gcc-configure-flags-for-triplet target) ,@(if libc '() `( ;; Disable features not needed at this stage. diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index c9f9ab007a..0e507576fd 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -36,7 +36,7 @@ (define %gcc-infrastructure ;; Base URL for GCC's infrastructure. "ftp://gcc.gnu.org/pub/gcc/infrastructure/") -(define-public (gcc-configure-flags-for-triplet target) +(define (gcc-configure-flags-for-triplet target) "Return a list of additional GCC `configure' flags for TARGET, a GNU triplet. The purpose of this procedure is to translate extended GNU triplets---e.g., @@ -102,11 +102,11 @@ (define-public gcc-4.7 "/include") "--without-headers"))) - ;; When cross-compiling GCC, pass the right options for the - ;; target triplet. - (or (and=> (%current-target-system) - gcc-configure-flags-for-triplet) - '()) + ;; Pass the right options for the target triplet. + (let ((triplet + (or (%current-target-system) + (nix-system->gnu-triplet (%current-system))))) + (gcc-configure-flags-for-triplet triplet)) (maybe-target-tools)))))) (package -- cgit v1.2.3 From 3f00ff8b43bfef244e211d1c9bb71132926c1580 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 7 Jan 2015 15:55:23 -0500 Subject: gnu: Add toolchain support for 'armhf-linux'. Based on preliminary work by John Darrington . * gnu/packages/cross-base.scm (xgcc-armhf): New variable. * gnu/packages/gcc.scm (gcc-configure-flags-for-triplet): Add armhf case. (gcc-4.7)[pre-configure]: Add gcc/config/*/linux-eabi.h to the list of files in which to patch GLIBC_DYNAMIC_LINKER. * gnu/packages/bootstrap.scm (glibc-dynamic-linker): Add armhf case. * guix/utils.scm (gnu-triplet->nix-system, nix-system->gnu-triplet): Add armhf cases. --- gnu/packages/bootstrap.scm | 1 + gnu/packages/cross-base.scm | 7 +++++++ gnu/packages/gcc.scm | 15 ++++++++++++--- guix/utils.scm | 26 ++++++++++++++++---------- 4 files changed, 36 insertions(+), 13 deletions(-) (limited to 'gnu/packages/gcc.scm') diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index f1110d9cf0..e1b50a1e4f 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -162,6 +162,7 @@ (define* (glibc-dynamic-linker "Return the name of Glibc's dynamic linker for SYSTEM." (cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2") ((string=? system "i686-linux") "/lib/ld-linux.so.2") + ((string=? system "armhf-linux") "/lib/ld-linux-armhf.so.3") ((string=? system "mips64el-linux") "/lib/ld.so.1") ;; XXX: This one is used bare-bones, without a libc, so add a case diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index a9ae5ee333..794d925841 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -322,6 +323,12 @@ (define-public xgcc-xtensa ;; Bare-bones Xtensa cross-compiler, used to build the Atheros firmware. (cross-gcc "xtensa-elf")) +(define-public xgcc-armhf + (let ((triplet "arm-linux-gnueabihf")) + (cross-gcc triplet + (cross-binutils triplet) + (cross-libc triplet)))) + ;; (define-public xgcc-armel ;; (let ((triplet "armel-linux-gnueabi")) ;; (cross-gcc triplet diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 0e507576fd..276b986331 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -46,8 +46,17 @@ (define (gcc-configure-flags-for-triplet target) ;; Triplets recognized by glibc as denoting the N64 ABI; see ;; ports/sysdeps/mips/preconfigure. '("--with-abi=64")) + + ((string-match "^arm.*-gnueabihf$" target) + '("--with-arch=armv7-a" + "--with-float=hard" + "--with-mode=thumb" + + ;; See + "--with-fpu=vfpv3-d16")) + (else - ;; TODO: Add `armel.*gnueabi', `hf', etc. + ;; TODO: Add `arm.*-gnueabi', etc. '()))) (define-public gcc-4.7 @@ -184,14 +193,14 @@ (define-public gcc-4.7 (for-each (lambda (x) (substitute* (find-files "gcc/config" - "^linux(64|-elf)?\\.h$") + "^linux(64|-elf|-eabi)?\\.h$") (("(#define GLIBC_DYNAMIC_LINKER.*)\\\\\n$" _ line) line))) '(1 2 3)) ;; Fix the dynamic linker's file name. (substitute* (find-files "gcc/config" - "^linux(64|-elf)?\\.h$") + "^linux(64|-elf|-eabi)?\\.h$") (("#define GLIBC_DYNAMIC_LINKER([^ ]*).*$" _ suffix) (format #f "#define GLIBC_DYNAMIC_LINKER~a \"~a\"~%" suffix diff --git a/guix/utils.scm b/guix/utils.scm index 7ac586b0aa..1c619c3ef9 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès -;;; Copyright © 2013 Mark H Weaver +;;; Copyright © 2013, 2014, 2015 Mark H Weaver ;;; Copyright © 2014 Eric Bavier ;;; Copyright © 2014 Ian Denhardt ;;; @@ -481,14 +481,18 @@ (define* (nix-system->gnu-triplet #:optional (system (%current-system)) (vendor "unknown")) "Return a guess of the GNU triplet corresponding to Nix system identifier SYSTEM." - (let* ((dash (string-index system #\-)) - (arch (substring system 0 dash)) - (os (substring system (+ 1 dash)))) - (string-append arch - "-" vendor "-" - (if (string=? os "linux") - "linux-gnu" - os)))) + (match system + ("armhf-linux" + (string-append "arm-" vendor "-linux-gnueabihf")) + (_ + (let* ((dash (string-index system #\-)) + (arch (substring system 0 dash)) + (os (substring system (+ 1 dash)))) + (string-append arch + "-" vendor "-" + (if (string=? os "linux") + "linux-gnu" + os)))))) (define (gnu-triplet->nix-system triplet) "Return the Nix system type corresponding to TRIPLET, a GNU triplet as @@ -498,7 +502,9 @@ (define (gnu-triplet->nix-system triplet) (lambda (m) (string-append "i686-" (match:substring m 1)))) (else triplet)))) - (cond ((string-match "^([^-]+)-([^-]+-)?linux-gnu.*" triplet) + (cond ((string-match "^arm[^-]*-([^-]+-)?linux-gnueabihf" triplet) + "armhf-linux") + ((string-match "^([^-]+)-([^-]+-)?linux-gnu.*" triplet) => (lambda (m) ;; Nix omits `-gnu' for GNU/Linux. -- cgit v1.2.3