2020-06-09 18:21:02 +02:00
|
|
|
{
|
|
|
|
stdenv
|
2020-06-17 13:00:49 +02:00
|
|
|
, gcc
|
|
|
|
, nanos6
|
2020-09-21 17:30:24 +02:00
|
|
|
, clangOmpss2Unwrapped
|
2020-06-17 13:00:49 +02:00
|
|
|
, wrapCCWith
|
2020-06-09 18:21:02 +02:00
|
|
|
}:
|
|
|
|
|
2020-06-15 11:54:22 +02:00
|
|
|
|
2020-06-17 13:00:49 +02:00
|
|
|
let
|
|
|
|
targetConfig = stdenv.targetPlatform.config;
|
|
|
|
inherit gcc nanos6;
|
|
|
|
in wrapCCWith rec {
|
2020-09-21 17:30:24 +02:00
|
|
|
cc = clangOmpss2Unwrapped;
|
2020-06-17 13:00:49 +02:00
|
|
|
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 13:21:44 +02:00
|
|
|
echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags
|
2020-07-21 16:31:31 +02:00
|
|
|
|
|
|
|
for dir in ${gcc.cc}/include/c++/*; do
|
|
|
|
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
|
|
|
|
done
|
|
|
|
for dir in ${gcc.cc}/include/c++/*/${targetConfig}; do
|
|
|
|
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
|
|
|
|
done
|
|
|
|
|
2020-06-17 13:00:49 +02:00
|
|
|
echo "--gcc-toolchain=${gcc}" >> $out/nix-support/cc-cflags
|
2020-06-10 19:35:11 +02:00
|
|
|
|
2020-06-17 13:00:49 +02:00
|
|
|
echo "# Hack to include NANOS6_HOME" >> $out/nix-support/setup-hook
|
|
|
|
echo "export NANOS6_HOME=${nanos6}" >> $out/nix-support/setup-hook
|
2022-02-21 11:51:09 +01:00
|
|
|
|
|
|
|
wrap clang++ $wrapper $ccPath/clang++
|
2020-06-09 18:21:02 +02:00
|
|
|
'';
|
|
|
|
}
|