2018-04-03 17:50:25 +01:00
|
|
|
{ newScope, stdenv, binutils, wrapCCWith, symlinkJoin }:
|
2014-07-12 16:17:50 +01:00
|
|
|
let
|
2017-09-13 18:12:08 +01:00
|
|
|
callPackage = newScope (self // {inherit stdenv;});
|
2016-05-27 01:05:13 +01:00
|
|
|
|
2017-09-13 18:12:08 +01:00
|
|
|
self = {
|
|
|
|
emscriptenfastcomp-unwrapped = callPackage ./emscripten-fastcomp.nix {};
|
2017-09-20 03:09:45 +01:00
|
|
|
emscriptenfastcomp-wrapped = wrapCCWith {
|
|
|
|
cc = self.emscriptenfastcomp-unwrapped;
|
2017-08-26 16:43:30 +01:00
|
|
|
# Never want Apple's cctools for WASM target
|
2018-04-03 17:50:25 +01:00
|
|
|
bintools = binutils;
|
2017-09-20 03:09:45 +01:00
|
|
|
libc = stdenv.cc.libc;
|
|
|
|
extraBuildCommands = ''
|
|
|
|
# hardening flags break WASM support
|
|
|
|
cat > $out/nix-support/add-hardening.sh
|
|
|
|
'';
|
|
|
|
};
|
2017-09-13 18:12:08 +01:00
|
|
|
emscriptenfastcomp = symlinkJoin {
|
2018-05-24 05:37:33 +01:00
|
|
|
name = "emscriptenfastcomp-${stdenv.lib.getVersion self.emscriptenfastcomp-unwrapped}";
|
2017-09-13 18:12:08 +01:00
|
|
|
paths = [ self.emscriptenfastcomp-wrapped self.emscriptenfastcomp-unwrapped ];
|
|
|
|
preferLocalBuild = false;
|
|
|
|
allowSubstitutes = true;
|
|
|
|
postBuild = ''
|
|
|
|
# replace unwrapped clang-3.9 binary by wrapper
|
|
|
|
ln -sf $out/bin/clang $out/bin/clang-[0-9]*
|
|
|
|
'';
|
|
|
|
};
|
2014-07-12 16:17:50 +01:00
|
|
|
};
|
2017-09-13 18:12:08 +01:00
|
|
|
in self
|