about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-05-29 21:40:53 +0300
committerNikolay Amiantov <ab@fmap.me>2016-05-29 23:22:58 +0300
commit1b2139b3e2cda13c6816bafd22871ac60ddf83ac (patch)
tree038859c3eaafd7f375e5846f65e8999140fc56ce /pkgs/build-support
parent46df0518903395d0583dee1451dc3c2ed4bfe2a8 (diff)
downloadnixlib-1b2139b3e2cda13c6816bafd22871ac60ddf83ac.tar
nixlib-1b2139b3e2cda13c6816bafd22871ac60ddf83ac.tar.gz
nixlib-1b2139b3e2cda13c6816bafd22871ac60ddf83ac.tar.bz2
nixlib-1b2139b3e2cda13c6816bafd22871ac60ddf83ac.tar.lz
nixlib-1b2139b3e2cda13c6816bafd22871ac60ddf83ac.tar.xz
nixlib-1b2139b3e2cda13c6816bafd22871ac60ddf83ac.tar.zst
nixlib-1b2139b3e2cda13c6816bafd22871ac60ddf83ac.zip
buildFHSEnv: use separate gcc for 64- and 32-bit
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/build-fhs-chrootenv/env.nix29
1 files changed, 9 insertions, 20 deletions
diff --git a/pkgs/build-support/build-fhs-chrootenv/env.nix b/pkgs/build-support/build-fhs-chrootenv/env.nix
index 01d75727f0bf..0b2f8bcba6a4 100644
--- a/pkgs/build-support/build-fhs-chrootenv/env.nix
+++ b/pkgs/build-support/build-fhs-chrootenv/env.nix
@@ -37,21 +37,20 @@ let
 
   # list of packages which are installed for both x86 and x86_64 on x86_64
   # systems
-  multiPaths = if isMultiBuild
-                  then multiPkgs nixpkgs_i686
-                  else [];
+  multiPaths = multiPkgs nixpkgs_i686;
 
   # base packages of the chroot
-  # these match the host's architecture, gcc/glibc_multi are used for multilib
+  # these match the host's architecture, glibc_multi is used for multilib
   # builds.
-  chosenGcc = if isMultiBuild then nixpkgs.gcc_multi else nixpkgs.gcc;
   basePkgs = with nixpkgs;
     [ (if isMultiBuild then glibc_multi else glibc)
-      chosenGcc
-      bashInteractive coreutils less shadow su
+      gcc.cc.lib bashInteractive coreutils less shadow su
       gawk diffutils findutils gnused gnugrep
       gnutar gzip bzip2 xz glibcLocales
     ];
+  baseMultiPkgs = with nixpkgs_i686;
+    [ gcc.cc.lib
+    ];
 
   etcProfile = nixpkgs.writeText "profile" ''
     export PS1='${name}-chrootenv:\u@\h:\w\$ '
@@ -125,8 +124,8 @@ let
   };
 
   staticUsrProfileMulti = nixpkgs.buildEnv {
-    name = "system-profile-multi";
-    paths = multiPaths;
+    name = "${name}-usr-multi";
+    paths = baseMultiPkgs ++ multiPaths;
     extraOutputsToInstall = [ "lib" "out" ] ++ extraOutputsToInstall;
     ignoreCollisions = true;
   };
@@ -154,18 +153,8 @@ let
     # copy content of targetPaths (64bit libs)
     cp -rsHf ${staticUsrProfileTarget}/lib/* lib64/ && chmod u+w -R lib64/
 
-    # most 64bit only libs put their stuff into /lib
-    # some pkgs (like gcc_multi) put 32bit libs into /lib and 64bit libs into /lib64
-    # by overwriting these we will hopefully catch all these cases
-    # in the end /lib32 should only contain 32bit and /lib64 only 64bit libs
-    cp -rsHf ${staticUsrProfileTarget}/lib64/* lib64/ && chmod u+w -R lib64/
-
-    # copy gcc libs
-    cp -rsHf ${chosenGcc.cc.lib}/lib/*   lib32/
-    cp -rsHf ${chosenGcc.cc.lib}/lib64/* lib64/
-
     # symlink 32-bit ld-linux.so
-    ln -s ${staticUsrProfileTarget}/lib/32/ld-linux.so.2 lib/
+    ln -Ls ${staticUsrProfileTarget}/lib/32/ld-linux.so.2 lib/
   '';
 
   setupLibDirs = if isTargetBuild then setupLibDirs_target