From 9b1d5353a951a29e33a3a137cb3d5246c1eff6a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Sun, 14 Mar 2010 14:05:08 +0000 Subject: [PATCH] Making the gcc cross-compiler a bit more flexible. svn path=/nixpkgs/trunk/; revision=20614 --- pkgs/development/compilers/gcc-4.4/default.nix | 18 ++++++++++++++---- pkgs/top-level/release-cross.nix | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/gcc-4.4/default.nix b/pkgs/development/compilers/gcc-4.4/default.nix index 358e52124072..85a3aee4c894 100644 --- a/pkgs/development/compilers/gcc-4.4/default.nix +++ b/pkgs/development/compilers/gcc-4.4/default.nix @@ -57,24 +57,34 @@ let version = "4.4.3"; javaAwtGtk = langJava && gtk != null; - withCPU = if cross ? cpu then " --with-cpu=${cross.cpu}" else ""; + /* 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; + 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 ""; crossConfigureFlags = "--target=${cross.config}" + - withCPU + + withArch + + withCpu + + withAbi + (if crossStageStatic then " --disable-libssp --disable-nls" + " --without-headers" + " --disable-threads " + " --disable-libmudflap " + " --disable-libgomp " + - " --disable-shared" + " --disable-shared" + + " --disable-decimal-float" # libdecnumber requires libc else " --with-headers=${libcCross}/include" + " --enable-__cxa_atexit" + " --enable-long-long" + " --enable-threads=posix" + - " --enable-nls" + " --enable-nls" + + " --disable-decimal-float" # No final libdecnumber (it may work only in 386) ); stageNameAddon = if (crossStageStatic) then "-stage-static" else "-stage-final"; diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix index 37ecda0e0276..571484f05409 100644 --- a/pkgs/top-level/release-cross.nix +++ b/pkgs/top-level/release-cross.nix @@ -105,7 +105,6 @@ let arch = "sparc64"; float = "hard"; withTLS = true; - cpu = "ultrasparc"; libc = "glibc"; platform = { name = "ultrasparc"; @@ -118,6 +117,7 @@ let uboot = null; }; openssl.system = "linux64-sparcv9"; + gcc.cpu = "ultrasparc"; }; in { crossUltraSparcLinux = mapTestOnCross crossSystem basic;