9 combine = basegcc: runCommand "combine-gcc-libc" {} ''
11 cp -r ${basegcc.cc}/lib $out/lib
13 chmod u+rw -R $out/lib
14 cp -r ${basegcc.libc}/lib/* $(ls -d $out/lib/gcc/*/*)
16 gcc_multi_sysroot = runCommand "gcc-multi-sysroot" {
18 inherit (gcc64) version;
19 lib = gcc_multi_sysroot;
24 ln -s ${combine gcc64}/lib/gcc/* $out/lib/gcc/
25 ln -s ${combine gcc32}/lib/gcc/* $out/lib/gcc/
26 # XXX: This shouldn't be needed, clang just doesn't look for "i686-unknown"
27 ln -s $out/lib/gcc/i686-unknown-linux-gnu $out/lib/gcc/i686-pc-linux-gnu
31 ln -s ${glibc_multi.dev}/include $out/
35 ln -s ${glibc_multi.out}/lib/ld-linux* $out/lib
36 ln -s ${glibc_multi.out}/lib/32/ld-linux* $out/lib/32/
39 clangMulti = clang.override {
40 # Only used for providing expected structure re:dynamic linkers, AFAIK Most
41 # of the magic is done by setting the --gcc-toolchain option via
43 libc = gcc_multi_sysroot;
45 bintools = clang.bintools.override {
46 libc = gcc_multi_sysroot;
49 gccForLibs = gcc_multi_sysroot;