Created
April 10, 2020 00:18
-
-
Save jbedo/013d92edaef515eca3cbf4648c30c304 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ nixpkgs ? import (import /home/doc/git/allvm-tools/nix/fetch-nixpkgs.nix) { } | |
}: | |
let | |
overlay = self: super: { | |
stdenv = super.overrideCC (nixpkgs.stdenv) (with nixpkgs; | |
wrapCCWith { | |
cc = wllvm; | |
extraBuildCommands = '' | |
echo CC=wllvm >> $out/nix-support/setup-hook | |
echo CXX=wllvm++ >> $out/nix-support/setup-hook | |
echo export LLVM_COMPILER=clang >> $out/nix-support/setup-hook | |
echo export PATH=${ | |
lib.makeBinPath (with llvmPackages_4; [ clang llvm file ]) | |
}:$PATH >> $out/nix-support/setup-hook | |
''; | |
}); | |
}; | |
nixpkgs' = import <nixpkgs> { overlays = [ overlay ]; }; | |
libc = nixpkgs'.stdenv.mkDerivation { | |
name = "musl"; | |
preConfigure = '' | |
export WLLVM_CONFIGURE_ONLY=1 | |
''; | |
postConfigure = '' | |
unset WLLVM_CONFIGURE_ONLY | |
''; | |
configureFlags = [ "--target=LLVM" "--build=LLVM" ]; | |
src = builtins.fetchurl | |
"https://github.com/SRI-CSL/musllvm/archive/master.tar.gz"; | |
}; | |
overlay' = self: super: { | |
stdenv = nixpkgs'.stdenv.override { | |
cc = nixpkgs'.stdenv.cc.override { | |
inherit libc; | |
bintools = nixpkgs'.stdenv.cc.bintools.override { inherit libc; }; | |
}; | |
}; | |
}; | |
in import <nixpkgs> { overlays = [ overlay' ]; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment