gnu: gcc: Fix cross-compilation of gcc (Canadian cross).

* gnu/packages/gcc.scm (gcc-4.7)[arguments] <#:make-flags>:
  When (%current-target-system) is true, pass the empty list or
  '("CFLAGS=-g0 -O2").
This commit is contained in:
Ludovic Courtès 2014-06-14 16:04:30 +02:00
parent 6e3ecad6ca
commit fd0b276624
1 changed files with 23 additions and 17 deletions

View File

@ -133,24 +133,30 @@ where the OS part is overloaded to denote a specific ABI---into GCC
#:strip-binaries? ,stripped? #:strip-binaries? ,stripped?
#:configure-flags ,(configure-flags) #:configure-flags ,(configure-flags)
#:make-flags #:make-flags
(let* ((libc (assoc-ref %build-inputs "libc")) ;; None of the flags below are needed when doing a Canadian cross.
(libc-native (or (assoc-ref %build-inputs "libc-native") ;; TODO: Simplify this.
libc))) ,(if (%current-target-system)
`(,@(if libc (if stripped?
(list (string-append "LDFLAGS_FOR_TARGET=" ''("CFLAGS=-g0 -O2")
"-B" libc "/lib " ''())
"-Wl,-dynamic-linker " `(let* ((libc (assoc-ref %build-inputs "libc"))
"-Wl," libc (libc-native (or (assoc-ref %build-inputs "libc-native")
,(glibc-dynamic-linker))) libc)))
'()) `(,@(if libc
(list (string-append "LDFLAGS_FOR_TARGET="
"-B" libc "/lib "
"-Wl,-dynamic-linker "
"-Wl," libc
,(glibc-dynamic-linker)))
'())
;; Native programs like 'genhooks' also need that right. ;; Native programs like 'genhooks' also need that right.
,(string-append "LDFLAGS=" ,(string-append "LDFLAGS="
"-Wl,-rpath=" libc-native "/lib " "-Wl,-rpath=" libc-native "/lib "
"-Wl,-dynamic-linker " "-Wl,-dynamic-linker "
"-Wl," libc-native ,(glibc-dynamic-linker)) "-Wl," libc-native ,(glibc-dynamic-linker))
,(string-append "BOOT_CFLAGS=-O2 " ,(string-append "BOOT_CFLAGS=-O2 "
,(if stripped? "-g0" "-g")))) ,(if stripped? "-g0" "-g")))))
#:tests? #f #:tests? #f
#:phases #:phases