bscpkgs/bsc/llvm-ompss2/default.nix

28 lines
800 B
Nix
Raw Normal View History

2020-06-10 00:21:02 +08:00
{
stdenv
2020-06-17 19:00:49 +08:00
, gcc
, nanos6
, clang-ompss2-unwrapped
, wrapCCWith
, libstdcxxHook
2020-06-10 00:21:02 +08:00
}:
2020-06-15 17:54:22 +08:00
2020-06-17 19:00:49 +08:00
let
targetConfig = stdenv.targetPlatform.config;
inherit gcc nanos6;
in wrapCCWith rec {
cc = clang-ompss2-unwrapped;
extraPackages = [ libstdcxxHook ];
extraBuildCommands = ''
echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags
echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags
2020-06-17 19:21:44 +08:00
echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags
2020-06-17 19:00:49 +08:00
echo "--gcc-toolchain=${gcc}" >> $out/nix-support/cc-cflags
2020-06-11 01:35:11 +08:00
2020-06-17 19:00:49 +08:00
echo "# Hack to include NANOS6_HOME" >> $out/nix-support/setup-hook
echo "export NANOS6_HOME=${nanos6}" >> $out/nix-support/setup-hook
2020-06-10 00:21:02 +08:00
'';
}