about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/llvm/multi.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/llvm/multi.nix')
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/multi.nix16
1 files changed, 10 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/development/compilers/llvm/multi.nix b/nixpkgs/pkgs/development/compilers/llvm/multi.nix
index b4f2f8f9d6f6..60db622a73ab 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/multi.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/multi.nix
@@ -13,7 +13,12 @@ let
     chmod u+rw -R $out/lib
     cp -r ${basegcc.libc}/lib/* $(ls -d $out/lib/gcc/*/*)
   '';
-  gcc_multi_sysroot = runCommand "gcc-multi-sysroot" {} ''
+  gcc_multi_sysroot = runCommand "gcc-multi-sysroot" {
+    passthru = {
+      inherit (gcc64) version;
+      lib = gcc_multi_sysroot;
+    };
+  } ''
     mkdir -p $out/lib/gcc
 
     ln -s ${combine gcc64}/lib/gcc/* $out/lib/gcc/
@@ -32,17 +37,16 @@ let
   '';
 
   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
+    # Only used for providing expected structure re:dynamic linkers, AFAIK Most
+    # of the magic is done by setting the --gcc-toolchain option via
+    # `gccForLibs`.
     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
-    '';
+    gccForLibs = gcc_multi_sysroot;
   };
 
 in clangMulti