From 2d912e29d564872a729828d959836945a4736389 Mon Sep 17 00:00:00 2001 From: Christoph Hrdinka Date: Sat, 26 Apr 2014 14:42:10 +0200 Subject: [PATCH] build-fhs-chrootenv: fix gcc_multi paths --- .../build-fhs-chrootenv/default.nix | 39 +++++++++++++------ pkgs/top-level/all-packages.nix | 5 ++- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/pkgs/build-support/build-fhs-chrootenv/default.nix b/pkgs/build-support/build-fhs-chrootenv/default.nix index 306cfeeb264d..41c60ea5fe8d 100644 --- a/pkgs/build-support/build-fhs-chrootenv/default.nix +++ b/pkgs/build-support/build-fhs-chrootenv/default.nix @@ -1,7 +1,7 @@ { buildEnv, nixpkgs, nixpkgs_i686, system , stdenv, glibc, glibc_multi, glibcLocales , bashInteractive, coreutils, less, shadow, su -, gawk, gcc, diffutils, findutils, gnused, gnugrep +, gawk, gcc, gcc_multi, diffutils, findutils, gnused, gnugrep , gnutar, gzip, bzip2, xz } : { name, pkgs ? [], profile ? "" @@ -33,12 +33,14 @@ let else []; # base packages of the chroot - # these match the hosts architecture, glibc_multi will be choosen + # these match the hosts architecture, gcc/glibc_multi will be choosen # on multi builds + choosenGcc = if isMultiBuild then gcc_multi else gcc; basePkgs = [ (if isMultiBuild then glibc_multi else glibc) + choosenGcc bashInteractive coreutils less shadow su - gawk gcc diffutils findutils gnused gnugrep + gawk diffutils findutils gnused gnugrep gnutar gzip bzip2 xz ]; @@ -101,23 +103,36 @@ let ${linkProfile staticUsrProfileMulti} cd .. - ${setupLibDirs} + ${setupMultiLibDirs} cd usr - ${setupLibDirs} + ${setupMultiLibDirs} cd .. ''; - setupLibDirs = '' + setupMultiLibDirs = '' rm -f lib lib32 lib64 mkdir -m0755 lib - # copy glibc stuff - cp -rs ${staticUsrProfileTarget}/lib/32/* lib/ - # copy contents of multiPaths - cp -rsf ${staticUsrProfileMulti}/lib/* lib/ - + mkdir -m0755 lib64 ln -s lib lib32 - ln -s ${staticUsrProfileTarget}/lib lib64 + + # copy glibc stuff + cp -rsf ${staticUsrProfileTarget}/lib/32/* lib/ + + # copy content of multiPaths (32bit libs) + cp -rsf ${staticUsrProfileMulti}/lib/* lib/ + + # copy content of targetPaths (64bit libs) + cp -rsf ${staticUsrProfileTarget}/lib/* lib64/ + # most 64bit only libs put their stuff into /lib + # some pkgs (like gcc_multi) put 32bit libs into /lib 64bit libs into /lib64 + # by overwriting these we will hopefully catch all these cases + # in the end /lib should only contain 32bit and /lib64 only 64bit libs + cp -rsf ${staticUsrProfileTarget}/lib64/* lib64/ + + # copy gcc libs (and may overwrite exitsting wrongly placed libs) + cp -rsf ${choosenGcc.gcc}/lib/* lib/ + cp -rsf ${choosenGcc.gcc}/lib64/* lib64/ ''; in stdenv.mkDerivation { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9f2c7d5ed2bd..6de1001c5cb4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -265,7 +265,7 @@ let inherit buildEnv system; inherit stdenv glibc glibc_multi glibcLocales; inherit bashInteractive coreutils less shadow su; - inherit gawk gcc diffutils findutils gnused gnugrep; + inherit gawk gcc gcc_multi diffutils findutils gnused gnugrep; inherit gnutar gzip bzip2 xz; nixpkgs = pkgs; @@ -2737,7 +2737,8 @@ let gambit = callPackage ../development/compilers/gambit { }; - gcc = gcc48; + gcc = gcc48; + gcc_multi = gcc48_multi; gcc33 = wrapGCC (import ../development/compilers/gcc/3.3 { inherit fetchurl stdenv noSysDirs;