From 97d81bde0c1bcc1337e33c709c765021711aeff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Sun, 30 Dec 2012 21:55:02 +0000 Subject: [PATCH] Adding platform gcc information for raspberrypi, and the gcc support. Without it, gcc builds for softfloat, and the glibc doesn't have support for softfloat (it ends up requiring some gnu-soft.h file). We'll have to test if this fixes the build of gcc or not, though. --- .../development/compilers/gcc/4.6/default.nix | 42 ++++++++++++++----- pkgs/top-level/platforms.nix | 5 +++ 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/pkgs/development/compilers/gcc/4.6/default.nix b/pkgs/development/compilers/gcc/4.6/default.nix index 09980da8fe14..2c572380d04c 100644 --- a/pkgs/development/compilers/gcc/4.6/default.nix +++ b/pkgs/development/compilers/gcc/4.6/default.nix @@ -87,18 +87,37 @@ let version = "4.6.3"; javaAwtGtk = langJava && gtk != null; - /* Cross-gcc settings */ - gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross; - gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross; - gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross; - gccFpu = stdenv.lib.attrByPath [ "gcc" "fpu" ] null cross; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - crossMingw = (cross != null && cross.libc == "msvcrt"); + /* Platform flags */ + platformFlags = let + gccArch = stdenv.lib.attrByPath [ "platform" "gcc" "arch" ] null stdenv; + gccCpu = stdenv.lib.attrByPath [ "platform" "gcc" "cpu" ] null stdenv; + gccAbi = stdenv.lib.attrByPath [ "platform" "gcc" "abi" ] null stdenv; + gccFpu = stdenv.lib.attrByPath [ "platform" "gcc" "fpu" ] null stdenv; + gccFloat = stdenv.lib.attrByPath [ "platform" "gcc" "float" ] null stdenv; + withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; + withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; + withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; + withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; + withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; + in + (withArch + + withCpu + + withAbi + + withFpu + + withFloat); - crossConfigureFlags = + /* Cross-gcc settings */ + crossMingw = (cross != null && cross.libc == "msvcrt"); + crossConfigureFlags = let + gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross; + gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross; + gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross; + gccFpu = stdenv.lib.attrByPath [ "gcc" "fpu" ] null cross; + withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; + withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; + withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; + withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; + in "--target=${cross.config}" + withArch + withCpu + @@ -300,6 +319,7 @@ stdenv.mkDerivation ({ ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""} ${if cross != null then crossConfigureFlags else ""} ${if !bootstrap then "--disable-bootstrap" else ""} + ${if cross == null then platformFlags else ""} "; targetConfig = if cross != null then cross.config else null; diff --git a/pkgs/top-level/platforms.nix b/pkgs/top-level/platforms.nix index c53b41958a45..7bd72d13a687 100644 --- a/pkgs/top-level/platforms.nix +++ b/pkgs/top-level/platforms.nix @@ -222,6 +222,11 @@ rec { uboot = "sheevaplug"; # Only for uboot = uboot : ubootConfig = "sheevaplug_config"; + gcc = { + arch = "armv6"; + fpu = "vfp"; + float = "hard"; + }; }; guruplug = sheevaplug // {