From fd0b276624fdd9aebe9ebf3f64bf9571bed3517d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 14 Jun 2014 16:04:30 +0200 Subject: [PATCH] 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"). --- gnu/packages/gcc.scm | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 821515f3ed..86134811d3 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -133,24 +133,30 @@ (define-public gcc-4.7 #:strip-binaries? ,stripped? #:configure-flags ,(configure-flags) #:make-flags - (let* ((libc (assoc-ref %build-inputs "libc")) - (libc-native (or (assoc-ref %build-inputs "libc-native") - libc))) - `(,@(if libc - (list (string-append "LDFLAGS_FOR_TARGET=" - "-B" libc "/lib " - "-Wl,-dynamic-linker " - "-Wl," libc - ,(glibc-dynamic-linker))) - '()) + ;; None of the flags below are needed when doing a Canadian cross. + ;; TODO: Simplify this. + ,(if (%current-target-system) + (if stripped? + ''("CFLAGS=-g0 -O2") + ''()) + `(let* ((libc (assoc-ref %build-inputs "libc")) + (libc-native (or (assoc-ref %build-inputs "libc-native") + 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. - ,(string-append "LDFLAGS=" - "-Wl,-rpath=" libc-native "/lib " - "-Wl,-dynamic-linker " - "-Wl," libc-native ,(glibc-dynamic-linker)) - ,(string-append "BOOT_CFLAGS=-O2 " - ,(if stripped? "-g0" "-g")))) + ;; Native programs like 'genhooks' also need that right. + ,(string-append "LDFLAGS=" + "-Wl,-rpath=" libc-native "/lib " + "-Wl,-dynamic-linker " + "-Wl," libc-native ,(glibc-dynamic-linker)) + ,(string-append "BOOT_CFLAGS=-O2 " + ,(if stripped? "-g0" "-g"))))) #:tests? #f #:phases