mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
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.
This commit is contained in:
parent
fd19df7252
commit
91c47befb8
1 changed files with 11 additions and 23 deletions
|
@ -178,6 +178,16 @@ (define-public gcc-4.7
|
||||||
;; The following is not performed for `--without-headers'
|
;; The following is not performed for `--without-headers'
|
||||||
;; cross-compiler builds.
|
;; 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.
|
;; Fix the dynamic linker's file name.
|
||||||
(substitute* (find-files "gcc/config"
|
(substitute* (find-files "gcc/config"
|
||||||
"^linux(64|-elf)?\\.h$")
|
"^linux(64|-elf)?\\.h$")
|
||||||
|
@ -279,29 +289,7 @@ (define-public gcc-4.9
|
||||||
version "/gcc-" version ".tar.bz2"))
|
version "/gcc-" version ".tar.bz2"))
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"1pbjp4blk2ycaa6r3jmw4ky5f1s9ji3klbqgv8zs2sl5jn1cj810"))))
|
"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))))))
|
|
||||||
|
|
||||||
(define* (custom-gcc gcc name languages #:key (separate-lib-output? #t))
|
(define* (custom-gcc gcc name languages #:key (separate-lib-output? #t))
|
||||||
"Return a custom version of GCC that supports LANGUAGES."
|
"Return a custom version of GCC that supports LANGUAGES."
|
||||||
|
|
Loading…
Reference in a new issue