{ stdenv, wrapCCWith, llvm-intel-unwrapped, gcc, libgcc, }: let wrapIntel = cc: let targetConfig = stdenv.targetPlatform.config; in wrapCCWith { inherit cc; nixSupport = { cc-ldflags = [ "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" "-L${gcc.cc.lib}/lib" "-L${libgcc.out}/lib" "-L${gcc.libc}/lib" "-L${cc}/lib" ]; cc-cflags = [ "--gcc-toolchain=${gcc.cc}" "-isystem ${cc}/lib/clang/${cc.llvmMajorVersion}/include" "-isystem ${cc}/include" "-isystem ${cc}/include/intel64" "-isystem ${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}/include" ]; libcxx-cxxflags = [ # "--gcc-toolchain=${gcc.cc}" "-isystem ${gcc.cc}/include/c++/${gcc.version}" "-isystem ${gcc.cc}/include/c++/${gcc.version}/${targetConfig}" ]; }; extraBuildCommands = '' # FIXME: We should find a better way to modify the PATH instead of using # this ugly hack. See https://jungle.bsc.es/git/rarias/bscpkgs/issues/9 echo 'path_backup="${gcc.cc}/bin:$path_backup"' >>$out/nix-support/cc-wrapper-hook # Disable hardening by default echo "" > $out/nix-support/add-hardening.sh pushd $ccPath for i in $ {llvm,sycl}-* ; do ln -s $ccPath/$i $out/bin/$i done popd # Use this to detect when a compiler subprocess is called # from icpx (--fsycl-host-compiler) echo 'export NIX_CC_WRAPPER_INTEL=1' >>$out/nix-support/cc-wrapper-hook # oneMath looks for sycl libraries in bin/../lib ln -s ${cc}/lib $out/lib ln -s ${cc}/include $out/include ''; }; in wrapIntel llvm-intel-unwrapped