<commit_before>{ runCommand,
clang,
gcc64,
gcc32,
glibc_multi
}:

let
  combine = basegcc: runCommand "combine-gcc-libc" {} ''
    mkdir -p $out
    cp -r ${basegcc.cc}/lib $out/lib

    chmod u+rw -R $out/lib
    cp -r ${basegcc.libc}/lib/* $(ls -d $out/lib/gcc/*/*)
  '';
  gcc_multi_sysroot = runCommand "gcc-multi-sysroot" {} ''
    mkdir -p $out/lib/gcc

    ln -s ${combine gcc64}/lib/gcc/* $out/lib/gcc/
    ln -s ${combine gcc32}/lib/gcc/* $out/lib/gcc/
    # XXX: This shouldn't be needed, clang just doesn't look for "i686-unknown"
    ln -s $out/lib/gcc/i686-unknown-linux-gnu $out/lib/gcc/i686-pc-linux-gnu


    # includes
    ln -s ${glibc_multi.dev}/include $out/

    # dynamic linkers
    mkdir -p $out/lib/32
    ln -s ${glibc_multi.out}/lib/ld-linux* $out/lib
    ln -s ${glibc_multi.out}/lib/32/ld-linux* $out/lib/32/
  '';

  clangMulti = clang.override {
    # Only used for providing expected structure re:dynamic linkers, AFAIK
    # Most of the magic is done by setting the --gcc-toolchain option below
    libc = gcc_multi_sysroot;

    extraBuildCommands = ''
      sed -e '$a --gcc-toolchain=${gcc_multi_sysroot}' -i $out/nix-support/libc-cflags<commit_msg>clang multi: Fix post bintools wrapper<commit_after>{ runCommand,
clang,
gcc64,
gcc32,
glibc_multi
}:

let
  combine = basegcc: runCommand "combine-gcc-libc" {} ''
    mkdir -p $out
    cp -r ${basegcc.cc}/lib $out/lib

    chmod u+rw -R $out/lib
    cp -r ${basegcc.libc}/lib/* $(ls -d $out/lib/gcc/*/*)
  '';
  gcc_multi_sysroot = runCommand "gcc-multi-sysroot" {} ''
    mkdir -p $out/lib/gcc

    ln -s ${combine gcc64}/lib/gcc/* $out/lib/gcc/
    ln -s ${combine gcc32}/lib/gcc/* $out/lib/gcc/
    # XXX: This shouldn't be needed, clang just doesn't look for "i686-unknown"
    ln -s $out/lib/gcc/i686-unknown-linux-gnu $out/lib/gcc/i686-pc-linux-gnu


    # includes
    ln -s ${glibc_multi.dev}/include $out/

    # dynamic linkers
    mkdir -p $out/lib/32
    ln -s ${glibc_multi.out}/lib/ld-linux* $out/lib
    ln -s ${glibc_multi.out}/lib/32/ld-linux* $out/lib/32/
  '';

  clangMulti = clang.override {
    # Only used for providing expected structure re:dynamic linkers, AFAIK
    # Most of the magic is done by setting the --gcc-toolchain option below
    libc = gcc_multi_sysroot;

    bintools = clang.bintools.override {
      libc = gcc_multi_sysroot;
    };

    extraBuildCommands = ''
      sed -e '$a --gcc-toolchain=${gcc_multi_sysroot}' -i $out/nix-support/libc-cflags
{'fraction_non_alphanumeric': 0.15710823909531502, 'fraction_numerical': 0.018578352180936994, 'mean_word_length': 2.7701674277016743, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7308306', 'n_tokens_mistral': 1054, 'n_tokens_neox': 940, 'n_words': 226}