anchor.diff:    # the target profile is the actual profile that will be used for the chroot
     setupTargetProfile = ''
       ${linkProfile staticUsrProfileTarget}
  +    ${setupLibDirs}
  +
       mkdir -m0755 usr
       cd usr
       ${linkProfile staticUsrProfileTarget}
  +    ${setupLibDirs}
       cd ..
     '';
   
  
positive.code: assert multiPkgs  != null -> targetPkgs != null;
  assert targetPkgs != null -> pkgs       == [];
  
  let
    is64Bit       = system == "x86_64-linux";
    # enable multi builds on x86_64 hosts if pakgs_target/multi are defined
    isMultiBuild  = is64Bit && targetPkgs != null;
    isNormalBuild = !isMultiBuild;
  
    # list of packages (usually programs) which will only be installed for the
    # hosts architecture
  
negative.code:   # /lib, /lib32 -> links to 32bit binaries
    # /lib64       -> links to 64bit binaries
    # /usr/lib*    -> same as above
    setupMultiProfile = if isTargetBuild then "" else ''
      mkdir -m0755 x86
      cd x86
      ${linkProfile staticUsrProfileMulti}
      cd ..
    '';
  
    setupLibDirs = if isTargetBuild then setupLibDirs_target
                                    else setupLibDirs_multi;
  
    # setup library paths only for the targeted architecture
    setupLibDirs_target = ''
      mkdir -m0755 lib
  
      # copy content of targetPaths
      cp -rsf ${staticUsrProfileTarget}/lib/* lib/
  
      # copy gcc libs
      cp -rsf ${choosenGcc.gcc}/lib/* lib/
  
    '';
  
    # setup /lib, /lib32 and /lib64
    setupLibDirs_multi = ''
      mkdir -m0755 lib
      mkdir -m0755 lib64
      ln -s lib lib32
  